diff --git a/src/acswebhook/model_amount.go b/src/acswebhook/model_amount.go index 466101c94..e07bd2a4d 100644 --- a/src/acswebhook/model_amount.go +++ b/src/acswebhook/model_amount.go @@ -10,8 +10,7 @@ package acswebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/acswebhook/model_authentication_info.go b/src/acswebhook/model_authentication_info.go index 64055b5f7..60de5c0b6 100644 --- a/src/acswebhook/model_authentication_info.go +++ b/src/acswebhook/model_authentication_info.go @@ -10,9 +10,8 @@ package acswebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &AuthenticationInfo{} // AuthenticationInfo struct for AuthenticationInfo type AuthenticationInfo struct { // Universally unique transaction identifier assigned by the Access Control Server (ACS) to identify a single transaction. - AcsTransId string `json:"acsTransId"` - Challenge *ChallengeInfo `json:"challenge,omitempty"` - // Specifies a preference for receiving a challenge. Possible values: * **01**: No preference * **02**: No challenge requested * **03**: Challenge requested (preference) * **04**: Challenge requested (mandate) * **05**: No challenge requested (transactional risk analysis is already performed) * **07**: No challenge requested (SCA is already performed) * **08**: No challenge requested (trusted beneficiaries exemption of no challenge required) * **09**: Challenge requested (trusted beneficiaries prompt requested if challenge required) * **80**: No challenge requested (secure corporate payment with Mastercard) * **82**: No challenge requested (secure corporate payment with Visa) + AcsTransId string `json:"acsTransId"` + Challenge *ChallengeInfo `json:"challenge,omitempty"` + // Specifies a preference for receiving a challenge. Possible values: * **01**: No preference * **02**: No challenge requested * **03**: Challenge requested (preference) * **04**: Challenge requested (mandate) * **05**: No challenge requested (transactional risk analysis is already performed) * **07**: No challenge requested (SCA is already performed) * **08**: No challenge requested (trusted beneficiaries exemption of no challenge required) * **09**: Challenge requested (trusted beneficiaries prompt requested if challenge required) * **80**: No challenge requested (secure corporate payment with Mastercard) * **82**: No challenge requested (secure corporate payment with Visa) ChallengeIndicator string `json:"challengeIndicator"` // Date and time in UTC of the cardholder authentication. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. CreatedAt time.Time `json:"createdAt"` @@ -31,7 +30,7 @@ type AuthenticationInfo struct { DeviceChannel string `json:"deviceChannel"` // Universally unique transaction identifier assigned by the DS (card scheme) to identify a single transaction. DsTransID string `json:"dsTransID"` - // Indicates the exemption type that was applied to the authentication by the issuer, if exemption applied. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** * **acquirerExemption** * **noExemptionApplied** * **visaDAFExemption** + // Indicates the exemption type that was applied to the authentication by the issuer, if exemption applied. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** * **acquirerExemption** * **noExemptionApplied** * **visaDAFExemption** ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` // Indicates if the purchase was in the PSD2 scope. InPSD2Scope bool `json:"inPSD2Scope"` @@ -43,7 +42,7 @@ type AuthenticationInfo struct { RiskScore *int32 `json:"riskScore,omitempty"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID string `json:"threeDSServerTransID"` - // The `transStatus` value as defined in the 3D Secure 2 specification. Possible values: * **Y**: Authentication / Account verification successful. * **N**: Not Authenticated / Account not verified. Transaction denied. * **U**: Authentication / Account verification could not be performed. * **I**: Informational Only / 3D Secure Requestor challenge preference acknowledged. * **R**: Authentication / Account verification rejected by the Issuer. + // The `transStatus` value as defined in the 3D Secure 2 specification. Possible values: * **Y**: Authentication / Account verification successful. * **N**: Not Authenticated / Account not verified. Transaction denied. * **U**: Authentication / Account verification could not be performed. * **I**: Informational Only / 3D Secure Requestor challenge preference acknowledged. * **R**: Authentication / Account verification rejected by the Issuer. TransStatus string `json:"transStatus"` // Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). TransStatusReason *string `json:"transStatusReason,omitempty"` @@ -472,7 +471,7 @@ func (o *AuthenticationInfo) SetType(v string) { } func (o AuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -543,66 +542,68 @@ func (v *NullableAuthenticationInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AuthenticationInfo) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "07", "08", "09", "80", "82"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "07", "08", "09", "80", "82" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidDeviceChannel() bool { - var allowedEnumValues = []string{"app", "browser", "ThreeDSRequestorInitiated"} - for _, allowed := range allowedEnumValues { - if o.GetDeviceChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "app", "browser", "ThreeDSRequestorInitiated" } + for _, allowed := range allowedEnumValues { + if o.GetDeviceChannel() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis", "acquirerExemption", "noExemptionApplied", "visaDAFExemption"} - for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis", "acquirerExemption", "noExemptionApplied", "visaDAFExemption" } + for _, allowed := range allowedEnumValues { + if o.GetExemptionIndicator() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidMessageCategory() bool { - var allowedEnumValues = []string{"payment", "nonPayment"} - for _, allowed := range allowedEnumValues { - if o.GetMessageCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "payment", "nonPayment" } + for _, allowed := range allowedEnumValues { + if o.GetMessageCategory() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidTransStatus() bool { - var allowedEnumValues = []string{"Y", "N", "R", "I", "U"} - for _, allowed := range allowedEnumValues { - if o.GetTransStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N", "R", "I", "U" } + for _, allowed := range allowedEnumValues { + if o.GetTransStatus() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidTransStatusReason() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "80", "81", "82", "83", "84", "85", "86", "87", "88"} - for _, allowed := range allowedEnumValues { - if o.GetTransStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "80", "81", "82", "83", "84", "85", "86", "87", "88" } + for _, allowed := range allowedEnumValues { + if o.GetTransStatusReason() == allowed { + return true + } + } + return false } func (o *AuthenticationInfo) isValidType() bool { - var allowedEnumValues = []string{"frictionless", "challenge"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "frictionless", "challenge" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/acswebhook/model_authentication_notification_data.go b/src/acswebhook/model_authentication_notification_data.go index 7a4432b63..297911d19 100644 --- a/src/acswebhook/model_authentication_notification_data.go +++ b/src/acswebhook/model_authentication_notification_data.go @@ -10,8 +10,7 @@ package acswebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationNotificationData type satisfies the MappedNullable interface at compile time @@ -25,8 +24,8 @@ type AuthenticationNotificationData struct { // Unique identifier of the authentication. Id string `json:"id"` // Unique identifier of the payment instrument that was used for the authentication. - PaymentInstrumentId string `json:"paymentInstrumentId"` - Purchase PurchaseInfo `json:"purchase"` + PaymentInstrumentId string `json:"paymentInstrumentId"` + Purchase PurchaseInfo `json:"purchase"` // Outcome of the authentication. Allowed values: * authenticated * rejected * error Status string `json:"status"` } @@ -206,7 +205,7 @@ func (o *AuthenticationNotificationData) SetStatus(v string) { } func (o AuthenticationNotificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -262,12 +261,14 @@ func (v *NullableAuthenticationNotificationData) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *AuthenticationNotificationData) isValidStatus() bool { - var allowedEnumValues = []string{"authenticated", "rejected", "error"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "authenticated", "rejected", "error" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/acswebhook/model_authentication_notification_request.go b/src/acswebhook/model_authentication_notification_request.go index 7e155eeaf..c882e1b68 100644 --- a/src/acswebhook/model_authentication_notification_request.go +++ b/src/acswebhook/model_authentication_notification_request.go @@ -10,8 +10,7 @@ package acswebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationNotificationRequest type satisfies the MappedNullable interface at compile time @@ -119,7 +118,7 @@ func (o *AuthenticationNotificationRequest) SetType(v string) { } func (o AuthenticationNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,12 +169,14 @@ func (v *NullableAuthenticationNotificationRequest) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *AuthenticationNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"balancePlatform.authentication.created"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "balancePlatform.authentication.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/acswebhook/model_balance_platform_notification_response.go b/src/acswebhook/model_balance_platform_notification_response.go index 4f06b1f4b..c3c350d69 100644 --- a/src/acswebhook/model_balance_platform_notification_response.go +++ b/src/acswebhook/model_balance_platform_notification_response.go @@ -10,8 +10,7 @@ package acswebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BalancePlatformNotificationResponse) SetNotificationResponse(v string) } func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/acswebhook/model_challenge_info.go b/src/acswebhook/model_challenge_info.go index 303ca561c..df641262f 100644 --- a/src/acswebhook/model_challenge_info.go +++ b/src/acswebhook/model_challenge_info.go @@ -10,9 +10,8 @@ package acswebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ChallengeInfo type satisfies the MappedNullable interface at compile time @@ -230,7 +229,7 @@ func (o *ChallengeInfo) SetRetries(v int32) { } func (o ChallengeInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -292,21 +291,23 @@ func (v *NullableChallengeInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ChallengeInfo) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ChallengeInfo) isValidFlow() bool { - var allowedEnumValues = []string{"OTP_SMS", "OOB"} - for _, allowed := range allowedEnumValues { - if o.GetFlow() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "OTP_SMS", "OOB" } + for _, allowed := range allowedEnumValues { + if o.GetFlow() == allowed { + return true + } + } + return false } + diff --git a/src/acswebhook/model_purchase_info.go b/src/acswebhook/model_purchase_info.go index 8ecdaf442..d8fd3273e 100644 --- a/src/acswebhook/model_purchase_info.go +++ b/src/acswebhook/model_purchase_info.go @@ -10,8 +10,7 @@ package acswebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PurchaseInfo type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type PurchaseInfo struct { // Date of the purchase. Date string `json:"date"` // Name of the merchant. - MerchantName string `json:"merchantName"` + MerchantName string `json:"merchantName"` OriginalAmount Amount `json:"originalAmount"` } @@ -119,7 +118,7 @@ func (o *PurchaseInfo) SetOriginalAmount(v Amount) { } func (o PurchaseInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -169,3 +168,6 @@ func (v *NullablePurchaseInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/acswebhook/model_resource.go b/src/acswebhook/model_resource.go index b4e124ff6..ba92873da 100644 --- a/src/acswebhook/model_resource.go +++ b/src/acswebhook/model_resource.go @@ -10,9 +10,8 @@ package acswebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Resource type satisfies the MappedNullable interface at compile time @@ -142,7 +141,7 @@ func (o *Resource) SetId(v string) { } func (o Resource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balancecontrol/api_general.go b/src/balancecontrol/api_general.go index dfe11cac9..0acd7dfa2 100644 --- a/src/balancecontrol/api_general.go +++ b/src/balancecontrol/api_general.go @@ -10,10 +10,10 @@ package balancecontrol import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiBalanceTransferInput) BalanceTransferRequest(balanceTransferRe return r } + /* Prepare a request for BalanceTransfer @return GeneralApiBalanceTransferInput */ func (a *GeneralApi) BalanceTransferInput() GeneralApiBalanceTransferInput { - return GeneralApiBalanceTransferInput{} + return GeneralApiBalanceTransferInput{ + } } /* @@ -57,20 +59,22 @@ When sending multiple API requests with the same source and destination merchant @return BalanceTransferResponse, *http.Response, error */ func (a *GeneralApi) BalanceTransfer(ctx context.Context, r GeneralApiBalanceTransferInput) (BalanceTransferResponse, *http.Response, error) { - res := &BalanceTransferResponse{} + res := &BalanceTransferResponse{} path := "/balanceTransfer" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.balanceTransferRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.balanceTransferRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/balancecontrol/model_amount.go b/src/balancecontrol/model_amount.go index e82fcc970..d078e3c5f 100644 --- a/src/balancecontrol/model_amount.go +++ b/src/balancecontrol/model_amount.go @@ -10,8 +10,7 @@ package balancecontrol import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balancecontrol/model_balance_transfer_request.go b/src/balancecontrol/model_balance_transfer_request.go index fbd86c8f3..f25480f31 100644 --- a/src/balancecontrol/model_balance_transfer_request.go +++ b/src/balancecontrol/model_balance_transfer_request.go @@ -10,8 +10,7 @@ package balancecontrol import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceTransferRequest type satisfies the MappedNullable interface at compile time @@ -214,7 +213,7 @@ func (o *BalanceTransferRequest) SetType(v string) { } func (o BalanceTransferRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableBalanceTransferRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceTransferRequest) isValidType() bool { - var allowedEnumValues = []string{"tax", "fee", "terminalSale", "credit", "debit", "adjustment"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "tax", "fee", "terminalSale", "credit", "debit", "adjustment" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balancecontrol/model_balance_transfer_response.go b/src/balancecontrol/model_balance_transfer_response.go index 74c4cb7e1..b50e58722 100644 --- a/src/balancecontrol/model_balance_transfer_response.go +++ b/src/balancecontrol/model_balance_transfer_response.go @@ -10,9 +10,8 @@ package balancecontrol import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceTransferResponse type satisfies the MappedNullable interface at compile time @@ -296,7 +295,7 @@ func (o *BalanceTransferResponse) SetType(v string) { } func (o BalanceTransferResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -357,21 +356,23 @@ func (v *NullableBalanceTransferResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceTransferResponse) isValidStatus() bool { - var allowedEnumValues = []string{"error", "failed", "notEnoughBalance", "transferred"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "error", "failed", "notEnoughBalance", "transferred" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *BalanceTransferResponse) isValidType() bool { - var allowedEnumValues = []string{"tax", "fee", "terminalSale", "credit", "debit", "adjustment"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "tax", "fee", "terminalSale", "credit", "debit", "adjustment" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/api_account_holders.go b/src/balanceplatform/api_account_holders.go index 1ed21e95a..70da5a01e 100644 --- a/src/balanceplatform/api_account_holders.go +++ b/src/balanceplatform/api_account_holders.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AccountHoldersApi service @@ -32,13 +29,15 @@ func (r AccountHoldersApiCreateAccountHolderInput) AccountHolderInfo(accountHold return r } + /* Prepare a request for CreateAccountHolder @return AccountHoldersApiCreateAccountHolderInput */ func (a *AccountHoldersApi) CreateAccountHolderInput() AccountHoldersApiCreateAccountHolderInput { - return AccountHoldersApiCreateAccountHolderInput{} + return AccountHoldersApiCreateAccountHolderInput{ + } } /* @@ -53,75 +52,77 @@ Creates an account holder linked to a [legal entity](https://docs.adyen.com/api- @return AccountHolder, *http.Response, error */ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHoldersApiCreateAccountHolderInput) (AccountHolder, *http.Response, error) { - res := &AccountHolder{} + res := &AccountHolder{} path := "/accountHolders" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.accountHolderInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.accountHolderInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountHoldersApi.GetAccountHolder type AccountHoldersApiGetAccountHolderInput struct { id string } + /* Prepare a request for GetAccountHolder @param id The unique identifier of the account holder. @@ -143,76 +144,77 @@ Returns an account holder. @return AccountHolder, *http.Response, error */ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHoldersApiGetAccountHolderInput) (AccountHolder, *http.Response, error) { - res := &AccountHolder{} + res := &AccountHolder{} path := "/accountHolders/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountHoldersApi.GetAllBalanceAccountsOfAccountHolder type AccountHoldersApiGetAllBalanceAccountsOfAccountHolderInput struct { - id string + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. @@ -227,6 +229,7 @@ func (r AccountHoldersApiGetAllBalanceAccountsOfAccountHolderInput) Limit(limit return r } + /* Prepare a request for GetAllBalanceAccountsOfAccountHolder @param id The unique identifier of the account holder. @@ -241,7 +244,7 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolderInput(id string) /* GetAllBalanceAccountsOfAccountHolder Get all balance accounts of an account holder -Returns a paginated list of the balance accounts associated with an account holder. To fetch multiple pages, use the query parameters. +Returns a paginated list of the balance accounts associated with an account holder. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 balance accounts and skip the first 10, use `/accountHolders/{id}/balanceAccounts?limit=5&offset=10`. @@ -250,82 +253,83 @@ For example, to limit the page to 5 balance accounts and skip the first 10, use @return PaginatedBalanceAccountsResponse, *http.Response, error */ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Context, r AccountHoldersApiGetAllBalanceAccountsOfAccountHolderInput) (PaginatedBalanceAccountsResponse, *http.Response, error) { - res := &PaginatedBalanceAccountsResponse{} + res := &PaginatedBalanceAccountsResponse{} path := "/accountHolders/{id}/balanceAccounts" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountHoldersApi.GetTaxForm type AccountHoldersApiGetTaxFormInput struct { - id string + id string formType *string - year *int32 + year *int32 } // The type of tax form you want to retrieve. Accepted values are **US1099k** and **US1099nec** @@ -340,6 +344,7 @@ func (r AccountHoldersApiGetTaxFormInput) Year(year int32) AccountHoldersApiGetT return r } + /* Prepare a request for GetTaxForm @param id The unique identifier of the account holder. @@ -361,80 +366,81 @@ Generates a tax form for account holders operating in the US. For more informati @return GetTaxFormResponse, *http.Response, error */ func (a *AccountHoldersApi) GetTaxForm(ctx context.Context, r AccountHoldersApiGetTaxFormInput) (GetTaxFormResponse, *http.Response, error) { - res := &GetTaxFormResponse{} + res := &GetTaxFormResponse{} path := "/accountHolders/{id}/taxForms" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.formType != nil { - common.ParameterAddToQuery(queryParams, "formType", r.formType, "") - } - if r.year != nil { - common.ParameterAddToQuery(queryParams, "year", r.year, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.formType != nil { + common.ParameterAddToQuery(queryParams, "formType", r.formType, "") + } + if r.year != nil { + common.ParameterAddToQuery(queryParams, "year", r.year, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountHoldersApi.UpdateAccountHolder type AccountHoldersApiUpdateAccountHolderInput struct { - id string + id string accountHolderUpdateRequest *AccountHolderUpdateRequest } @@ -443,6 +449,7 @@ func (r AccountHoldersApiUpdateAccountHolderInput) AccountHolderUpdateRequest(ac return r } + /* Prepare a request for UpdateAccountHolder @param id The unique identifier of the account holder. @@ -464,67 +471,68 @@ Updates an account holder. When updating an account holder resource, if a parame @return AccountHolder, *http.Response, error */ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHoldersApiUpdateAccountHolderInput) (AccountHolder, *http.Response, error) { - res := &AccountHolder{} + res := &AccountHolder{} path := "/accountHolders/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.accountHolderUpdateRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.accountHolderUpdateRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index 44981ac51..1e44e5546 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // BalanceAccountsApi service @@ -32,13 +29,15 @@ func (r BalanceAccountsApiCreateBalanceAccountInput) BalanceAccountInfo(balanceA return r } + /* Prepare a request for CreateBalanceAccount @return BalanceAccountsApiCreateBalanceAccountInput */ func (a *BalanceAccountsApi) CreateBalanceAccountInput() BalanceAccountsApiCreateBalanceAccountInput { - return BalanceAccountsApiCreateBalanceAccountInput{} + return BalanceAccountsApiCreateBalanceAccountInput{ + } } /* @@ -51,73 +50,74 @@ Creates a balance account that holds the funds of the associated account holder. @return BalanceAccount, *http.Response, error */ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r BalanceAccountsApiCreateBalanceAccountInput) (BalanceAccount, *http.Response, error) { - res := &BalanceAccount{} + res := &BalanceAccount{} path := "/balanceAccounts" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.balanceAccountInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.balanceAccountInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.CreateSweep type BalanceAccountsApiCreateSweepInput struct { - balanceAccountId string + balanceAccountId string createSweepConfigurationV2 *CreateSweepConfigurationV2 } @@ -126,6 +126,7 @@ func (r BalanceAccountsApiCreateSweepInput) CreateSweepConfigurationV2(createSwe return r } + /* Prepare a request for CreateSweep @param balanceAccountId The unique identifier of the balance account. @@ -149,77 +150,79 @@ A sweep pulls in or pushes out funds based on a defined schedule, amount, curren @return SweepConfigurationV2, *http.Response, error */ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsApiCreateSweepInput) (SweepConfigurationV2, *http.Response, error) { - res := &SweepConfigurationV2{} + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createSweepConfigurationV2, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createSweepConfigurationV2, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.DeleteSweep type BalanceAccountsApiDeleteSweepInput struct { balanceAccountId string - sweepId string + sweepId string } + /* Prepare a request for DeleteSweep @param balanceAccountId The unique identifier of the balance account.@param sweepId The unique identifier of the sweep. @@ -228,7 +231,7 @@ Prepare a request for DeleteSweep func (a *BalanceAccountsApi) DeleteSweepInput(balanceAccountId string, sweepId string) BalanceAccountsApiDeleteSweepInput { return BalanceAccountsApiDeleteSweepInput{ balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -242,77 +245,78 @@ Deletes a sweep for a balance account. @return *http.Response, error */ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsApiDeleteSweepInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by BalanceAccountsApi.GetAllPaymentInstrumentsForBalanceAccount type BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput struct { - id string + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. @@ -327,6 +331,7 @@ func (r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput) Limit( return r } + /* Prepare a request for GetAllPaymentInstrumentsForBalanceAccount @param id The unique identifier of the balance account. @@ -341,7 +346,7 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccountInput(id s /* GetAllPaymentInstrumentsForBalanceAccount Get all payment instruments for a balance account -Returns a paginated list of the payment instruments associated with a balance account. +Returns a paginated list of the payment instruments associated with a balance account. To fetch multiple pages, use the query parameters.For example, to limit the page to 3 payment instruments and to skip the first 6, use `/balanceAccounts/{id}/paymentInstruments?limit=3&offset=6`. @@ -350,82 +355,83 @@ To fetch multiple pages, use the query parameters.For example, to limit the page @return PaginatedPaymentInstrumentsResponse, *http.Response, error */ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx context.Context, r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput) (PaginatedPaymentInstrumentsResponse, *http.Response, error) { - res := &PaginatedPaymentInstrumentsResponse{} + res := &PaginatedPaymentInstrumentsResponse{} path := "/balanceAccounts/{id}/paymentInstruments" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.GetAllSweepsForBalanceAccount type BalanceAccountsApiGetAllSweepsForBalanceAccountInput struct { balanceAccountId string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The number of items that you want to skip. @@ -440,6 +446,7 @@ func (r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) Limit(limit int32) return r } + /* Prepare a request for GetAllSweepsForBalanceAccount @param balanceAccountId The unique identifier of the balance account. @@ -463,82 +470,84 @@ To fetch multiple pages, use the query parameters. For example, to limit the pag @return BalanceSweepConfigurationsResponse, *http.Response, error */ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) (BalanceSweepConfigurationsResponse, *http.Response, error) { - res := &BalanceSweepConfigurationsResponse{} + res := &BalanceSweepConfigurationsResponse{} path := "/balanceAccounts/{balanceAccountId}/sweeps" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.GetBalanceAccount type BalanceAccountsApiGetBalanceAccountInput struct { id string } + /* Prepare a request for GetBalanceAccount @param id The unique identifier of the balance account. @@ -560,77 +569,79 @@ Returns a balance account and its balances for the default currency and other cu @return BalanceAccount, *http.Response, error */ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAccountsApiGetBalanceAccountInput) (BalanceAccount, *http.Response, error) { - res := &BalanceAccount{} + res := &BalanceAccount{} path := "/balanceAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.GetSweep type BalanceAccountsApiGetSweepInput struct { balanceAccountId string - sweepId string + sweepId string } + /* Prepare a request for GetSweep @param balanceAccountId The unique identifier of the balance account.@param sweepId The unique identifier of the sweep. @@ -639,7 +650,7 @@ Prepare a request for GetSweep func (a *BalanceAccountsApi) GetSweepInput(balanceAccountId string, sweepId string) BalanceAccountsApiGetSweepInput { return BalanceAccountsApiGetSweepInput{ balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -653,75 +664,76 @@ Returns a sweep. @return SweepConfigurationV2, *http.Response, error */ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiGetSweepInput) (SweepConfigurationV2, *http.Response, error) { - res := &SweepConfigurationV2{} + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.UpdateBalanceAccount type BalanceAccountsApiUpdateBalanceAccountInput struct { - id string + id string balanceAccountUpdateRequest *BalanceAccountUpdateRequest } @@ -730,6 +742,7 @@ func (r BalanceAccountsApiUpdateBalanceAccountInput) BalanceAccountUpdateRequest return r } + /* Prepare a request for UpdateBalanceAccount @param id The unique identifier of the balance account. @@ -751,75 +764,76 @@ Updates a balance account. @return BalanceAccount, *http.Response, error */ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r BalanceAccountsApiUpdateBalanceAccountInput) (BalanceAccount, *http.Response, error) { - res := &BalanceAccount{} + res := &BalanceAccount{} path := "/balanceAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.balanceAccountUpdateRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.balanceAccountUpdateRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by BalanceAccountsApi.UpdateSweep type BalanceAccountsApiUpdateSweepInput struct { - balanceAccountId string - sweepId string + balanceAccountId string + sweepId string updateSweepConfigurationV2 *UpdateSweepConfigurationV2 } @@ -828,6 +842,7 @@ func (r BalanceAccountsApiUpdateSweepInput) UpdateSweepConfigurationV2(updateSwe return r } + /* Prepare a request for UpdateSweep @param balanceAccountId The unique identifier of the balance account.@param sweepId The unique identifier of the sweep. @@ -836,7 +851,7 @@ Prepare a request for UpdateSweep func (a *BalanceAccountsApi) UpdateSweepInput(balanceAccountId string, sweepId string) BalanceAccountsApiUpdateSweepInput { return BalanceAccountsApiUpdateSweepInput{ balanceAccountId: balanceAccountId, - sweepId: sweepId, + sweepId: sweepId, } } @@ -850,68 +865,69 @@ Updates a sweep. When updating a sweep resource, note that if a request paramete @return SweepConfigurationV2, *http.Response, error */ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsApiUpdateSweepInput) (SweepConfigurationV2, *http.Response, error) { - res := &SweepConfigurationV2{} + res := &SweepConfigurationV2{} path := "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) - path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateSweepConfigurationV2, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) + path = strings.Replace(path, "{"+"sweepId"+"}", url.PathEscape(common.ParameterValueToString(r.sweepId, "sweepId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateSweepConfigurationV2, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_bank_account_validation.go b/src/balanceplatform/api_bank_account_validation.go index 60dc68a92..379e8041b 100644 --- a/src/balanceplatform/api_bank_account_validation.go +++ b/src/balanceplatform/api_bank_account_validation.go @@ -10,12 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // BankAccountValidationApi service @@ -31,13 +29,15 @@ func (r BankAccountValidationApiValidateBankAccountIdentificationInput) BankAcco return r } + /* Prepare a request for ValidateBankAccountIdentification @return BankAccountValidationApiValidateBankAccountIdentificationInput */ func (a *BankAccountValidationApi) ValidateBankAccountIdentificationInput() BankAccountValidationApiValidateBankAccountIdentificationInput { - return BankAccountValidationApiValidateBankAccountIdentificationInput{} + return BankAccountValidationApiValidateBankAccountIdentificationInput{ + } } /* @@ -50,58 +50,59 @@ Validates bank account identification details. You can use this endpoint to vali @return *http.Response, error */ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context.Context, r BankAccountValidationApiValidateBankAccountIdentificationInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/validateBankAccountIdentification" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.bankAccountIdentificationValidationRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.bankAccountIdentificationValidationRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + diff --git a/src/balanceplatform/api_grant_accounts.go b/src/balanceplatform/api_grant_accounts.go index f1673a092..55c3cc939 100644 --- a/src/balanceplatform/api_grant_accounts.go +++ b/src/balanceplatform/api_grant_accounts.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GrantAccountsApi service @@ -27,6 +24,7 @@ type GrantAccountsApiGetGrantAccountInput struct { id string } + /* Prepare a request for GetGrantAccount @param id The unique identifier of the grant account. @@ -48,67 +46,68 @@ Returns the details of the [grant account](https://docs.adyen.com/marketplaces-a @return CapitalGrantAccount, *http.Response, error */ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsApiGetGrantAccountInput) (CapitalGrantAccount, *http.Response, error) { - res := &CapitalGrantAccount{} + res := &CapitalGrantAccount{} path := "/grantAccounts/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) - if httpRes == nil { - return *res, httpRes, err - } + if httpRes == nil { + return *res, httpRes, err + } - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } - return *res, httpRes, err + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_grant_offers.go b/src/balanceplatform/api_grant_offers.go index 7ef6c3142..8c8fac9d1 100644 --- a/src/balanceplatform/api_grant_offers.go +++ b/src/balanceplatform/api_grant_offers.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GrantOffersApi service @@ -33,13 +30,15 @@ func (r GrantOffersApiGetAllAvailableGrantOffersInput) AccountHolderId(accountHo return r } + /* Prepare a request for GetAllAvailableGrantOffers @return GrantOffersApiGetAllAvailableGrantOffersInput */ func (a *GrantOffersApi) GetAllAvailableGrantOffersInput() GrantOffersApiGetAllAvailableGrantOffersInput { - return GrantOffersApiGetAllAvailableGrantOffersInput{} + return GrantOffersApiGetAllAvailableGrantOffersInput{ + } } /* @@ -52,78 +51,80 @@ Returns a list of all [grant offers](https://docs.adyen.com/marketplaces-and-pla @return GrantOffers, *http.Response, error */ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r GrantOffersApiGetAllAvailableGrantOffersInput) (GrantOffers, *http.Response, error) { - res := &GrantOffers{} + res := &GrantOffers{} path := "/grantOffers" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.accountHolderId != nil { - common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.accountHolderId != nil { + common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by GrantOffersApi.GetGrantOffer type GrantOffersApiGetGrantOfferInput struct { grantOfferId string } + /* Prepare a request for GetGrantOffer @param grantOfferId The unique identifier of the grant offer. @@ -145,67 +146,68 @@ Returns the details of a single grant offer. @return GrantOffer, *http.Response, error */ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetGrantOfferInput) (GrantOffer, *http.Response, error) { - res := &GrantOffer{} + res := &GrantOffer{} path := "/grantOffers/{grantOfferId}" - path = strings.Replace(path, "{"+"grantOfferId"+"}", url.PathEscape(common.ParameterValueToString(r.grantOfferId, "grantOfferId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"grantOfferId"+"}", url.PathEscape(common.ParameterValueToString(r.grantOfferId, "grantOfferId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_network_tokens.go b/src/balanceplatform/api_network_tokens.go index cd0062d0b..db8cd3ca5 100644 --- a/src/balanceplatform/api_network_tokens.go +++ b/src/balanceplatform/api_network_tokens.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // NetworkTokensApi service @@ -27,6 +24,7 @@ type NetworkTokensApiGetNetworkTokenInput struct { networkTokenId string } + /* Prepare a request for GetNetworkToken @param networkTokenId The unique identifier of the network token. @@ -48,66 +46,67 @@ Returns the details of a network token. @return GetNetworkTokenResponse, *http.Response, error */ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensApiGetNetworkTokenInput) (GetNetworkTokenResponse, *http.Response, error) { - res := &GetNetworkTokenResponse{} + res := &GetNetworkTokenResponse{} path := "/networkTokens/{networkTokenId}" - path = strings.Replace(path, "{"+"networkTokenId"+"}", url.PathEscape(common.ParameterValueToString(r.networkTokenId, "networkTokenId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"networkTokenId"+"}", url.PathEscape(common.ParameterValueToString(r.networkTokenId, "networkTokenId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by NetworkTokensApi.UpdateNetworkToken type NetworkTokensApiUpdateNetworkTokenInput struct { - networkTokenId string + networkTokenId string updateNetworkTokenRequest *UpdateNetworkTokenRequest } @@ -116,6 +115,7 @@ func (r NetworkTokensApiUpdateNetworkTokenInput) UpdateNetworkTokenRequest(updat return r } + /* Prepare a request for UpdateNetworkToken @param networkTokenId The unique identifier of the network token. @@ -137,59 +137,60 @@ Updates the status of the network token. @return *http.Response, error */ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkTokensApiUpdateNetworkTokenInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/networkTokens/{networkTokenId}" - path = strings.Replace(path, "{"+"networkTokenId"+"}", url.PathEscape(common.ParameterValueToString(r.networkTokenId, "networkTokenId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateNetworkTokenRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"networkTokenId"+"}", url.PathEscape(common.ParameterValueToString(r.networkTokenId, "networkTokenId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateNetworkTokenRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + diff --git a/src/balanceplatform/api_payment_instrument_groups.go b/src/balanceplatform/api_payment_instrument_groups.go index 45f8fe373..46127d297 100644 --- a/src/balanceplatform/api_payment_instrument_groups.go +++ b/src/balanceplatform/api_payment_instrument_groups.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentInstrumentGroupsApi service @@ -32,13 +29,15 @@ func (r PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput) PaymentInst return r } + /* Prepare a request for CreatePaymentInstrumentGroup @return PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput */ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroupInput() PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput { - return PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput{} + return PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput{ + } } /* @@ -51,75 +50,77 @@ Creates a payment instrument group to associate and group payment instrument res @return PaymentInstrumentGroup, *http.Response, error */ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Context, r PaymentInstrumentGroupsApiCreatePaymentInstrumentGroupInput) (PaymentInstrumentGroup, *http.Response, error) { - res := &PaymentInstrumentGroup{} + res := &PaymentInstrumentGroup{} path := "/paymentInstrumentGroups" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentInstrumentGroupInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentInstrumentGroupInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentGroupsApi.GetAllTransactionRulesForPaymentInstrumentGroup type PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupInput struct { id string } + /* Prepare a request for GetAllTransactionRulesForPaymentInstrumentGroup @param id The unique identifier of the payment instrument group. @@ -141,76 +142,78 @@ Returns a list of all the transaction rules associated with a payment instrument @return TransactionRulesResponse, *http.Response, error */ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentGroup(ctx context.Context, r PaymentInstrumentGroupsApiGetAllTransactionRulesForPaymentInstrumentGroupInput) (TransactionRulesResponse, *http.Response, error) { - res := &TransactionRulesResponse{} + res := &TransactionRulesResponse{} path := "/paymentInstrumentGroups/{id}/transactionRules" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentGroupsApi.GetPaymentInstrumentGroup type PaymentInstrumentGroupsApiGetPaymentInstrumentGroupInput struct { id string } + /* Prepare a request for GetPaymentInstrumentGroup @param id The unique identifier of the payment instrument group. @@ -232,67 +235,68 @@ Returns the details of a payment instrument group. @return PaymentInstrumentGroup, *http.Response, error */ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Context, r PaymentInstrumentGroupsApiGetPaymentInstrumentGroupInput) (PaymentInstrumentGroup, *http.Response, error) { - res := &PaymentInstrumentGroup{} + res := &PaymentInstrumentGroup{} path := "/paymentInstrumentGroups/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_payment_instruments.go b/src/balanceplatform/api_payment_instruments.go index 22f04a2df..73be4da99 100644 --- a/src/balanceplatform/api_payment_instruments.go +++ b/src/balanceplatform/api_payment_instruments.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentInstrumentsApi service @@ -32,13 +29,15 @@ func (r PaymentInstrumentsApiCreatePaymentInstrumentInput) PaymentInstrumentInfo return r } + /* Prepare a request for CreatePaymentInstrument @return PaymentInstrumentsApiCreatePaymentInstrumentInput */ func (a *PaymentInstrumentsApi) CreatePaymentInstrumentInput() PaymentInstrumentsApiCreatePaymentInstrumentInput { - return PaymentInstrumentsApiCreatePaymentInstrumentInput{} + return PaymentInstrumentsApiCreatePaymentInstrumentInput{ + } } /* @@ -53,75 +52,77 @@ Creates a payment instrument to issue a physical card, a virtual card, or a busi @return PaymentInstrument, *http.Response, error */ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r PaymentInstrumentsApiCreatePaymentInstrumentInput) (PaymentInstrument, *http.Response, error) { - res := &PaymentInstrument{} + res := &PaymentInstrument{} path := "/paymentInstruments" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentInstrumentInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentInstrumentInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentsApi.GetAllTransactionRulesForPaymentInstrument type PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentInput struct { id string } + /* Prepare a request for GetAllTransactionRulesForPaymentInstrument @param id The unique identifier of the payment instrument. @@ -143,76 +144,78 @@ Returns a list of transaction rules associated with a payment instrument. @return TransactionRulesResponse, *http.Response, error */ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx context.Context, r PaymentInstrumentsApiGetAllTransactionRulesForPaymentInstrumentInput) (TransactionRulesResponse, *http.Response, error) { - res := &TransactionRulesResponse{} + res := &TransactionRulesResponse{} path := "/paymentInstruments/{id}/transactionRules" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentsApi.GetPanOfPaymentInstrument type PaymentInstrumentsApiGetPanOfPaymentInstrumentInput struct { id string } + /* Prepare a request for GetPanOfPaymentInstrument @param id The unique identifier of the payment instrument. @@ -238,76 +241,78 @@ To make this request, your API credential must have the following [role](https:/ @return PaymentInstrumentRevealInfo, *http.Response, error */ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r PaymentInstrumentsApiGetPanOfPaymentInstrumentInput) (PaymentInstrumentRevealInfo, *http.Response, error) { - res := &PaymentInstrumentRevealInfo{} + res := &PaymentInstrumentRevealInfo{} path := "/paymentInstruments/{id}/reveal" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentsApi.GetPaymentInstrument type PaymentInstrumentsApiGetPaymentInstrumentInput struct { id string } + /* Prepare a request for GetPaymentInstrument @param id The unique identifier of the payment instrument. @@ -329,76 +334,78 @@ Returns the details of a payment instrument. @return PaymentInstrument, *http.Response, error */ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r PaymentInstrumentsApiGetPaymentInstrumentInput) (PaymentInstrument, *http.Response, error) { - res := &PaymentInstrument{} + res := &PaymentInstrument{} path := "/paymentInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentsApi.ListNetworkTokens type PaymentInstrumentsApiListNetworkTokensInput struct { id string } + /* Prepare a request for ListNetworkTokens @param id The unique identifier of the payment instrument. @@ -420,74 +427,75 @@ List the network tokens connected to a payment instrument. @return ListNetworkTokensResponse, *http.Response, error */ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r PaymentInstrumentsApiListNetworkTokensInput) (ListNetworkTokensResponse, *http.Response, error) { - res := &ListNetworkTokensResponse{} + res := &ListNetworkTokensResponse{} path := "/paymentInstruments/{id}/networkTokens" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentInstrumentsApi.UpdatePaymentInstrument type PaymentInstrumentsApiUpdatePaymentInstrumentInput struct { - id string + id string paymentInstrumentUpdateRequest *PaymentInstrumentUpdateRequest } @@ -496,6 +504,7 @@ func (r PaymentInstrumentsApiUpdatePaymentInstrumentInput) PaymentInstrumentUpda return r } + /* Prepare a request for UpdatePaymentInstrument @param id The unique identifier of the payment instrument. @@ -517,67 +526,68 @@ Updates a payment instrument. Once a payment instrument is already active, you c @return UpdatePaymentInstrument, *http.Response, error */ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r PaymentInstrumentsApiUpdatePaymentInstrumentInput) (UpdatePaymentInstrument, *http.Response, error) { - res := &UpdatePaymentInstrument{} + res := &UpdatePaymentInstrument{} path := "/paymentInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentInstrumentUpdateRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentInstrumentUpdateRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_platform.go b/src/balanceplatform/api_platform.go index 3dab7f7b1..7299a925b 100644 --- a/src/balanceplatform/api_platform.go +++ b/src/balanceplatform/api_platform.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PlatformApi service @@ -24,9 +21,9 @@ type PlatformApi common.Service // All parameters accepted by PlatformApi.GetAllAccountHoldersUnderBalancePlatform type PlatformApiGetAllAccountHoldersUnderBalancePlatformInput struct { - id string + id string offset *int32 - limit *int32 + limit *int32 } // The number of items that you want to skip. @@ -41,6 +38,7 @@ func (r PlatformApiGetAllAccountHoldersUnderBalancePlatformInput) Limit(limit in return r } + /* Prepare a request for GetAllAccountHoldersUnderBalancePlatform @param id The unique identifier of the balance platform. @@ -55,7 +53,7 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatformInput(id string) P /* GetAllAccountHoldersUnderBalancePlatform Get all account holders under a balance platform -Returns a paginated list of all the account holders that belong to the balance platform. To fetch multiple pages, use the query parameters. +Returns a paginated list of all the account holders that belong to the balance platform. To fetch multiple pages, use the query parameters. For example, to limit the page to 5 account holders and to skip the first 20, use `/balancePlatforms/{id}/accountHolders?limit=5&offset=20`. @@ -64,82 +62,84 @@ For example, to limit the page to 5 account holders and to skip the first 20, us @return PaginatedAccountHoldersResponse, *http.Response, error */ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Context, r PlatformApiGetAllAccountHoldersUnderBalancePlatformInput) (PaginatedAccountHoldersResponse, *http.Response, error) { - res := &PaginatedAccountHoldersResponse{} + res := &PaginatedAccountHoldersResponse{} path := "/balancePlatforms/{id}/accountHolders" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PlatformApi.GetBalancePlatform type PlatformApiGetBalancePlatformInput struct { id string } + /* Prepare a request for GetBalancePlatform @param id The unique identifier of the balance platform. @@ -161,67 +161,68 @@ Returns a balance platform. @return BalancePlatform, *http.Response, error */ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBalancePlatformInput) (BalancePlatform, *http.Response, error) { - res := &BalancePlatform{} + res := &BalancePlatform{} path := "/balancePlatforms/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_transaction_rules.go b/src/balanceplatform/api_transaction_rules.go index 27c676d54..5930972db 100644 --- a/src/balanceplatform/api_transaction_rules.go +++ b/src/balanceplatform/api_transaction_rules.go @@ -10,13 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TransactionRulesApi service @@ -32,13 +29,15 @@ func (r TransactionRulesApiCreateTransactionRuleInput) TransactionRuleInfo(trans return r } + /* Prepare a request for CreateTransactionRule @return TransactionRulesApiCreateTransactionRuleInput */ func (a *TransactionRulesApi) CreateTransactionRuleInput() TransactionRulesApiCreateTransactionRuleInput { - return TransactionRulesApiCreateTransactionRuleInput{} + return TransactionRulesApiCreateTransactionRuleInput{ + } } /* @@ -51,75 +50,77 @@ Creates a [transaction rule](https://docs.adyen.com/issuing/transaction-rules). @return TransactionRule, *http.Response, error */ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r TransactionRulesApiCreateTransactionRuleInput) (TransactionRule, *http.Response, error) { - res := &TransactionRule{} + res := &TransactionRule{} path := "/transactionRules" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transactionRuleInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transactionRuleInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TransactionRulesApi.DeleteTransactionRule type TransactionRulesApiDeleteTransactionRuleInput struct { transactionRuleId string } + /* Prepare a request for DeleteTransactionRule @param transactionRuleId The unique identifier of the transaction rule. @@ -141,76 +142,78 @@ Deletes a transaction rule. @return TransactionRule, *http.Response, error */ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r TransactionRulesApiDeleteTransactionRuleInput) (TransactionRule, *http.Response, error) { - res := &TransactionRule{} + res := &TransactionRule{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TransactionRulesApi.GetTransactionRule type TransactionRulesApiGetTransactionRuleInput struct { transactionRuleId string } + /* Prepare a request for GetTransactionRule @param transactionRuleId The unique identifier of the transaction rule. @@ -232,74 +235,75 @@ Returns the details of a transaction rule. @return TransactionRuleResponse, *http.Response, error */ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r TransactionRulesApiGetTransactionRuleInput) (TransactionRuleResponse, *http.Response, error) { - res := &TransactionRuleResponse{} + res := &TransactionRuleResponse{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TransactionRulesApi.UpdateTransactionRule type TransactionRulesApiUpdateTransactionRuleInput struct { - transactionRuleId string + transactionRuleId string transactionRuleInfo *TransactionRuleInfo } @@ -308,6 +312,7 @@ func (r TransactionRulesApiUpdateTransactionRuleInput) TransactionRuleInfo(trans return r } + /* Prepare a request for UpdateTransactionRule @param transactionRuleId The unique identifier of the transaction rule. @@ -322,7 +327,7 @@ func (a *TransactionRulesApi) UpdateTransactionRuleInput(transactionRuleId strin /* UpdateTransactionRule Update a transaction rule -Updates a transaction rule. +Updates a transaction rule. * To update only the status of a transaction rule, send only the `status` parameter. All other parameters not provided in the request are left unchanged. @@ -333,67 +338,68 @@ Updates a transaction rule. @return TransactionRule, *http.Response, error */ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r TransactionRulesApiUpdateTransactionRuleInput) (TransactionRule, *http.Response, error) { - res := &TransactionRule{} + res := &TransactionRule{} path := "/transactionRules/{transactionRuleId}" - path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transactionRuleInfo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"transactionRuleId"+"}", url.PathEscape(common.ParameterValueToString(r.transactionRuleId, "transactionRuleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transactionRuleInfo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/api_transfer_routes.go b/src/balanceplatform/api_transfer_routes.go index 505f739c5..fd488b515 100644 --- a/src/balanceplatform/api_transfer_routes.go +++ b/src/balanceplatform/api_transfer_routes.go @@ -10,12 +10,10 @@ package balanceplatform import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TransferRoutesApi service @@ -31,13 +29,15 @@ func (r TransferRoutesApiCalculateTransferRoutesInput) TransferRouteRequest(tran return r } + /* Prepare a request for CalculateTransferRoutes @return TransferRoutesApiCalculateTransferRoutesInput */ func (a *TransferRoutesApi) CalculateTransferRoutesInput() TransferRoutesApiCalculateTransferRoutesInput { - return TransferRoutesApiCalculateTransferRoutesInput{} + return TransferRoutesApiCalculateTransferRoutesInput{ + } } /* @@ -50,58 +50,59 @@ Returns available transfer routes based on a combination of transfer `country`, @return TransferRouteResponse, *http.Response, error */ func (a *TransferRoutesApi) CalculateTransferRoutes(ctx context.Context, r TransferRoutesApiCalculateTransferRoutesInput) (TransferRouteResponse, *http.Response, error) { - res := &TransferRouteResponse{} + res := &TransferRouteResponse{} path := "/transferRoutes/calculate" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transferRouteRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferRouteRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/balanceplatform/model_account_holder.go b/src/balanceplatform/model_account_holder.go index 44a200ffe..9b4a0e863 100644 --- a/src/balanceplatform/model_account_holder.go +++ b/src/balanceplatform/model_account_holder.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountHolder type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type AccountHolder struct { // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. BalancePlatform *string `json:"balancePlatform,omitempty"` // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. - Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // Your description for the account holder, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the account holder. @@ -466,7 +465,7 @@ func (o *AccountHolder) SetVerificationDeadlines(v []VerificationDeadline) { } func (o AccountHolder) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -549,12 +548,14 @@ func (v *NullableAccountHolder) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountHolder) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_account_holder_capability.go b/src/balanceplatform/model_account_holder_capability.go index 0c8836cd7..7f42d690b 100644 --- a/src/balanceplatform/model_account_holder_capability.go +++ b/src/balanceplatform/model_account_holder_capability.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountHolderCapability type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type AccountHolderCapability struct { // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. Allowed *bool `json:"allowed,omitempty"` // The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. - AllowedLevel *string `json:"allowedLevel,omitempty"` + AllowedLevel *string `json:"allowedLevel,omitempty"` AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` // Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. Enabled *bool `json:"enabled,omitempty"` @@ -31,11 +30,11 @@ type AccountHolderCapability struct { // Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. - RequestedLevel *string `json:"requestedLevel,omitempty"` + RequestedLevel *string `json:"requestedLevel,omitempty"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` - // Contains the status of the transfer instruments associated with this capability. + // Contains the status of the transfer instruments associated with this capability. TransferInstruments []AccountSupportingEntityCapability `json:"transferInstruments,omitempty"` - // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -377,7 +376,7 @@ func (o *AccountHolderCapability) SetVerificationStatus(v string) { } func (o AccountHolderCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -455,30 +454,32 @@ func (v *NullableAccountHolderCapability) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountHolderCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *AccountHolderCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } func (o *AccountHolderCapability) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_account_holder_info.go b/src/balanceplatform/model_account_holder_info.go index 3d942041a..ec11d2655 100644 --- a/src/balanceplatform/model_account_holder_info.go +++ b/src/balanceplatform/model_account_holder_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountHolderInfo type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type AccountHolderInfo struct { // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. BalancePlatform *string `json:"balancePlatform,omitempty"` // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. - Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // Your description for the account holder, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. @@ -337,7 +336,7 @@ func (o *AccountHolderInfo) SetTimeZone(v string) { } func (o AccountHolderInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,3 +408,6 @@ func (v *NullableAccountHolderInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_account_holder_update_request.go b/src/balanceplatform/model_account_holder_update_request.go index 8d7f3b5d3..7fb70f6c0 100644 --- a/src/balanceplatform/model_account_holder_update_request.go +++ b/src/balanceplatform/model_account_holder_update_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountHolderUpdateRequest type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type AccountHolderUpdateRequest struct { // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. BalancePlatform *string `json:"balancePlatform,omitempty"` // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. - Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // Your description for the account holder, maximum 300 characters. Description *string `json:"description,omitempty"` // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. @@ -412,7 +411,7 @@ func (o *AccountHolderUpdateRequest) SetVerificationDeadlines(v []VerificationDe } func (o AccountHolderUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,12 +492,14 @@ func (v *NullableAccountHolderUpdateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountHolderUpdateRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_account_supporting_entity_capability.go b/src/balanceplatform/model_account_supporting_entity_capability.go index 873c57024..34ac04605 100644 --- a/src/balanceplatform/model_account_supporting_entity_capability.go +++ b/src/balanceplatform/model_account_supporting_entity_capability.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountSupportingEntityCapability type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type AccountSupportingEntityCapability struct { Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel *string `json:"requestedLevel,omitempty"` - // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -277,7 +276,7 @@ func (o *AccountSupportingEntityCapability) SetVerificationStatus(v string) { } func (o AccountSupportingEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -346,30 +345,32 @@ func (v *NullableAccountSupportingEntityCapability) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *AccountSupportingEntityCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *AccountSupportingEntityCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } func (o *AccountSupportingEntityCapability) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_active_network_tokens_restriction.go b/src/balanceplatform/model_active_network_tokens_restriction.go index a50e96203..e3ef8f02d 100644 --- a/src/balanceplatform/model_active_network_tokens_restriction.go +++ b/src/balanceplatform/model_active_network_tokens_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ActiveNetworkTokensRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *ActiveNetworkTokensRestriction) SetValue(v int32) { } func (o ActiveNetworkTokensRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableActiveNetworkTokensRestriction) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_additional_bank_identification.go b/src/balanceplatform/model_additional_bank_identification.go index 3a8646460..b08612ef8 100644 --- a/src/balanceplatform/model_additional_bank_identification.go +++ b/src/balanceplatform/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_address.go b/src/balanceplatform/model_address.go index b42b67ddf..bf1aa0de1 100644 --- a/src/balanceplatform/model_address.go +++ b/src/balanceplatform/model_address.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_address_requirement.go b/src/balanceplatform/model_address_requirement.go index 4d0d511cb..d763c8d7a 100644 --- a/src/balanceplatform/model_address_requirement.go +++ b/src/balanceplatform/model_address_requirement.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AddressRequirement type satisfies the MappedNullable interface at compile time @@ -136,7 +135,7 @@ func (o *AddressRequirement) SetType(v string) { } func (o AddressRequirement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -191,12 +190,14 @@ func (v *NullableAddressRequirement) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AddressRequirement) isValidType() bool { - var allowedEnumValues = []string{"addressRequirement"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addressRequirement" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_amount.go b/src/balanceplatform/model_amount.go index bcaee9978..eb01ae9f1 100644 --- a/src/balanceplatform/model_amount.go +++ b/src/balanceplatform/model_amount.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_amount_min_max_requirement.go b/src/balanceplatform/model_amount_min_max_requirement.go index 23ec876cf..dd2021d44 100644 --- a/src/balanceplatform/model_amount_min_max_requirement.go +++ b/src/balanceplatform/model_amount_min_max_requirement.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AmountMinMaxRequirement type satisfies the MappedNullable interface at compile time @@ -170,7 +169,7 @@ func (o *AmountMinMaxRequirement) SetType(v string) { } func (o AmountMinMaxRequirement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -228,12 +227,14 @@ func (v *NullableAmountMinMaxRequirement) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AmountMinMaxRequirement) isValidType() bool { - var allowedEnumValues = []string{"amountMinMaxRequirement"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountMinMaxRequirement" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_au_local_account_identification.go b/src/balanceplatform/model_au_local_account_identification.go index 06c099f16..41733ec87 100644 --- a/src/balanceplatform/model_au_local_account_identification.go +++ b/src/balanceplatform/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_authentication.go b/src/balanceplatform/model_authentication.go index 436d7b863..a3a3fa98f 100644 --- a/src/balanceplatform/model_authentication.go +++ b/src/balanceplatform/model_authentication.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Authentication type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type Authentication struct { Email *string `json:"email,omitempty"` // The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** Password *string `json:"password,omitempty"` - Phone *Phone `json:"phone,omitempty"` + Phone *Phone `json:"phone,omitempty"` } // NewAuthentication instantiates a new Authentication object @@ -140,7 +139,7 @@ func (o *Authentication) SetPhone(v Phone) { } func (o Authentication) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableAuthentication) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance.go b/src/balanceplatform/model_balance.go index 589aa765c..a5aa1bc64 100644 --- a/src/balanceplatform/model_balance.go +++ b/src/balanceplatform/model_balance.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Balance type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *Balance) SetReserved(v int64) { } func (o Balance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableBalance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_account.go b/src/balanceplatform/model_balance_account.go index 3c6453366..1daf7c8bd 100644 --- a/src/balanceplatform/model_balance_account.go +++ b/src/balanceplatform/model_balance_account.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceAccount type satisfies the MappedNullable interface at compile time @@ -32,11 +31,11 @@ type BalanceAccount struct { // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. Metadata *map[string]string `json:"metadata,omitempty"` // The unique identifier of the account of the migrated account holder in the classic integration. - MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` + MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the balance account, set to **active** by default. + // The status of the balance account, set to **active** by default. Status *string `json:"status,omitempty"` // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). TimeZone *string `json:"timeZone,omitempty"` @@ -398,7 +397,7 @@ func (o *BalanceAccount) SetTimeZone(v string) { } func (o BalanceAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -475,12 +474,14 @@ func (v *NullableBalanceAccount) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccount) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_account_base.go b/src/balanceplatform/model_balance_account_base.go index 441ce0b3f..e45893d95 100644 --- a/src/balanceplatform/model_balance_account_base.go +++ b/src/balanceplatform/model_balance_account_base.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceAccountBase type satisfies the MappedNullable interface at compile time @@ -30,11 +29,11 @@ type BalanceAccountBase struct { // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. Metadata *map[string]string `json:"metadata,omitempty"` // The unique identifier of the account of the migrated account holder in the classic integration. - MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` + MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the balance account, set to **active** by default. + // The status of the balance account, set to **active** by default. Status *string `json:"status,omitempty"` // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). TimeZone *string `json:"timeZone,omitempty"` @@ -364,7 +363,7 @@ func (o *BalanceAccountBase) SetTimeZone(v string) { } func (o BalanceAccountBase) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -438,12 +437,14 @@ func (v *NullableBalanceAccountBase) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccountBase) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_account_info.go b/src/balanceplatform/model_balance_account_info.go index e68ba81cb..48e2aac8f 100644 --- a/src/balanceplatform/model_balance_account_info.go +++ b/src/balanceplatform/model_balance_account_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceAccountInfo type satisfies the MappedNullable interface at compile time @@ -28,7 +27,7 @@ type BalanceAccountInfo struct { // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. Metadata *map[string]string `json:"metadata,omitempty"` // The unique identifier of the account of the migrated account holder in the classic integration. - MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` + MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"` // Your reference for the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` @@ -303,7 +302,7 @@ func (o *BalanceAccountInfo) SetTimeZone(v string) { } func (o BalanceAccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -372,3 +371,6 @@ func (v *NullableBalanceAccountInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_account_update_request.go b/src/balanceplatform/model_balance_account_update_request.go index 136322d03..1b8b34c4a 100644 --- a/src/balanceplatform/model_balance_account_update_request.go +++ b/src/balanceplatform/model_balance_account_update_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceAccountUpdateRequest type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type BalanceAccountUpdateRequest struct { // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. Description *string `json:"description,omitempty"` // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. - Metadata *map[string]string `json:"metadata,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"` // Your reference to the balance account, maximum 150 characters. Reference *string `json:"reference,omitempty"` @@ -276,7 +275,7 @@ func (o *BalanceAccountUpdateRequest) SetTimeZone(v string) { } func (o BalanceAccountUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,12 +344,14 @@ func (v *NullableBalanceAccountUpdateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceAccountUpdateRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_balance_platform.go b/src/balanceplatform/model_balance_platform.go index 4b54d580e..4d24c6914 100644 --- a/src/balanceplatform/model_balance_platform.go +++ b/src/balanceplatform/model_balance_platform.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalancePlatform type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *BalancePlatform) SetStatus(v string) { } func (o BalancePlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableBalancePlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_balance_sweep_configurations_response.go b/src/balanceplatform/model_balance_sweep_configurations_response.go index 3de17a527..98627ef16 100644 --- a/src/balanceplatform/model_balance_sweep_configurations_response.go +++ b/src/balanceplatform/model_balance_sweep_configurations_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceSweepConfigurationsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *BalanceSweepConfigurationsResponse) SetSweeps(v []SweepConfigurationV2) } func (o BalanceSweepConfigurationsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableBalanceSweepConfigurationsResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bank_account.go b/src/balanceplatform/model_bank_account.go index 41a3e744c..6d6adb05c 100644 --- a/src/balanceplatform/model_bank_account.go +++ b/src/balanceplatform/model_bank_account.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *BankAccount) SetAccountIdentification(v BankAccountAccountIdentificatio } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bank_account_account_identification.go b/src/balanceplatform/model_bank_account_account_identification.go index 3537d8b5a..8a84788b9 100644 --- a/src/balanceplatform/model_bank_account_account_identification.go +++ b/src/balanceplatform/model_bank_account_account_identification.go @@ -10,27 +10,28 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // BankAccountAccountIdentification - Contains the bank account details. The fields required in this object depend on the country of the bank account and the currency of the transfer. type BankAccountAccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - BRLocalAccountIdentification *BRLocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HKLocalAccountIdentification *HKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification - NZLocalAccountIdentification *NZLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountAccountIdentification @@ -145,6 +146,7 @@ func USLocalAccountIdentificationAsBankAccountAccountIdentification(v *USLocalAc } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -155,7 +157,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct dst.BRLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -181,7 +183,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -194,7 +196,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -207,7 +209,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -220,7 +222,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct dst.HKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -233,7 +235,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -246,7 +248,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -259,7 +261,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -272,7 +274,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct dst.NZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -285,7 +287,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -298,7 +300,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -311,7 +313,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -324,7 +326,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -337,7 +339,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -350,7 +352,7 @@ func (dst *BankAccountAccountIdentification) UnmarshalJSON(data []byte) error { jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -454,7 +456,7 @@ func (src BankAccountAccountIdentification) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *BankAccountAccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountAccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -561,3 +563,5 @@ func (v *NullableBankAccountAccountIdentification) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_bank_account_identification_type_requirement.go b/src/balanceplatform/model_bank_account_identification_type_requirement.go index 77e73bbf7..07ad2eb0c 100644 --- a/src/balanceplatform/model_bank_account_identification_type_requirement.go +++ b/src/balanceplatform/model_bank_account_identification_type_requirement.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccountIdentificationTypeRequirement type satisfies the MappedNullable interface at compile time @@ -136,7 +135,7 @@ func (o *BankAccountIdentificationTypeRequirement) SetType(v string) { } func (o BankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -191,12 +190,14 @@ func (v *NullableBankAccountIdentificationTypeRequirement) UnmarshalJSON(src []b return json.Unmarshal(src, &v.value) } + func (o *BankAccountIdentificationTypeRequirement) isValidType() bool { - var allowedEnumValues = []string{"bankAccountIdentificationTypeRequirement"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccountIdentificationTypeRequirement" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_bank_account_identification_validation_request.go b/src/balanceplatform/model_bank_account_identification_validation_request.go index b7eb30ae2..e69f72e29 100644 --- a/src/balanceplatform/model_bank_account_identification_validation_request.go +++ b/src/balanceplatform/model_bank_account_identification_validation_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccountIdentificationValidationRequest type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *BankAccountIdentificationValidationRequest) SetAccountIdentification(v } func (o BankAccountIdentificationValidationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableBankAccountIdentificationValidationRequest) UnmarshalJSON(src [ v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go b/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go index a5308a3b9..238cdbc8d 100644 --- a/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go +++ b/src/balanceplatform/model_bank_account_identification_validation_request_account_identification.go @@ -10,27 +10,28 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // BankAccountIdentificationValidationRequestAccountIdentification - Bank account identification. type BankAccountIdentificationValidationRequestAccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - BRLocalAccountIdentification *BRLocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HKLocalAccountIdentification *HKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification - NZLocalAccountIdentification *NZLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountIdentificationValidationRequestAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountIdentificationValidationRequestAccountIdentification @@ -145,6 +146,7 @@ func USLocalAccountIdentificationAsBankAccountIdentificationValidationRequestAcc } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountIdentificationValidationRequestAccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -155,7 +157,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct dst.BRLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -181,7 +183,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -194,7 +196,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -207,7 +209,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -220,7 +222,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct dst.HKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -233,7 +235,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -246,7 +248,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -259,7 +261,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -272,7 +274,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct dst.NZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -285,7 +287,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -298,7 +300,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -311,7 +313,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -324,7 +326,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -337,7 +339,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -350,7 +352,7 @@ func (dst *BankAccountIdentificationValidationRequestAccountIdentification) Unma jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -454,7 +456,7 @@ func (src BankAccountIdentificationValidationRequestAccountIdentification) Marsh } // Get the actual instance -func (obj *BankAccountIdentificationValidationRequestAccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountIdentificationValidationRequestAccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -561,3 +563,5 @@ func (v *NullableBankAccountIdentificationValidationRequestAccountIdentification v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_bank_identification.go b/src/balanceplatform/model_bank_identification.go index b32216178..4f3e22635 100644 --- a/src/balanceplatform/model_bank_identification.go +++ b/src/balanceplatform/model_bank_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankIdentification type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &BankIdentification{} // BankIdentification struct for BankIdentification type BankIdentification struct { - Country *string `json:"country,omitempty"` - Identification *string `json:"identification,omitempty"` + Country *string `json:"country,omitempty"` + Identification *string `json:"identification,omitempty"` IdentificationType *string `json:"identificationType,omitempty"` } @@ -138,7 +137,7 @@ func (o *BankIdentification) SetIdentificationType(v string) { } func (o BankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,12 +194,14 @@ func (v *NullableBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BankIdentification) isValidIdentificationType() bool { - var allowedEnumValues = []string{"iban", "routingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetIdentificationType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban", "routingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetIdentificationType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_br_local_account_identification.go b/src/balanceplatform/model_br_local_account_identification.go index 746e1058d..45b9bbc30 100644 --- a/src/balanceplatform/model_br_local_account_identification.go +++ b/src/balanceplatform/model_br_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BRLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -149,7 +148,7 @@ func (o *BRLocalAccountIdentification) SetType(v string) { } func (o BRLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -201,12 +200,14 @@ func (v *NullableBRLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BRLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"brLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "brLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_brand_variants_restriction.go b/src/balanceplatform/model_brand_variants_restriction.go index 3207b9fce..f9bfec9e8 100644 --- a/src/balanceplatform/model_brand_variants_restriction.go +++ b/src/balanceplatform/model_brand_variants_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BrandVariantsRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &BrandVariantsRestriction{} type BrandVariantsRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. + // List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *BrandVariantsRestriction) SetValue(v []string) { } func (o BrandVariantsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableBrandVariantsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_bulk_address.go b/src/balanceplatform/model_bulk_address.go index 5186916a0..35d75b6c6 100644 --- a/src/balanceplatform/model_bulk_address.go +++ b/src/balanceplatform/model_bulk_address.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BulkAddress type satisfies the MappedNullable interface at compile time @@ -338,7 +337,7 @@ func (o *BulkAddress) SetStreet(v string) { } func (o BulkAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -410,3 +409,6 @@ func (v *NullableBulkAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_ca_local_account_identification.go b/src/balanceplatform/model_ca_local_account_identification.go index 7129c8187..b1242493c 100644 --- a/src/balanceplatform/model_ca_local_account_identification.go +++ b/src/balanceplatform/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_capability_problem.go b/src/balanceplatform/model_capability_problem.go index e1db2b275..5a3e068ed 100644 --- a/src/balanceplatform/model_capability_problem.go +++ b/src/balanceplatform/model_capability_problem.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblem type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *CapabilityProblem) SetVerificationErrors(v []VerificationError) { } func (o CapabilityProblem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableCapabilityProblem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_capability_problem_entity.go b/src/balanceplatform/model_capability_problem_entity.go index 1ea0d5e69..197d73dc4 100644 --- a/src/balanceplatform/model_capability_problem_entity.go +++ b/src/balanceplatform/model_capability_problem_entity.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntity type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type CapabilityProblemEntity struct { // List of document IDs to which the verification errors related to the capabilities correspond to. Documents []string `json:"documents,omitempty"` // The ID of the entity. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` // Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. Type *string `json:"type,omitempty"` @@ -174,7 +173,7 @@ func (o *CapabilityProblemEntity) SetType(v string) { } func (o CapabilityProblemEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,12 +233,14 @@ func (v *NullableCapabilityProblemEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntity) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_capability_problem_entity_recursive.go b/src/balanceplatform/model_capability_problem_entity_recursive.go index 87ddbcd5d..456756383 100644 --- a/src/balanceplatform/model_capability_problem_entity_recursive.go +++ b/src/balanceplatform/model_capability_problem_entity_recursive.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntityRecursive type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CapabilityProblemEntityRecursive) SetType(v string) { } func (o CapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableCapabilityProblemEntityRecursive) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntityRecursive) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_capability_settings.go b/src/balanceplatform/model_capability_settings.go index bb1bb59db..7448069f7 100644 --- a/src/balanceplatform/model_capability_settings.go +++ b/src/balanceplatform/model_capability_settings.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilitySettings type satisfies the MappedNullable interface at compile time @@ -19,14 +18,14 @@ var _ common.MappedNullable = &CapabilitySettings{} // CapabilitySettings struct for CapabilitySettings type CapabilitySettings struct { - // + // AmountPerIndustry *map[string]Amount `json:"amountPerIndustry,omitempty"` - // + // AuthorizedCardUsers *bool `json:"authorizedCardUsers,omitempty"` - // + // FundingSource []string `json:"fundingSource,omitempty"` - // - Interval *string `json:"interval,omitempty"` + // + Interval *string `json:"interval,omitempty"` MaxAmount *Amount `json:"maxAmount,omitempty"` } @@ -208,7 +207,7 @@ func (o *CapabilitySettings) SetMaxAmount(v Amount) { } func (o CapabilitySettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableCapabilitySettings) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilitySettings) isValidInterval() bool { - var allowedEnumValues = []string{"daily", "monthly", "weekly"} - for _, allowed := range allowedEnumValues { - if o.GetInterval() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "monthly", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetInterval() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_capital_balance.go b/src/balanceplatform/model_capital_balance.go index faf913d85..f4b9d47e0 100644 --- a/src/balanceplatform/model_capital_balance.go +++ b/src/balanceplatform/model_capital_balance.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalBalance type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *CapitalBalance) SetTotal(v int64) { } func (o CapitalBalance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableCapitalBalance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_capital_grant_account.go b/src/balanceplatform/model_capital_grant_account.go index dedae3f82..77b64531a 100644 --- a/src/balanceplatform/model_capital_grant_account.go +++ b/src/balanceplatform/model_capital_grant_account.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalGrantAccount type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *CapitalGrantAccount) SetLimits(v []GrantLimit) { } func (o CapitalGrantAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableCapitalGrantAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_card.go b/src/balanceplatform/model_card.go index 9777de816..8581bd2ee 100644 --- a/src/balanceplatform/model_card.go +++ b/src/balanceplatform/model_card.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -27,12 +26,12 @@ type Card struct { // The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. BrandVariant string `json:"brandVariant"` // The name of the cardholder. Maximum length: 26 characters. - CardholderName string `json:"cardholderName"` - Configuration *CardConfiguration `json:"configuration,omitempty"` + CardholderName string `json:"cardholderName"` + Configuration *CardConfiguration `json:"configuration,omitempty"` // The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. - Cvc *string `json:"cvc,omitempty"` + Cvc *string `json:"cvc,omitempty"` DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` - Expiration *Expiry `json:"expiration,omitempty"` + Expiration *Expiry `json:"expiration,omitempty"` // The form factor of the card. Possible values: **virtual**, **physical**. FormFactor string `json:"formFactor"` // Last last four digits of the card number. @@ -442,7 +441,7 @@ func (o *Card) SetThreeDSecure(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -519,12 +518,14 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Card) isValidFormFactor() bool { - var allowedEnumValues = []string{"physical", "unknown", "virtual"} - for _, allowed := range allowedEnumValues { - if o.GetFormFactor() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "physical", "unknown", "virtual" } + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_card_configuration.go b/src/balanceplatform/model_card_configuration.go index 63aec6a73..a4223bc04 100644 --- a/src/balanceplatform/model_card_configuration.go +++ b/src/balanceplatform/model_card_configuration.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardConfiguration type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type CardConfiguration struct { // Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. Activation *string `json:"activation,omitempty"` // Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. - ActivationUrl *string `json:"activationUrl,omitempty"` - BulkAddress *BulkAddress `json:"bulkAddress,omitempty"` + ActivationUrl *string `json:"activationUrl,omitempty"` + BulkAddress *BulkAddress `json:"bulkAddress,omitempty"` // The ID of the card image. This is the image that will be printed on the full front of the card. CardImageId *string `json:"cardImageId,omitempty"` // Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. @@ -34,7 +33,7 @@ type CardConfiguration struct { ConfigurationProfileId string `json:"configurationProfileId"` // The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. Currency *string `json:"currency,omitempty"` - // Overrides the envelope design ID defined in the `configurationProfileId`. + // Overrides the envelope design ID defined in the `configurationProfileId`. Envelope *string `json:"envelope,omitempty"` // Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. Insert *string `json:"insert,omitempty"` @@ -507,7 +506,7 @@ func (o *CardConfiguration) SetShipmentMethod(v string) { } func (o CardConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -594,3 +593,6 @@ func (v *NullableCardConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_card_info.go b/src/balanceplatform/model_card_info.go index 865958012..197e97bc1 100644 --- a/src/balanceplatform/model_card_info.go +++ b/src/balanceplatform/model_card_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardInfo type satisfies the MappedNullable interface at compile time @@ -25,9 +24,9 @@ type CardInfo struct { // The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. BrandVariant string `json:"brandVariant"` // The name of the cardholder. Maximum length: 26 characters. - CardholderName string `json:"cardholderName"` - Configuration *CardConfiguration `json:"configuration,omitempty"` - DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` + CardholderName string `json:"cardholderName"` + Configuration *CardConfiguration `json:"configuration,omitempty"` + DeliveryContact *DeliveryContact `json:"deliveryContact,omitempty"` // The form factor of the card. Possible values: **virtual**, **physical**. FormFactor string `json:"formFactor"` // Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. @@ -280,7 +279,7 @@ func (o *CardInfo) SetThreeDSecure(v string) { } func (o CardInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,12 +343,14 @@ func (v *NullableCardInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CardInfo) isValidFormFactor() bool { - var allowedEnumValues = []string{"physical", "unknown", "virtual"} - for _, allowed := range allowedEnumValues { - if o.GetFormFactor() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "physical", "unknown", "virtual" } + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_contact_details.go b/src/balanceplatform/model_contact_details.go index 7066d4ccb..86b83d317 100644 --- a/src/balanceplatform/model_contact_details.go +++ b/src/balanceplatform/model_contact_details.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ContactDetails type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type ContactDetails struct { Address Address `json:"address"` // The email address of the account holder. Email string `json:"email"` - Phone Phone `json:"phone"` + Phone Phone `json:"phone"` // The URL of the account holder's website. WebAddress *string `json:"webAddress,omitempty"` } @@ -152,7 +151,7 @@ func (o *ContactDetails) SetWebAddress(v string) { } func (o ContactDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -205,3 +204,6 @@ func (v *NullableContactDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_counterparty.go b/src/balanceplatform/model_counterparty.go index d1d386cf6..4f1a53b4e 100644 --- a/src/balanceplatform/model_counterparty.go +++ b/src/balanceplatform/model_counterparty.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Counterparty type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *Counterparty) SetTransferInstrumentId(v string) { } func (o Counterparty) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableCounterparty) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_counterparty_bank_restriction.go b/src/balanceplatform/model_counterparty_bank_restriction.go index 8a65eafa2..6d64a0837 100644 --- a/src/balanceplatform/model_counterparty_bank_restriction.go +++ b/src/balanceplatform/model_counterparty_bank_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CounterpartyBankRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *CounterpartyBankRestriction) SetValue(v []BankIdentification) { } func (o CounterpartyBankRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableCounterpartyBankRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_countries_restriction.go b/src/balanceplatform/model_countries_restriction.go index 5180e67e0..8618b739f 100644 --- a/src/balanceplatform/model_countries_restriction.go +++ b/src/balanceplatform/model_countries_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CountriesRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *CountriesRestriction) SetValue(v []string) { } func (o CountriesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableCountriesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_create_sweep_configuration_v2.go b/src/balanceplatform/model_create_sweep_configuration_v2.go index 57fbc2a00..61ca1e5e9 100644 --- a/src/balanceplatform/model_create_sweep_configuration_v2.go +++ b/src/balanceplatform/model_create_sweep_configuration_v2.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateSweepConfigurationV2 type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &CreateSweepConfigurationV2{} // CreateSweepConfigurationV2 struct for CreateSweepConfigurationV2 type CreateSweepConfigurationV2 struct { // The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. - Category *string `json:"category,omitempty"` + Category *string `json:"category,omitempty"` Counterparty SweepCounterparty `json:"counterparty"` // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). Currency string `json:"currency"` @@ -29,12 +28,12 @@ type CreateSweepConfigurationV2 struct { // The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). Priorities []string `json:"priorities,omitempty"` // The reason for disabling the sweep. - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` Schedule SweepSchedule `json:"schedule"` - // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. - Status *string `json:"status,omitempty"` - SweepAmount *Amount `json:"sweepAmount,omitempty"` - TargetAmount *Amount `json:"targetAmount,omitempty"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` TriggerAmount *Amount `json:"triggerAmount,omitempty"` // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. Type *string `json:"type,omitempty"` @@ -425,7 +424,7 @@ func (o *CreateSweepConfigurationV2) SetType(v string) { } func (o CreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -503,39 +502,41 @@ func (v *NullableCreateSweepConfigurationV2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateSweepConfigurationV2) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *CreateSweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *CreateSweepConfigurationV2) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *CreateSweepConfigurationV2) isValidType() bool { - var allowedEnumValues = []string{"pull", "push"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "pull", "push" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_cz_local_account_identification.go b/src/balanceplatform/model_cz_local_account_identification.go index 80b3eac44..cb271d1c0 100644 --- a/src/balanceplatform/model_cz_local_account_identification.go +++ b/src/balanceplatform/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_day_of_week_restriction.go b/src/balanceplatform/model_day_of_week_restriction.go index b92138385..308324d3b 100644 --- a/src/balanceplatform/model_day_of_week_restriction.go +++ b/src/balanceplatform/model_day_of_week_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DayOfWeekRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &DayOfWeekRestriction{} type DayOfWeekRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. + // List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *DayOfWeekRestriction) SetValue(v []string) { } func (o DayOfWeekRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableDayOfWeekRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_delivery_address.go b/src/balanceplatform/model_delivery_address.go index 559831ea8..ce96569bd 100644 --- a/src/balanceplatform/model_delivery_address.go +++ b/src/balanceplatform/model_delivery_address.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeliveryAddress type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *DeliveryAddress) SetStateOrProvince(v string) { } func (o DeliveryAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -336,3 +335,6 @@ func (v *NullableDeliveryAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_delivery_contact.go b/src/balanceplatform/model_delivery_contact.go index e2d7248d7..712ac64fb 100644 --- a/src/balanceplatform/model_delivery_contact.go +++ b/src/balanceplatform/model_delivery_contact.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeliveryContact type satisfies the MappedNullable interface at compile time @@ -23,9 +22,9 @@ type DeliveryContact struct { // The email address of the contact. Email *string `json:"email,omitempty"` // The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" - FullPhoneNumber *string `json:"fullPhoneNumber,omitempty"` - Name Name `json:"name"` - PhoneNumber *PhoneNumber `json:"phoneNumber,omitempty"` + FullPhoneNumber *string `json:"fullPhoneNumber,omitempty"` + Name Name `json:"name"` + PhoneNumber *PhoneNumber `json:"phoneNumber,omitempty"` // The URL of the contact's website. WebAddress *string `json:"webAddress,omitempty"` } @@ -226,7 +225,7 @@ func (o *DeliveryContact) SetWebAddress(v string) { } func (o DeliveryContact) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -287,3 +286,6 @@ func (v *NullableDeliveryContact) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_device_info.go b/src/balanceplatform/model_device_info.go index 54fb2430f..3e6eafbf1 100644 --- a/src/balanceplatform/model_device_info.go +++ b/src/balanceplatform/model_device_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeviceInfo type satisfies the MappedNullable interface at compile time @@ -413,7 +412,7 @@ func (o *DeviceInfo) SetStorageTechnology(v string) { } func (o DeviceInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,3 +492,6 @@ func (v *NullableDeviceInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_different_currencies_restriction.go b/src/balanceplatform/model_different_currencies_restriction.go index 00f0a851b..c028ef952 100644 --- a/src/balanceplatform/model_different_currencies_restriction.go +++ b/src/balanceplatform/model_different_currencies_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DifferentCurrenciesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &DifferentCurrenciesRestriction{} type DifferentCurrenciesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. + // Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. Value *bool `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *DifferentCurrenciesRestriction) SetValue(v bool) { } func (o DifferentCurrenciesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableDifferentCurrenciesRestriction) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_dk_local_account_identification.go b/src/balanceplatform/model_dk_local_account_identification.go index 0581a87b5..51b1fee5c 100644 --- a/src/balanceplatform/model_dk_local_account_identification.go +++ b/src/balanceplatform/model_dk_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *DKLocalAccountIdentification) SetType(v string) { } func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"dkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_duration.go b/src/balanceplatform/model_duration.go index d4082a2ba..f14805320 100644 --- a/src/balanceplatform/model_duration.go +++ b/src/balanceplatform/model_duration.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Duration type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Duration) SetValue(v int32) { } func (o Duration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableDuration) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Duration) isValidUnit() bool { - var allowedEnumValues = []string{"days", "hours", "minutes", "months", "weeks"} - for _, allowed := range allowedEnumValues { - if o.GetUnit() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "days", "hours", "minutes", "months", "weeks" } + for _, allowed := range allowedEnumValues { + if o.GetUnit() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_entry_modes_restriction.go b/src/balanceplatform/model_entry_modes_restriction.go index ea8b99d04..ba4e6f135 100644 --- a/src/balanceplatform/model_entry_modes_restriction.go +++ b/src/balanceplatform/model_entry_modes_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the EntryModesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &EntryModesRestriction{} type EntryModesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of point-of-sale entry modes. Possible values: **barcode**, **chip**, **cof**, **contactless**, **magstripe**, **manual**, **ocr**, **server**. + // List of point-of-sale entry modes. Possible values: **barcode**, **chip**, **cof**, **contactless**, **magstripe**, **manual**, **ocr**, **server**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *EntryModesRestriction) SetValue(v []string) { } func (o EntryModesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableEntryModesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_expiry.go b/src/balanceplatform/model_expiry.go index 9f9510c90..8344c01b4 100644 --- a/src/balanceplatform/model_expiry.go +++ b/src/balanceplatform/model_expiry.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Expiry type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Expiry) SetYear(v string) { } func (o Expiry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableExpiry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_fee.go b/src/balanceplatform/model_fee.go index 069cc1fd7..de43f767a 100644 --- a/src/balanceplatform/model_fee.go +++ b/src/balanceplatform/model_fee.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Fee type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *Fee) SetAmount(v Amount) { } func (o Fee) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableFee) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_get_network_token_response.go b/src/balanceplatform/model_get_network_token_response.go index 0986aa04b..04512c48f 100644 --- a/src/balanceplatform/model_get_network_token_response.go +++ b/src/balanceplatform/model_get_network_token_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetNetworkTokenResponse type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *GetNetworkTokenResponse) SetToken(v NetworkToken) { } func (o GetNetworkTokenResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableGetNetworkTokenResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_get_tax_form_response.go b/src/balanceplatform/model_get_tax_form_response.go index 3daa40e9a..67506d7c2 100644 --- a/src/balanceplatform/model_get_tax_form_response.go +++ b/src/balanceplatform/model_get_tax_form_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTaxFormResponse type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &GetTaxFormResponse{} type GetTaxFormResponse struct { // The content of the tax form in Base64 format. Content string `json:"content"` - // The content type of the tax form. Possible values: * **application/pdf** + // The content type of the tax form. Possible values: * **application/pdf** ContentType *string `json:"contentType,omitempty"` } @@ -100,7 +99,7 @@ func (o *GetTaxFormResponse) SetContentType(v string) { } func (o GetTaxFormResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableGetTaxFormResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GetTaxFormResponse) isValidContentType() bool { - var allowedEnumValues = []string{"application/pdf"} - for _, allowed := range allowedEnumValues { - if o.GetContentType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "application/pdf" } + for _, allowed := range allowedEnumValues { + if o.GetContentType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_grant_limit.go b/src/balanceplatform/model_grant_limit.go index 1e7c04423..c8008b9b8 100644 --- a/src/balanceplatform/model_grant_limit.go +++ b/src/balanceplatform/model_grant_limit.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GrantLimit type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *GrantLimit) SetAmount(v Amount) { } func (o GrantLimit) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableGrantLimit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_grant_offer.go b/src/balanceplatform/model_grant_offer.go index 6b6540534..aaf45970f 100644 --- a/src/balanceplatform/model_grant_offer.go +++ b/src/balanceplatform/model_grant_offer.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GrantOffer type satisfies the MappedNullable interface at compile time @@ -20,16 +19,16 @@ var _ common.MappedNullable = &GrantOffer{} // GrantOffer struct for GrantOffer type GrantOffer struct { // The identifier of the account holder to which the grant is offered. - AccountHolderId string `json:"accountHolderId"` - Amount *Amount `json:"amount,omitempty"` + AccountHolderId string `json:"accountHolderId"` + Amount *Amount `json:"amount,omitempty"` // The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. - ContractType *string `json:"contractType,omitempty"` - ExpiresAt map[string]interface{} `json:"expiresAt,omitempty"` - Fee *Fee `json:"fee,omitempty"` + ContractType *string `json:"contractType,omitempty"` + ExpiresAt map[string]interface{} `json:"expiresAt,omitempty"` + Fee *Fee `json:"fee,omitempty"` // The unique identifier of the grant offer. - Id *string `json:"id,omitempty"` - Repayment *Repayment `json:"repayment,omitempty"` - StartsAt map[string]interface{} `json:"startsAt,omitempty"` + Id *string `json:"id,omitempty"` + Repayment *Repayment `json:"repayment,omitempty"` + StartsAt map[string]interface{} `json:"startsAt,omitempty"` } // NewGrantOffer instantiates a new GrantOffer object @@ -299,7 +298,7 @@ func (o *GrantOffer) SetStartsAt(v map[string]interface{}) { } func (o GrantOffer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -369,12 +368,14 @@ func (v *NullableGrantOffer) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GrantOffer) isValidContractType() bool { - var allowedEnumValues = []string{"cashAdvance", "loan"} - for _, allowed := range allowedEnumValues { - if o.GetContractType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "cashAdvance", "loan" } + for _, allowed := range allowedEnumValues { + if o.GetContractType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_grant_offers.go b/src/balanceplatform/model_grant_offers.go index 46416cdf1..93cf282ec 100644 --- a/src/balanceplatform/model_grant_offers.go +++ b/src/balanceplatform/model_grant_offers.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GrantOffers type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GrantOffers) SetGrantOffers(v []GrantOffer) { } func (o GrantOffers) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGrantOffers) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_hk_local_account_identification.go b/src/balanceplatform/model_hk_local_account_identification.go index d59ee7d48..a0c9f51ad 100644 --- a/src/balanceplatform/model_hk_local_account_identification.go +++ b/src/balanceplatform/model_hk_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *HKLocalAccountIdentification) SetType(v string) { } func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableHKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"hkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "hkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_hu_local_account_identification.go b/src/balanceplatform/model_hu_local_account_identification.go index c9142fb1e..f5d2c994c 100644 --- a/src/balanceplatform/model_hu_local_account_identification.go +++ b/src/balanceplatform/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_iban_account_identification.go b/src/balanceplatform/model_iban_account_identification.go index f0acbc716..457d0cd0c 100644 --- a/src/balanceplatform/model_iban_account_identification.go +++ b/src/balanceplatform/model_iban_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_international_transaction_restriction.go b/src/balanceplatform/model_international_transaction_restriction.go index 0f6878014..6d54b3904 100644 --- a/src/balanceplatform/model_international_transaction_restriction.go +++ b/src/balanceplatform/model_international_transaction_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InternationalTransactionRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &InternationalTransactionRestriction{} type InternationalTransactionRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. + // Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. Value *bool `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *InternationalTransactionRestriction) SetValue(v bool) { } func (o InternationalTransactionRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableInternationalTransactionRestriction) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_invalid_field.go b/src/balanceplatform/model_invalid_field.go index 630f1a821..10d7616c8 100644 --- a/src/balanceplatform/model_invalid_field.go +++ b/src/balanceplatform/model_invalid_field.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_list_network_tokens_response.go b/src/balanceplatform/model_list_network_tokens_response.go index 65fa21b4e..f65799c07 100644 --- a/src/balanceplatform/model_list_network_tokens_response.go +++ b/src/balanceplatform/model_list_network_tokens_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListNetworkTokensResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ListNetworkTokensResponse) SetNetworkTokens(v []NetworkToken) { } func (o ListNetworkTokensResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableListNetworkTokensResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_matching_transactions_restriction.go b/src/balanceplatform/model_matching_transactions_restriction.go index ab04653e0..b28707de0 100644 --- a/src/balanceplatform/model_matching_transactions_restriction.go +++ b/src/balanceplatform/model_matching_transactions_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MatchingTransactionsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MatchingTransactionsRestriction) SetValue(v int32) { } func (o MatchingTransactionsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMatchingTransactionsRestriction) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_mccs_restriction.go b/src/balanceplatform/model_mccs_restriction.go index 2e84f9d2b..deef33fe4 100644 --- a/src/balanceplatform/model_mccs_restriction.go +++ b/src/balanceplatform/model_mccs_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MccsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MccsRestriction) SetValue(v []string) { } func (o MccsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMccsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchant_acquirer_pair.go b/src/balanceplatform/model_merchant_acquirer_pair.go index 4e5d82c36..2fd90c22d 100644 --- a/src/balanceplatform/model_merchant_acquirer_pair.go +++ b/src/balanceplatform/model_merchant_acquirer_pair.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantAcquirerPair type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *MerchantAcquirerPair) SetMerchantId(v string) { } func (o MerchantAcquirerPair) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableMerchantAcquirerPair) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchant_names_restriction.go b/src/balanceplatform/model_merchant_names_restriction.go index 59c0f075b..4acbaa868 100644 --- a/src/balanceplatform/model_merchant_names_restriction.go +++ b/src/balanceplatform/model_merchant_names_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantNamesRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &MerchantNamesRestriction{} // MerchantNamesRestriction struct for MerchantNamesRestriction type MerchantNamesRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value []StringMatch `json:"value,omitempty"` + Operation string `json:"operation"` + Value []StringMatch `json:"value,omitempty"` } // NewMerchantNamesRestriction instantiates a new MerchantNamesRestriction object @@ -99,7 +98,7 @@ func (o *MerchantNamesRestriction) SetValue(v []StringMatch) { } func (o MerchantNamesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableMerchantNamesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_merchants_restriction.go b/src/balanceplatform/model_merchants_restriction.go index 66d35c3b0..284319945 100644 --- a/src/balanceplatform/model_merchants_restriction.go +++ b/src/balanceplatform/model_merchants_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantsRestriction type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *MerchantsRestriction) SetValue(v []MerchantAcquirerPair) { } func (o MerchantsRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableMerchantsRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_name.go b/src/balanceplatform/model_name.go index 00770deda..49369ee01 100644 --- a/src/balanceplatform/model_name.go +++ b/src/balanceplatform/model_name.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_network_token.go b/src/balanceplatform/model_network_token.go index 62cc52cfc..cb47e55fa 100644 --- a/src/balanceplatform/model_network_token.go +++ b/src/balanceplatform/model_network_token.go @@ -10,9 +10,8 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NetworkToken type satisfies the MappedNullable interface at compile time @@ -23,8 +22,8 @@ type NetworkToken struct { // The card brand variant of the payment instrument associated with the network token. For example, **mc_prepaid_mrw**. BrandVariant *string `json:"brandVariant,omitempty"` // Date and time when the network token was created, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) extended format. For example, **2020-12-18T10:15:30+01:00**.. - CreationDate *time.Time `json:"creationDate,omitempty"` - Device *DeviceInfo `json:"device,omitempty"` + CreationDate *time.Time `json:"creationDate,omitempty"` + Device *DeviceInfo `json:"device,omitempty"` // The unique identifier of the network token. Id *string `json:"id,omitempty"` // The unique identifier of the payment instrument to which this network token belongs to. @@ -311,7 +310,7 @@ func (o *NetworkToken) SetType(v string) { } func (o NetworkToken) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -383,12 +382,14 @@ func (v *NullableNetworkToken) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NetworkToken) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive", "suspended", "closed"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive", "suspended", "closed" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_no_local_account_identification.go b/src/balanceplatform/model_no_local_account_identification.go index b588f021e..8ce9721f7 100644 --- a/src/balanceplatform/model_no_local_account_identification.go +++ b/src/balanceplatform/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_number_and_bic_account_identification.go b/src/balanceplatform/model_number_and_bic_account_identification.go index 49f79b3d4..de58f83d8 100644 --- a/src/balanceplatform/model_number_and_bic_account_identification.go +++ b/src/balanceplatform/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_nz_local_account_identification.go b/src/balanceplatform/model_nz_local_account_identification.go index 0017e8726..22f332100 100644 --- a/src/balanceplatform/model_nz_local_account_identification.go +++ b/src/balanceplatform/model_nz_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NZLocalAccountIdentification) SetType(v string) { } func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"nzLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nzLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_paginated_account_holders_response.go b/src/balanceplatform/model_paginated_account_holders_response.go index 74f18b328..0f1d39316 100644 --- a/src/balanceplatform/model_paginated_account_holders_response.go +++ b/src/balanceplatform/model_paginated_account_holders_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaginatedAccountHoldersResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedAccountHoldersResponse) SetHasPrevious(v bool) { } func (o PaginatedAccountHoldersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedAccountHoldersResponse) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_paginated_balance_accounts_response.go b/src/balanceplatform/model_paginated_balance_accounts_response.go index ed65ece9a..34123e27c 100644 --- a/src/balanceplatform/model_paginated_balance_accounts_response.go +++ b/src/balanceplatform/model_paginated_balance_accounts_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaginatedBalanceAccountsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedBalanceAccountsResponse) SetHasPrevious(v bool) { } func (o PaginatedBalanceAccountsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedBalanceAccountsResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_paginated_payment_instruments_response.go b/src/balanceplatform/model_paginated_payment_instruments_response.go index 4885a7641..cf419de4f 100644 --- a/src/balanceplatform/model_paginated_payment_instruments_response.go +++ b/src/balanceplatform/model_paginated_payment_instruments_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaginatedPaymentInstrumentsResponse type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *PaginatedPaymentInstrumentsResponse) SetPaymentInstruments(v []PaymentI } func (o PaginatedPaymentInstrumentsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullablePaginatedPaymentInstrumentsResponse) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument.go b/src/balanceplatform/model_payment_instrument.go index 6820a69f7..e714dcb6d 100644 --- a/src/balanceplatform/model_payment_instrument.go +++ b/src/balanceplatform/model_payment_instrument.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &PaymentInstrument{} // PaymentInstrument struct for PaymentInstrument type PaymentInstrument struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` - Card *Card `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` + Card *Card `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the payment instrument. @@ -33,11 +32,11 @@ type PaymentInstrument struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -383,7 +382,7 @@ func (o *PaymentInstrument) SetType(v string) { } func (o PaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,30 +455,32 @@ func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrument) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrument) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *PaymentInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_payment_instrument_bank_account.go b/src/balanceplatform/model_payment_instrument_bank_account.go index b7bc991ed..ff3844109 100644 --- a/src/balanceplatform/model_payment_instrument_bank_account.go +++ b/src/balanceplatform/model_payment_instrument_bank_account.go @@ -10,12 +10,13 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // PaymentInstrumentBankAccount - Contains the business account details. Returned when you create a payment instrument with `type` **bankAccount**. type PaymentInstrumentBankAccount struct { - IbanAccountIdentification *IbanAccountIdentification + IbanAccountIdentification *IbanAccountIdentification USLocalAccountIdentification *USLocalAccountIdentification } @@ -33,6 +34,7 @@ func USLocalAccountIdentificationAsPaymentInstrumentBankAccount(v *USLocalAccoun } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { var err error @@ -43,7 +45,7 @@ func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -56,7 +58,7 @@ func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -90,7 +92,7 @@ func (src PaymentInstrumentBankAccount) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *PaymentInstrumentBankAccount) GetActualInstance() interface{} { +func (obj *PaymentInstrumentBankAccount) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -141,3 +143,5 @@ func (v *NullablePaymentInstrumentBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_payment_instrument_group.go b/src/balanceplatform/model_payment_instrument_group.go index 2e8e1cd91..743ba2d01 100644 --- a/src/balanceplatform/model_payment_instrument_group.go +++ b/src/balanceplatform/model_payment_instrument_group.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentGroup type satisfies the MappedNullable interface at compile time @@ -229,7 +228,7 @@ func (o *PaymentInstrumentGroup) SetTxVariant(v string) { } func (o PaymentInstrumentGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -290,3 +289,6 @@ func (v *NullablePaymentInstrumentGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_group_info.go b/src/balanceplatform/model_payment_instrument_group_info.go index 1556d38bf..e45b13c90 100644 --- a/src/balanceplatform/model_payment_instrument_group_info.go +++ b/src/balanceplatform/model_payment_instrument_group_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentGroupInfo type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *PaymentInstrumentGroupInfo) SetTxVariant(v string) { } func (o PaymentInstrumentGroupInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullablePaymentInstrumentGroupInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_info.go b/src/balanceplatform/model_payment_instrument_info.go index fad111e09..e48fe6794 100644 --- a/src/balanceplatform/model_payment_instrument_info.go +++ b/src/balanceplatform/model_payment_instrument_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentInfo type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &PaymentInstrumentInfo{} // PaymentInstrumentInfo struct for PaymentInstrumentInfo type PaymentInstrumentInfo struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - Card *CardInfo `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + Card *CardInfo `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. @@ -30,11 +29,11 @@ type PaymentInstrumentInfo struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -323,7 +322,7 @@ func (o *PaymentInstrumentInfo) SetType(v string) { } func (o PaymentInstrumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -392,30 +391,32 @@ func (v *NullablePaymentInstrumentInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrumentInfo) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentInfo) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentInfo) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_payment_instrument_requirement.go b/src/balanceplatform/model_payment_instrument_requirement.go index 99a73768f..756a6a809 100644 --- a/src/balanceplatform/model_payment_instrument_requirement.go +++ b/src/balanceplatform/model_payment_instrument_requirement.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentRequirement type satisfies the MappedNullable interface at compile time @@ -204,7 +203,7 @@ func (o *PaymentInstrumentRequirement) SetType(v string) { } func (o PaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -265,21 +264,23 @@ func (v *NullablePaymentInstrumentRequirement) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrumentRequirement) isValidPaymentInstrumentType() bool { - var allowedEnumValues = []string{"BankAccount", "Card"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentInstrumentType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Card" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentInstrumentType() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentRequirement) isValidType() bool { - var allowedEnumValues = []string{"paymentInstrumentRequirement"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentInstrumentRequirement" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_payment_instrument_reveal_info.go b/src/balanceplatform/model_payment_instrument_reveal_info.go index c262e3731..5d6e6e089 100644 --- a/src/balanceplatform/model_payment_instrument_reveal_info.go +++ b/src/balanceplatform/model_payment_instrument_reveal_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentRevealInfo type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &PaymentInstrumentRevealInfo{} // PaymentInstrumentRevealInfo struct for PaymentInstrumentRevealInfo type PaymentInstrumentRevealInfo struct { // The CVC2 value of the card. - Cvc string `json:"cvc"` + Cvc string `json:"cvc"` Expiration Expiry `json:"expiration"` // The primary account number (PAN) of the card. Pan string `json:"pan"` @@ -119,7 +118,7 @@ func (o *PaymentInstrumentRevealInfo) SetPan(v string) { } func (o PaymentInstrumentRevealInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -169,3 +168,6 @@ func (v *NullablePaymentInstrumentRevealInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_payment_instrument_update_request.go b/src/balanceplatform/model_payment_instrument_update_request.go index 57f3d73a2..54fe39348 100644 --- a/src/balanceplatform/model_payment_instrument_update_request.go +++ b/src/balanceplatform/model_payment_instrument_update_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrumentUpdateRequest type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &PaymentInstrumentUpdateRequest{} // PaymentInstrumentUpdateRequest struct for PaymentInstrumentUpdateRequest type PaymentInstrumentUpdateRequest struct { // The unique identifier of the balance account associated with this payment instrument. >You can only change the balance account ID if the payment instrument has **inactive** status. - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - Card *CardInfo `json:"card,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + Card *CardInfo `json:"card,omitempty"` + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // Comment for the status of the payment instrument. Required if `statusReason` is **other**. StatusComment *string `json:"statusComment,omitempty"` @@ -208,7 +207,7 @@ func (o *PaymentInstrumentUpdateRequest) SetStatusReason(v string) { } func (o PaymentInstrumentUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,21 +270,23 @@ func (v *NullablePaymentInstrumentUpdateRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *PaymentInstrumentUpdateRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentInstrumentUpdateRequest) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_phone.go b/src/balanceplatform/model_phone.go index 2770e1b00..f2ee6b143 100644 --- a/src/balanceplatform/model_phone.go +++ b/src/balanceplatform/model_phone.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &Phone{} type Phone struct { // The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. Number string `json:"number"` - // Type of phone number. Possible values: **Landline**, **Mobile**. + // Type of phone number. Possible values: **Landline**, **Mobile**. Type string `json:"type"` } @@ -93,7 +92,7 @@ func (o *Phone) SetType(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -143,12 +142,14 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Phone) isValidType() bool { - var allowedEnumValues = []string{"landline", "mobile"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "landline", "mobile" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_phone_number.go b/src/balanceplatform/model_phone_number.go index 8da029e8d..ba7a7b167 100644 --- a/src/balanceplatform/model_phone_number.go +++ b/src/balanceplatform/model_phone_number.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PhoneNumber type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PhoneNumber) SetPhoneType(v string) { } func (o PhoneNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PhoneNumber) isValidPhoneType() bool { - var allowedEnumValues = []string{"Fax", "Landline", "Mobile", "SIP"} - for _, allowed := range allowedEnumValues { - if o.GetPhoneType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Fax", "Landline", "Mobile", "SIP" } + for _, allowed := range allowedEnumValues { + if o.GetPhoneType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_pl_local_account_identification.go b/src/balanceplatform/model_pl_local_account_identification.go index 7851f5732..6d3bfaf57 100644 --- a/src/balanceplatform/model_pl_local_account_identification.go +++ b/src/balanceplatform/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_platform_payment_configuration.go b/src/balanceplatform/model_platform_payment_configuration.go index e536afeea..6da0fa04c 100644 --- a/src/balanceplatform/model_platform_payment_configuration.go +++ b/src/balanceplatform/model_platform_payment_configuration.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PlatformPaymentConfiguration type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PlatformPaymentConfiguration) SetSettlementDelayDays(v int32) { } func (o PlatformPaymentConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePlatformPaymentConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_processing_types_restriction.go b/src/balanceplatform/model_processing_types_restriction.go index 64bead516..da841527b 100644 --- a/src/balanceplatform/model_processing_types_restriction.go +++ b/src/balanceplatform/model_processing_types_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ProcessingTypesRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &ProcessingTypesRestriction{} type ProcessingTypesRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - // List of processing types. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **recurring**, **token**. + // List of processing types. Possible values: **atmWithdraw**, **balanceInquiry**, **ecommerce**, **moto**, **pos**, **recurring**, **token**. Value []string `json:"value,omitempty"` } @@ -100,7 +99,7 @@ func (o *ProcessingTypesRestriction) SetValue(v []string) { } func (o ProcessingTypesRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableProcessingTypesRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_remediating_action.go b/src/balanceplatform/model_remediating_action.go index 766e146a4..905a8d779 100644 --- a/src/balanceplatform/model_remediating_action.go +++ b/src/balanceplatform/model_remediating_action.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RemediatingAction type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *RemediatingAction) SetMessage(v string) { } func (o RemediatingAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableRemediatingAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_repayment.go b/src/balanceplatform/model_repayment.go index 5d3fed382..0efd35b28 100644 --- a/src/balanceplatform/model_repayment.go +++ b/src/balanceplatform/model_repayment.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Repayment type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &Repayment{} // Repayment struct for Repayment type Repayment struct { // The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - BasisPoints int32 `json:"basisPoints"` - Term *RepaymentTerm `json:"term,omitempty"` - Threshold *ThresholdRepayment `json:"threshold,omitempty"` + BasisPoints int32 `json:"basisPoints"` + Term *RepaymentTerm `json:"term,omitempty"` + Threshold *ThresholdRepayment `json:"threshold,omitempty"` } // NewRepayment instantiates a new Repayment object @@ -132,7 +131,7 @@ func (o *Repayment) SetThreshold(v ThresholdRepayment) { } func (o Repayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -186,3 +185,6 @@ func (v *NullableRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_repayment_term.go b/src/balanceplatform/model_repayment_term.go index 0cc40c2ef..e89e32df1 100644 --- a/src/balanceplatform/model_repayment_term.go +++ b/src/balanceplatform/model_repayment_term.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RepaymentTerm type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *RepaymentTerm) SetMaximumDays(v int32) { } func (o RepaymentTerm) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableRepaymentTerm) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_rest_service_error.go b/src/balanceplatform/model_rest_service_error.go index e670cc549..e5ca51d5d 100644 --- a/src/balanceplatform/model_rest_service_error.go +++ b/src/balanceplatform/model_rest_service_error.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidField `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - Response map[string]interface{} `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response map[string]interface{} `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -309,7 +308,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -373,3 +372,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_same_amount_restriction.go b/src/balanceplatform/model_same_amount_restriction.go index 8eb827d45..4600abaf5 100644 --- a/src/balanceplatform/model_same_amount_restriction.go +++ b/src/balanceplatform/model_same_amount_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SameAmountRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SameAmountRestriction{} type SameAmountRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - Value *bool `json:"value,omitempty"` + Value *bool `json:"value,omitempty"` } // NewSameAmountRestriction instantiates a new SameAmountRestriction object @@ -99,7 +98,7 @@ func (o *SameAmountRestriction) SetValue(v bool) { } func (o SameAmountRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableSameAmountRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_same_counterparty_restriction.go b/src/balanceplatform/model_same_counterparty_restriction.go index c1f45c653..3196ee96c 100644 --- a/src/balanceplatform/model_same_counterparty_restriction.go +++ b/src/balanceplatform/model_same_counterparty_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SameCounterpartyRestriction type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SameCounterpartyRestriction{} type SameCounterpartyRestriction struct { // Defines how the condition must be evaluated. Operation string `json:"operation"` - Value *bool `json:"value,omitempty"` + Value *bool `json:"value,omitempty"` } // NewSameCounterpartyRestriction instantiates a new SameCounterpartyRestriction object @@ -99,7 +98,7 @@ func (o *SameCounterpartyRestriction) SetValue(v bool) { } func (o SameCounterpartyRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableSameCounterpartyRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_se_local_account_identification.go b/src/balanceplatform/model_se_local_account_identification.go index b281ca854..073a06c04 100644 --- a/src/balanceplatform/model_se_local_account_identification.go +++ b/src/balanceplatform/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sg_local_account_identification.go b/src/balanceplatform/model_sg_local_account_identification.go index 2e2c93e7b..a261e093e 100644 --- a/src/balanceplatform/model_sg_local_account_identification.go +++ b/src/balanceplatform/model_sg_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *SGLocalAccountIdentification) SetType(v string) { } func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,12 +183,14 @@ func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SGLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"sgLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_string_match.go b/src/balanceplatform/model_string_match.go index 0262bc040..63b8a6f93 100644 --- a/src/balanceplatform/model_string_match.go +++ b/src/balanceplatform/model_string_match.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StringMatch type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *StringMatch) SetValue(v string) { } func (o StringMatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableStringMatch) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StringMatch) isValidOperation() bool { - var allowedEnumValues = []string{"contains", "endsWith", "isEqualTo", "startsWith"} - for _, allowed := range allowedEnumValues { - if o.GetOperation() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "contains", "endsWith", "isEqualTo", "startsWith" } + for _, allowed := range allowedEnumValues { + if o.GetOperation() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sweep_configuration_v2.go b/src/balanceplatform/model_sweep_configuration_v2.go index 256a531d7..89b06690d 100644 --- a/src/balanceplatform/model_sweep_configuration_v2.go +++ b/src/balanceplatform/model_sweep_configuration_v2.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SweepConfigurationV2 type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &SweepConfigurationV2{} // SweepConfigurationV2 struct for SweepConfigurationV2 type SweepConfigurationV2 struct { // The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. - Category *string `json:"category,omitempty"` + Category *string `json:"category,omitempty"` Counterparty SweepCounterparty `json:"counterparty"` // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). Currency string `json:"currency"` @@ -31,12 +30,12 @@ type SweepConfigurationV2 struct { // The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). Priorities []string `json:"priorities,omitempty"` // The reason for disabling the sweep. - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` Schedule SweepSchedule `json:"schedule"` - // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. - Status *string `json:"status,omitempty"` - SweepAmount *Amount `json:"sweepAmount,omitempty"` - TargetAmount *Amount `json:"targetAmount,omitempty"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` TriggerAmount *Amount `json:"triggerAmount,omitempty"` // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. Type *string `json:"type,omitempty"` @@ -452,7 +451,7 @@ func (o *SweepConfigurationV2) SetType(v string) { } func (o SweepConfigurationV2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -531,39 +530,41 @@ func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SweepConfigurationV2) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *SweepConfigurationV2) isValidType() bool { - var allowedEnumValues = []string{"pull", "push"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "pull", "push" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_sweep_counterparty.go b/src/balanceplatform/model_sweep_counterparty.go index 439d19a30..12883d6ad 100644 --- a/src/balanceplatform/model_sweep_counterparty.go +++ b/src/balanceplatform/model_sweep_counterparty.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SweepCounterparty type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *SweepCounterparty) SetTransferInstrumentId(v string) { } func (o SweepCounterparty) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableSweepCounterparty) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_sweep_schedule.go b/src/balanceplatform/model_sweep_schedule.go index 530a3fe92..1ca63478f 100644 --- a/src/balanceplatform/model_sweep_schedule.go +++ b/src/balanceplatform/model_sweep_schedule.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SweepSchedule type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &SweepSchedule{} // SweepSchedule struct for SweepSchedule type SweepSchedule struct { - // A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. + // A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. CronExpression *string `json:"cronExpression,omitempty"` - // The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + // The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. Type string `json:"type"` } @@ -100,7 +99,7 @@ func (o *SweepSchedule) SetType(v string) { } func (o SweepSchedule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableSweepSchedule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SweepSchedule) isValidType() bool { - var allowedEnumValues = []string{"daily", "weekly", "monthly", "balance", "cron"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "weekly", "monthly", "balance", "cron" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_threshold_repayment.go b/src/balanceplatform/model_threshold_repayment.go index ee82725bb..f9cdcb3af 100644 --- a/src/balanceplatform/model_threshold_repayment.go +++ b/src/balanceplatform/model_threshold_repayment.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThresholdRepayment type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *ThresholdRepayment) SetAmount(v Amount) { } func (o ThresholdRepayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableThresholdRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_time_of_day.go b/src/balanceplatform/model_time_of_day.go index 096c3d26d..fba990950 100644 --- a/src/balanceplatform/model_time_of_day.go +++ b/src/balanceplatform/model_time_of_day.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TimeOfDay type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &TimeOfDay{} // TimeOfDay struct for TimeOfDay type TimeOfDay struct { - // The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + // The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. EndTime *string `json:"endTime,omitempty"` - // The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + // The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. StartTime *string `json:"startTime,omitempty"` } @@ -107,7 +106,7 @@ func (o *TimeOfDay) SetStartTime(v string) { } func (o TimeOfDay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTimeOfDay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_time_of_day_restriction.go b/src/balanceplatform/model_time_of_day_restriction.go index afdbe6c57..756d117a2 100644 --- a/src/balanceplatform/model_time_of_day_restriction.go +++ b/src/balanceplatform/model_time_of_day_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TimeOfDayRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &TimeOfDayRestriction{} // TimeOfDayRestriction struct for TimeOfDayRestriction type TimeOfDayRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value *TimeOfDay `json:"value,omitempty"` + Operation string `json:"operation"` + Value *TimeOfDay `json:"value,omitempty"` } // NewTimeOfDayRestriction instantiates a new TimeOfDayRestriction object @@ -99,7 +98,7 @@ func (o *TimeOfDayRestriction) SetValue(v TimeOfDay) { } func (o TimeOfDayRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableTimeOfDayRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_total_amount_restriction.go b/src/balanceplatform/model_total_amount_restriction.go index 52d221ddb..a1f2b0a7b 100644 --- a/src/balanceplatform/model_total_amount_restriction.go +++ b/src/balanceplatform/model_total_amount_restriction.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TotalAmountRestriction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &TotalAmountRestriction{} // TotalAmountRestriction struct for TotalAmountRestriction type TotalAmountRestriction struct { // Defines how the condition must be evaluated. - Operation string `json:"operation"` - Value *Amount `json:"value,omitempty"` + Operation string `json:"operation"` + Value *Amount `json:"value,omitempty"` } // NewTotalAmountRestriction instantiates a new TotalAmountRestriction object @@ -99,7 +98,7 @@ func (o *TotalAmountRestriction) SetValue(v Amount) { } func (o TotalAmountRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableTotalAmountRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule.go b/src/balanceplatform/model_transaction_rule.go index 9d37299d9..c56a509c9 100644 --- a/src/balanceplatform/model_transaction_rule.go +++ b/src/balanceplatform/model_transaction_rule.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRule type satisfies the MappedNullable interface at compile time @@ -24,25 +23,25 @@ type TransactionRule struct { // Your description for the transaction rule, maximum 300 characters. Description string `json:"description"` // The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. - EndDate *string `json:"endDate,omitempty"` + EndDate *string `json:"endDate,omitempty"` EntityKey TransactionRuleEntityKey `json:"entityKey"` // The unique identifier of the transaction rule. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Interval TransactionRuleInterval `json:"interval"` // The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. - RequestType *string `json:"requestType,omitempty"` + RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. Score *int32 `json:"score,omitempty"` - // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. StartDate *string `json:"startDate,omitempty"` // The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. Status *string `json:"status,omitempty"` - // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. Type string `json:"type"` } @@ -470,7 +469,7 @@ func (o *TransactionRule) SetType(v string) { } func (o TransactionRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -548,39 +547,41 @@ func (v *NullableTransactionRule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRule) isValidOutcomeType() bool { - var allowedEnumValues = []string{"enforceSCA", "hardBlock", "scoreBased"} - for _, allowed := range allowedEnumValues { - if o.GetOutcomeType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "enforceSCA", "hardBlock", "scoreBased" } + for _, allowed := range allowedEnumValues { + if o.GetOutcomeType() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidRequestType() bool { - var allowedEnumValues = []string{"authentication", "authorization", "bankTransfer", "tokenization"} - for _, allowed := range allowedEnumValues { - if o.GetRequestType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "authentication", "authorization", "bankTransfer", "tokenization" } + for _, allowed := range allowedEnumValues { + if o.GetRequestType() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *TransactionRule) isValidType() bool { - var allowedEnumValues = []string{"allowList", "blockList", "maxUsage", "velocity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allowList", "blockList", "maxUsage", "velocity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_entity_key.go b/src/balanceplatform/model_transaction_rule_entity_key.go index 40426d07d..25b880503 100644 --- a/src/balanceplatform/model_transaction_rule_entity_key.go +++ b/src/balanceplatform/model_transaction_rule_entity_key.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRuleEntityKey type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TransactionRuleEntityKey) SetEntityType(v string) { } func (o TransactionRuleEntityKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTransactionRuleEntityKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule_info.go b/src/balanceplatform/model_transaction_rule_info.go index b0b09402f..9177fe877 100644 --- a/src/balanceplatform/model_transaction_rule_info.go +++ b/src/balanceplatform/model_transaction_rule_info.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRuleInfo type satisfies the MappedNullable interface at compile time @@ -24,23 +23,23 @@ type TransactionRuleInfo struct { // Your description for the transaction rule, maximum 300 characters. Description string `json:"description"` // The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. - EndDate *string `json:"endDate,omitempty"` + EndDate *string `json:"endDate,omitempty"` EntityKey TransactionRuleEntityKey `json:"entityKey"` - Interval TransactionRuleInterval `json:"interval"` + Interval TransactionRuleInterval `json:"interval"` // The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. OutcomeType *string `json:"outcomeType,omitempty"` // Your reference for the transaction rule, maximum 150 characters. Reference string `json:"reference"` // Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. - RequestType *string `json:"requestType,omitempty"` + RequestType *string `json:"requestType,omitempty"` RuleRestrictions TransactionRuleRestrictions `json:"ruleRestrictions"` // A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. Score *int32 `json:"score,omitempty"` - // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + // The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. StartDate *string `json:"startDate,omitempty"` // The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. Status *string `json:"status,omitempty"` - // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + // The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. Type string `json:"type"` } @@ -436,7 +435,7 @@ func (o *TransactionRuleInfo) SetType(v string) { } func (o TransactionRuleInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -511,39 +510,41 @@ func (v *NullableTransactionRuleInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRuleInfo) isValidOutcomeType() bool { - var allowedEnumValues = []string{"enforceSCA", "hardBlock", "scoreBased"} - for _, allowed := range allowedEnumValues { - if o.GetOutcomeType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "enforceSCA", "hardBlock", "scoreBased" } + for _, allowed := range allowedEnumValues { + if o.GetOutcomeType() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidRequestType() bool { - var allowedEnumValues = []string{"authentication", "authorization", "bankTransfer", "tokenization"} - for _, allowed := range allowedEnumValues { - if o.GetRequestType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "authentication", "authorization", "bankTransfer", "tokenization" } + for _, allowed := range allowedEnumValues { + if o.GetRequestType() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *TransactionRuleInfo) isValidType() bool { - var allowedEnumValues = []string{"allowList", "blockList", "maxUsage", "velocity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allowList", "blockList", "maxUsage", "velocity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_interval.go b/src/balanceplatform/model_transaction_rule_interval.go index b50bd9cc9..078f5502b 100644 --- a/src/balanceplatform/model_transaction_rule_interval.go +++ b/src/balanceplatform/model_transaction_rule_interval.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRuleInterval type satisfies the MappedNullable interface at compile time @@ -22,8 +21,8 @@ type TransactionRuleInterval struct { // The day of month, used when the `duration.unit` is **months**. If not provided, by default, this is set to **1**, the first day of the month. DayOfMonth *int32 `json:"dayOfMonth,omitempty"` // The day of week, used when the `duration.unit` is **weeks**. If not provided, by default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, **wednesday**, **thursday**, **friday**. - DayOfWeek *string `json:"dayOfWeek,omitempty"` - Duration *Duration `json:"duration,omitempty"` + DayOfWeek *string `json:"dayOfWeek,omitempty"` + Duration *Duration `json:"duration,omitempty"` // The time of day, in **hh:mm:ss** format, used when the `duration.unit` is **hours**. If not provided, by default, this is set to **00:00:00**. TimeOfDay *string `json:"timeOfDay,omitempty"` // The [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, **Europe/Amsterdam**. By default, this is set to **UTC**. @@ -235,7 +234,7 @@ func (o *TransactionRuleInterval) SetType(v string) { } func (o TransactionRuleInterval) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,21 +298,23 @@ func (v *NullableTransactionRuleInterval) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionRuleInterval) isValidDayOfWeek() bool { - var allowedEnumValues = []string{"friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday"} - for _, allowed := range allowedEnumValues { - if o.GetDayOfWeek() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" } + for _, allowed := range allowedEnumValues { + if o.GetDayOfWeek() == allowed { + return true + } + } + return false } func (o *TransactionRuleInterval) isValidType() bool { - var allowedEnumValues = []string{"daily", "lifetime", "monthly", "perTransaction", "rolling", "sliding", "weekly"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "lifetime", "monthly", "perTransaction", "rolling", "sliding", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transaction_rule_response.go b/src/balanceplatform/model_transaction_rule_response.go index 0e037fdb4..7065a6380 100644 --- a/src/balanceplatform/model_transaction_rule_response.go +++ b/src/balanceplatform/model_transaction_rule_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRuleResponse type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *TransactionRuleResponse) SetTransactionRule(v TransactionRule) { } func (o TransactionRuleResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableTransactionRuleResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rule_restrictions.go b/src/balanceplatform/model_transaction_rule_restrictions.go index b6a3de0e8..f6522bfca 100644 --- a/src/balanceplatform/model_transaction_rule_restrictions.go +++ b/src/balanceplatform/model_transaction_rule_restrictions.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRuleRestrictions type satisfies the MappedNullable interface at compile time @@ -19,23 +18,23 @@ var _ common.MappedNullable = &TransactionRuleRestrictions{} // TransactionRuleRestrictions struct for TransactionRuleRestrictions type TransactionRuleRestrictions struct { - ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` - BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` - CounterpartyBank *CounterpartyBankRestriction `json:"counterpartyBank,omitempty"` - Countries *CountriesRestriction `json:"countries,omitempty"` - DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` - DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` - EntryModes *EntryModesRestriction `json:"entryModes,omitempty"` - InternationalTransaction *InternationalTransactionRestriction `json:"internationalTransaction,omitempty"` - MatchingTransactions *MatchingTransactionsRestriction `json:"matchingTransactions,omitempty"` - Mccs *MccsRestriction `json:"mccs,omitempty"` - MerchantNames *MerchantNamesRestriction `json:"merchantNames,omitempty"` - Merchants *MerchantsRestriction `json:"merchants,omitempty"` - ProcessingTypes *ProcessingTypesRestriction `json:"processingTypes,omitempty"` - SameAmountRestriction *SameAmountRestriction `json:"sameAmountRestriction,omitempty"` - SameCounterpartyRestriction *SameCounterpartyRestriction `json:"sameCounterpartyRestriction,omitempty"` - TimeOfDay *TimeOfDayRestriction `json:"timeOfDay,omitempty"` - TotalAmount *TotalAmountRestriction `json:"totalAmount,omitempty"` + ActiveNetworkTokens *ActiveNetworkTokensRestriction `json:"activeNetworkTokens,omitempty"` + BrandVariants *BrandVariantsRestriction `json:"brandVariants,omitempty"` + CounterpartyBank *CounterpartyBankRestriction `json:"counterpartyBank,omitempty"` + Countries *CountriesRestriction `json:"countries,omitempty"` + DayOfWeek *DayOfWeekRestriction `json:"dayOfWeek,omitempty"` + DifferentCurrencies *DifferentCurrenciesRestriction `json:"differentCurrencies,omitempty"` + EntryModes *EntryModesRestriction `json:"entryModes,omitempty"` + InternationalTransaction *InternationalTransactionRestriction `json:"internationalTransaction,omitempty"` + MatchingTransactions *MatchingTransactionsRestriction `json:"matchingTransactions,omitempty"` + Mccs *MccsRestriction `json:"mccs,omitempty"` + MerchantNames *MerchantNamesRestriction `json:"merchantNames,omitempty"` + Merchants *MerchantsRestriction `json:"merchants,omitempty"` + ProcessingTypes *ProcessingTypesRestriction `json:"processingTypes,omitempty"` + SameAmountRestriction *SameAmountRestriction `json:"sameAmountRestriction,omitempty"` + SameCounterpartyRestriction *SameCounterpartyRestriction `json:"sameCounterpartyRestriction,omitempty"` + TimeOfDay *TimeOfDayRestriction `json:"timeOfDay,omitempty"` + TotalAmount *TotalAmountRestriction `json:"totalAmount,omitempty"` } // NewTransactionRuleRestrictions instantiates a new TransactionRuleRestrictions object @@ -600,7 +599,7 @@ func (o *TransactionRuleRestrictions) SetTotalAmount(v TotalAmountRestriction) { } func (o TransactionRuleRestrictions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -698,3 +697,6 @@ func (v *NullableTransactionRuleRestrictions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transaction_rules_response.go b/src/balanceplatform/model_transaction_rules_response.go index 72e718a66..d6371ead7 100644 --- a/src/balanceplatform/model_transaction_rules_response.go +++ b/src/balanceplatform/model_transaction_rules_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionRulesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TransactionRulesResponse) SetTransactionRules(v []TransactionRule) { } func (o TransactionRulesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTransactionRulesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_transfer_route.go b/src/balanceplatform/model_transfer_route.go index 0265c8d45..a9e4a9020 100644 --- a/src/balanceplatform/model_transfer_route.go +++ b/src/balanceplatform/model_transfer_route.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferRoute type satisfies the MappedNullable interface at compile time @@ -19,14 +18,14 @@ var _ common.MappedNullable = &TransferRoute{} // TransferRoute struct for TransferRoute type TransferRoute struct { - // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. Category *string `json:"category,omitempty"` // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. Country *string `json:"country,omitempty"` // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. Currency *string `json:"currency,omitempty"` // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). - Priority *string `json:"priority,omitempty"` + Priority *string `json:"priority,omitempty"` Requirements *TransferRouteRequirements `json:"requirements,omitempty"` } @@ -208,7 +207,7 @@ func (o *TransferRoute) SetRequirements(v TransferRouteRequirements) { } func (o TransferRoute) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,21 +270,23 @@ func (v *NullableTransferRoute) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferRoute) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "topUp", "upgrade"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "topUp", "upgrade" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *TransferRoute) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "crossBorder", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transfer_route_request.go b/src/balanceplatform/model_transfer_route_request.go index 2f6c76195..ddc918361 100644 --- a/src/balanceplatform/model_transfer_route_request.go +++ b/src/balanceplatform/model_transfer_route_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferRouteRequest type satisfies the MappedNullable interface at compile time @@ -23,8 +22,8 @@ type TransferRouteRequest struct { BalanceAccountId *string `json:"balanceAccountId,omitempty"` // The unique identifier assigned to the balance platform associated with the account holder. BalancePlatform string `json:"balancePlatform"` - // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - Category string `json:"category"` + // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + Category string `json:"category"` Counterparty *Counterparty `json:"counterparty,omitempty"` // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. > Either `counterparty` or `country` field must be provided in a transfer route request. Country *string `json:"country,omitempty"` @@ -255,7 +254,7 @@ func (o *TransferRouteRequest) SetPriorities(v []string) { } func (o TransferRouteRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -318,12 +317,14 @@ func (v *NullableTransferRouteRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferRouteRequest) isValidCategory() bool { - var allowedEnumValues = []string{"bank"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_transfer_route_requirements.go b/src/balanceplatform/model_transfer_route_requirements.go index 052b22446..b06df9dd4 100644 --- a/src/balanceplatform/model_transfer_route_requirements.go +++ b/src/balanceplatform/model_transfer_route_requirements.go @@ -10,15 +10,16 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // TransferRouteRequirements - A set of rules defined by clearing houses and banking partners. Your transfer request must adhere to these rules to ensure successful initiation of transfer. Based on the priority, one or more requirements may be returned. Each requirement is defined with a `type` and `description`. type TransferRouteRequirements struct { - AddressRequirement *AddressRequirement - AmountMinMaxRequirement *AmountMinMaxRequirement + AddressRequirement *AddressRequirement + AmountMinMaxRequirement *AmountMinMaxRequirement BankAccountIdentificationTypeRequirement *BankAccountIdentificationTypeRequirement - PaymentInstrumentRequirement *PaymentInstrumentRequirement + PaymentInstrumentRequirement *PaymentInstrumentRequirement } // AddressRequirementAsTransferRouteRequirements is a convenience function that returns AddressRequirement wrapped in TransferRouteRequirements @@ -49,6 +50,7 @@ func PaymentInstrumentRequirementAsTransferRouteRequirements(v *PaymentInstrumen } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { var err error @@ -59,7 +61,7 @@ func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { jsonAddressRequirement, _ := json.Marshal(dst.AddressRequirement) if string(jsonAddressRequirement) == "{}" || !dst.AddressRequirement.isValidType() { // empty struct dst.AddressRequirement = nil - } else { + } else { match++ } } else { @@ -72,7 +74,7 @@ func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { jsonAmountMinMaxRequirement, _ := json.Marshal(dst.AmountMinMaxRequirement) if string(jsonAmountMinMaxRequirement) == "{}" || !dst.AmountMinMaxRequirement.isValidType() { // empty struct dst.AmountMinMaxRequirement = nil - } else { + } else { match++ } } else { @@ -85,7 +87,7 @@ func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { jsonBankAccountIdentificationTypeRequirement, _ := json.Marshal(dst.BankAccountIdentificationTypeRequirement) if string(jsonBankAccountIdentificationTypeRequirement) == "{}" || !dst.BankAccountIdentificationTypeRequirement.isValidType() { // empty struct dst.BankAccountIdentificationTypeRequirement = nil - } else { + } else { match++ } } else { @@ -98,7 +100,7 @@ func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { jsonPaymentInstrumentRequirement, _ := json.Marshal(dst.PaymentInstrumentRequirement) if string(jsonPaymentInstrumentRequirement) == "{}" || !dst.PaymentInstrumentRequirement.isValidType() { // empty struct dst.PaymentInstrumentRequirement = nil - } else { + } else { match++ } } else { @@ -142,7 +144,7 @@ func (src TransferRouteRequirements) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *TransferRouteRequirements) GetActualInstance() interface{} { +func (obj *TransferRouteRequirements) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -201,3 +203,5 @@ func (v *NullableTransferRouteRequirements) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/balanceplatform/model_transfer_route_response.go b/src/balanceplatform/model_transfer_route_response.go index 16bca6daf..bfc9ea330 100644 --- a/src/balanceplatform/model_transfer_route_response.go +++ b/src/balanceplatform/model_transfer_route_response.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferRouteResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TransferRouteResponse) SetTransferRoutes(v []TransferRoute) { } func (o TransferRouteResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTransferRouteResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_uk_local_account_identification.go b/src/balanceplatform/model_uk_local_account_identification.go index ce31541eb..dfcd2584e 100644 --- a/src/balanceplatform/model_uk_local_account_identification.go +++ b/src/balanceplatform/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_update_network_token_request.go b/src/balanceplatform/model_update_network_token_request.go index 9f17d1caa..55cf9cc5f 100644 --- a/src/balanceplatform/model_update_network_token_request.go +++ b/src/balanceplatform/model_update_network_token_request.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateNetworkTokenRequest type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *UpdateNetworkTokenRequest) SetStatus(v string) { } func (o UpdateNetworkTokenRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableUpdateNetworkTokenRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateNetworkTokenRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "suspended", "closed"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "suspended", "closed" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_update_payment_instrument.go b/src/balanceplatform/model_update_payment_instrument.go index 37ab96062..369ef3049 100644 --- a/src/balanceplatform/model_update_payment_instrument.go +++ b/src/balanceplatform/model_update_payment_instrument.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdatePaymentInstrument type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &UpdatePaymentInstrument{} // UpdatePaymentInstrument struct for UpdatePaymentInstrument type UpdatePaymentInstrument struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` - Card *Card `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` + Card *Card `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The unique identifier of the payment instrument. @@ -33,13 +32,13 @@ type UpdatePaymentInstrument struct { PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` // Your reference for the payment instrument, maximum 150 characters. Reference *string `json:"reference,omitempty"` - // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. Status *string `json:"status,omitempty"` // Comment for the status of the payment instrument. Required if `statusReason` is **other**. StatusComment *string `json:"statusComment,omitempty"` // The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. StatusReason *string `json:"statusReason,omitempty"` - // Type of payment instrument. Possible value: **card**, **bankAccount**. + // Type of payment instrument. Possible value: **card**, **bankAccount**. Type string `json:"type"` } @@ -417,7 +416,7 @@ func (o *UpdatePaymentInstrument) SetType(v string) { } func (o UpdatePaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,30 +492,32 @@ func (v *NullableUpdatePaymentInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdatePaymentInstrument) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive", "suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *UpdatePaymentInstrument) isValidStatusReason() bool { - var allowedEnumValues = []string{"accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule"} - for _, allowed := range allowedEnumValues { - if o.GetStatusReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "accountClosure", "damaged", "endOfLife", "expired", "lost", "other", "stolen", "suspectedFraud", "transactionRule" } + for _, allowed := range allowedEnumValues { + if o.GetStatusReason() == allowed { + return true + } + } + return false } func (o *UpdatePaymentInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_update_sweep_configuration_v2.go b/src/balanceplatform/model_update_sweep_configuration_v2.go index 23f34ed9f..d3fb78d9d 100644 --- a/src/balanceplatform/model_update_sweep_configuration_v2.go +++ b/src/balanceplatform/model_update_sweep_configuration_v2.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateSweepConfigurationV2 type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &UpdateSweepConfigurationV2{} // UpdateSweepConfigurationV2 struct for UpdateSweepConfigurationV2 type UpdateSweepConfigurationV2 struct { // The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. - Category *string `json:"category,omitempty"` + Category *string `json:"category,omitempty"` Counterparty *SweepCounterparty `json:"counterparty,omitempty"` // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). Currency *string `json:"currency,omitempty"` @@ -31,12 +30,12 @@ type UpdateSweepConfigurationV2 struct { // The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). Priorities []string `json:"priorities,omitempty"` // The reason for disabling the sweep. - Reason *string `json:"reason,omitempty"` + Reason *string `json:"reason,omitempty"` Schedule *SweepSchedule `json:"schedule,omitempty"` - // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. - Status *string `json:"status,omitempty"` - SweepAmount *Amount `json:"sweepAmount,omitempty"` - TargetAmount *Amount `json:"targetAmount,omitempty"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` TriggerAmount *Amount `json:"triggerAmount,omitempty"` // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. Type *string `json:"type,omitempty"` @@ -480,7 +479,7 @@ func (o *UpdateSweepConfigurationV2) SetType(v string) { } func (o UpdateSweepConfigurationV2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -567,39 +566,41 @@ func (v *NullableUpdateSweepConfigurationV2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateSweepConfigurationV2) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *UpdateSweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *UpdateSweepConfigurationV2) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *UpdateSweepConfigurationV2) isValidType() bool { - var allowedEnumValues = []string{"pull", "push"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "pull", "push" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_us_local_account_identification.go b/src/balanceplatform/model_us_local_account_identification.go index 876b67f04..3f5af4cb9 100644 --- a/src/balanceplatform/model_us_local_account_identification.go +++ b/src/balanceplatform/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_verification_deadline.go b/src/balanceplatform/model_verification_deadline.go index aa1cba2fb..176e04fdd 100644 --- a/src/balanceplatform/model_verification_deadline.go +++ b/src/balanceplatform/model_verification_deadline.go @@ -10,9 +10,8 @@ package balanceplatform import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationDeadline type satisfies the MappedNullable interface at compile time @@ -128,7 +127,7 @@ func (o *VerificationDeadline) SetExpiresAt(v time.Time) { } func (o VerificationDeadline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,3 +179,6 @@ func (v *NullableVerificationDeadline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/balanceplatform/model_verification_error.go b/src/balanceplatform/model_verification_error.go index 4417c676e..87daaa86d 100644 --- a/src/balanceplatform/model_verification_error.go +++ b/src/balanceplatform/model_verification_error.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *VerificationError) SetType(v string) { } func (o VerificationError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableVerificationError) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationError) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/balanceplatform/model_verification_error_recursive.go b/src/balanceplatform/model_verification_error_recursive.go index 09240b030..81509cd3f 100644 --- a/src/balanceplatform/model_verification_error_recursive.go +++ b/src/balanceplatform/model_verification_error_recursive.go @@ -10,8 +10,7 @@ package balanceplatform import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationErrorRecursive type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *VerificationErrorRecursive) SetRemediatingActions(v []RemediatingAction } func (o VerificationErrorRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableVerificationErrorRecursive) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationErrorRecursive) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/binlookup/api_general.go b/src/binlookup/api_general.go index 1d494229e..65b052444 100644 --- a/src/binlookup/api_general.go +++ b/src/binlookup/api_general.go @@ -10,10 +10,10 @@ package binlookup import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiGet3dsAvailabilityInput) ThreeDSAvailabilityRequest(threeDSAva return r } + /* Prepare a request for Get3dsAvailability @return GeneralApiGet3dsAvailabilityInput */ func (a *GeneralApi) Get3dsAvailabilityInput() GeneralApiGet3dsAvailabilityInput { - return GeneralApiGet3dsAvailabilityInput{} + return GeneralApiGet3dsAvailabilityInput{ + } } /* @@ -50,24 +52,26 @@ For more information, refer to [3D Secure 2](https://docs.adyen.com/online-payme @return ThreeDSAvailabilityResponse, *http.Response, error */ func (a *GeneralApi) Get3dsAvailability(ctx context.Context, r GeneralApiGet3dsAvailabilityInput) (ThreeDSAvailabilityResponse, *http.Response, error) { - res := &ThreeDSAvailabilityResponse{} + res := &ThreeDSAvailabilityResponse{} path := "/get3dsAvailability" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.threeDSAvailabilityRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.threeDSAvailabilityRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.GetCostEstimate type GeneralApiGetCostEstimateInput struct { costEstimateRequest *CostEstimateRequest @@ -78,13 +82,15 @@ func (r GeneralApiGetCostEstimateInput) CostEstimateRequest(costEstimateRequest return r } + /* Prepare a request for GetCostEstimate @return GeneralApiGetCostEstimateInput */ func (a *GeneralApi) GetCostEstimateInput() GeneralApiGetCostEstimateInput { - return GeneralApiGetCostEstimateInput{} + return GeneralApiGetCostEstimateInput{ + } } /* @@ -103,20 +109,22 @@ To retrieve this information, make the call to the `/getCostEstimate` endpoint. @return CostEstimateResponse, *http.Response, error */ func (a *GeneralApi) GetCostEstimate(ctx context.Context, r GeneralApiGetCostEstimateInput) (CostEstimateResponse, *http.Response, error) { - res := &CostEstimateResponse{} + res := &CostEstimateResponse{} path := "/getCostEstimate" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.costEstimateRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.costEstimateRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/binlookup/model_amount.go b/src/binlookup/model_amount.go index fa394aa9f..e3da631e6 100644 --- a/src/binlookup/model_amount.go +++ b/src/binlookup/model_amount.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_bin_detail.go b/src/binlookup/model_bin_detail.go index 6ea856806..f179abb17 100644 --- a/src/binlookup/model_bin_detail.go +++ b/src/binlookup/model_bin_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BinDetail type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BinDetail) SetIssuerCountry(v string) { } func (o BinDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBinDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_card_bin.go b/src/binlookup/model_card_bin.go index 2c36afb82..a7103ddd5 100644 --- a/src/binlookup/model_card_bin.go +++ b/src/binlookup/model_card_bin.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardBin type satisfies the MappedNullable interface at compile time @@ -413,7 +412,7 @@ func (o *CardBin) SetSummary(v string) { } func (o CardBin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -493,3 +492,6 @@ func (v *NullableCardBin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_cost_estimate_assumptions.go b/src/binlookup/model_cost_estimate_assumptions.go index 794b8f481..e01f26cca 100644 --- a/src/binlookup/model_cost_estimate_assumptions.go +++ b/src/binlookup/model_cost_estimate_assumptions.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CostEstimateAssumptions type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CostEstimateAssumptions) SetInstallments(v int32) { } func (o CostEstimateAssumptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCostEstimateAssumptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_cost_estimate_request.go b/src/binlookup/model_cost_estimate_request.go index a7847a2c3..9f02e1bbf 100644 --- a/src/binlookup/model_cost_estimate_request.go +++ b/src/binlookup/model_cost_estimate_request.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CostEstimateRequest type satisfies the MappedNullable interface at compile time @@ -19,16 +18,16 @@ var _ common.MappedNullable = &CostEstimateRequest{} // CostEstimateRequest struct for CostEstimateRequest type CostEstimateRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` Assumptions *CostEstimateAssumptions `json:"assumptions,omitempty"` // The card number (4-19 characters) for PCI compliant use cases. Do not use any separators. > Either the `cardNumber` or `encryptedCardNumber` field must be provided in a payment request. CardNumber *string `json:"cardNumber,omitempty"` // Encrypted data that stores card information for non PCI-compliant use cases. The encrypted data must be created with the Checkout Card Component or Secured Fields Component, and must contain the `encryptedCardNumber` field. > Either the `cardNumber` or `encryptedCardNumber` field must be provided in a payment request. EncryptedCardNumber *string `json:"encryptedCardNumber,omitempty"` // The merchant account identifier you want to process the (transaction) request with. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` MerchantDetails *MerchantDetails `json:"merchantDetails,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` + Recurring *Recurring `json:"recurring,omitempty"` // The `recurringDetailReference` you want to use for this cost estimate. The value `LATEST` can be used to select the most recently stored recurring detail. SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the card holder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. @@ -361,7 +360,7 @@ func (o *CostEstimateRequest) SetShopperReference(v string) { } func (o CostEstimateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -435,12 +434,14 @@ func (v *NullableCostEstimateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CostEstimateRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/binlookup/model_cost_estimate_response.go b/src/binlookup/model_cost_estimate_response.go index 67ba61cf4..61bc6be6a 100644 --- a/src/binlookup/model_cost_estimate_response.go +++ b/src/binlookup/model_cost_estimate_response.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CostEstimateResponse type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &CostEstimateResponse{} // CostEstimateResponse struct for CostEstimateResponse type CostEstimateResponse struct { - CardBin *CardBin `json:"cardBin,omitempty"` - CostEstimateAmount *Amount `json:"costEstimateAmount,omitempty"` + CardBin *CardBin `json:"cardBin,omitempty"` + CostEstimateAmount *Amount `json:"costEstimateAmount,omitempty"` // Adyen's 16-character reference associated with the request. CostEstimateReference *string `json:"costEstimateReference,omitempty"` // The result of the cost estimation. @@ -207,7 +206,7 @@ func (o *CostEstimateResponse) SetSurchargeType(v string) { } func (o CostEstimateResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -269,3 +268,6 @@ func (v *NullableCostEstimateResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_ds_public_key_detail.go b/src/binlookup/model_ds_public_key_detail.go index 3edc29169..41e312978 100644 --- a/src/binlookup/model_ds_public_key_detail.go +++ b/src/binlookup/model_ds_public_key_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DSPublicKeyDetail type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *DSPublicKeyDetail) SetRootCertificates(v string) { } func (o DSPublicKeyDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableDSPublicKeyDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_merchant_details.go b/src/binlookup/model_merchant_details.go index 170fac4a4..21cfdf28f 100644 --- a/src/binlookup/model_merchant_details.go +++ b/src/binlookup/model_merchant_details.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantDetails type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDetails) SetMcc(v string) { } func (o MerchantDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_recurring.go b/src/binlookup/model_recurring.go index dccf2a73c..1e35b65e9 100644 --- a/src/binlookup/model_recurring.go +++ b/src/binlookup/model_recurring.go @@ -10,9 +10,8 @@ package binlookup import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/binlookup/model_service_error.go b/src/binlookup/model_service_error.go index db1310378..4d35496ff 100644 --- a/src/binlookup/model_service_error.go +++ b/src/binlookup/model_service_error.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds2_card_range_detail.go b/src/binlookup/model_three_ds2_card_range_detail.go index a41ec8171..fc1df1c02 100644 --- a/src/binlookup/model_three_ds2_card_range_detail.go +++ b/src/binlookup/model_three_ds2_card_range_detail.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2CardRangeDetail type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ThreeDS2CardRangeDetail) SetThreeDSMethodURL(v string) { } func (o ThreeDS2CardRangeDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableThreeDS2CardRangeDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds_availability_request.go b/src/binlookup/model_three_ds_availability_request.go index 815b787f8..cc75a3021 100644 --- a/src/binlookup/model_three_ds_availability_request.go +++ b/src/binlookup/model_three_ds_availability_request.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSAvailabilityRequest type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *ThreeDSAvailabilityRequest) SetShopperReference(v string) { } func (o ThreeDSAvailabilityRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableThreeDSAvailabilityRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/binlookup/model_three_ds_availability_response.go b/src/binlookup/model_three_ds_availability_response.go index 01d24f411..da86880e7 100644 --- a/src/binlookup/model_three_ds_availability_response.go +++ b/src/binlookup/model_three_ds_availability_response.go @@ -10,8 +10,7 @@ package binlookup import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSAvailabilityResponse type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *ThreeDSAvailabilityResponse) SetThreeDS2supported(v bool) { } func (o ThreeDSAvailabilityResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableThreeDSAvailabilityResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/api_classic_checkout_sdk.go b/src/checkout/api_classic_checkout_sdk.go index 2121d5974..f10c5a333 100644 --- a/src/checkout/api_classic_checkout_sdk.go +++ b/src/checkout/api_classic_checkout_sdk.go @@ -10,10 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ClassicCheckoutSDKApi service @@ -21,7 +21,7 @@ type ClassicCheckoutSDKApi common.Service // All parameters accepted by ClassicCheckoutSDKApi.PaymentSession type ClassicCheckoutSDKApiPaymentSessionInput struct { - idempotencyKey *string + idempotencyKey *string paymentSetupRequest *PaymentSetupRequest } @@ -36,6 +36,7 @@ func (r ClassicCheckoutSDKApiPaymentSessionInput) PaymentSetupRequest(paymentSet return r } + /* Prepare a request for PaymentSession @@ -44,7 +45,8 @@ Prepare a request for PaymentSession Deprecated */ func (a *ClassicCheckoutSDKApi) PaymentSessionInput() ClassicCheckoutSDKApiPaymentSessionInput { - return ClassicCheckoutSDKApiPaymentSessionInput{} + return ClassicCheckoutSDKApiPaymentSessionInput{ + } } /* @@ -61,30 +63,32 @@ For more information, refer to [How it works](https://docs.adyen.com/online-paym Deprecated */ func (a *ClassicCheckoutSDKApi) PaymentSession(ctx context.Context, r ClassicCheckoutSDKApiPaymentSessionInput) (PaymentSetupResponse, *http.Response, error) { - res := &PaymentSetupResponse{} + res := &PaymentSetupResponse{} path := "/paymentSession" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentSetupRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentSetupRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ClassicCheckoutSDKApi.VerifyPaymentResult type ClassicCheckoutSDKApiVerifyPaymentResultInput struct { - idempotencyKey *string + idempotencyKey *string paymentVerificationRequest *PaymentVerificationRequest } @@ -99,6 +103,7 @@ func (r ClassicCheckoutSDKApiVerifyPaymentResultInput) PaymentVerificationReques return r } + /* Prepare a request for VerifyPaymentResult @@ -107,7 +112,8 @@ Prepare a request for VerifyPaymentResult Deprecated */ func (a *ClassicCheckoutSDKApi) VerifyPaymentResultInput() ClassicCheckoutSDKApiVerifyPaymentResultInput { - return ClassicCheckoutSDKApiVerifyPaymentResultInput{} + return ClassicCheckoutSDKApiVerifyPaymentResultInput{ + } } /* @@ -124,23 +130,25 @@ For more information, refer to [How it works](https://docs.adyen.com/online-paym Deprecated */ func (a *ClassicCheckoutSDKApi) VerifyPaymentResult(ctx context.Context, r ClassicCheckoutSDKApiVerifyPaymentResultInput) (PaymentVerificationResponse, *http.Response, error) { - res := &PaymentVerificationResponse{} + res := &PaymentVerificationResponse{} path := "/payments/result" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentVerificationRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentVerificationRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_modifications.go b/src/checkout/api_modifications.go index 0ba8623b1..31dbc3b6c 100644 --- a/src/checkout/api_modifications.go +++ b/src/checkout/api_modifications.go @@ -10,11 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ModificationsApi service @@ -22,7 +21,7 @@ type ModificationsApi common.Service // All parameters accepted by ModificationsApi.CancelAuthorisedPayment type ModificationsApiCancelAuthorisedPaymentInput struct { - idempotencyKey *string + idempotencyKey *string standalonePaymentCancelRequest *StandalonePaymentCancelRequest } @@ -37,13 +36,15 @@ func (r ModificationsApiCancelAuthorisedPaymentInput) StandalonePaymentCancelReq return r } + /* Prepare a request for CancelAuthorisedPayment @return ModificationsApiCancelAuthorisedPaymentInput */ func (a *ModificationsApi) CancelAuthorisedPaymentInput() ModificationsApiCancelAuthorisedPaymentInput { - return ModificationsApiCancelAuthorisedPaymentInput{} + return ModificationsApiCancelAuthorisedPaymentInput{ + } } /* @@ -62,31 +63,33 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @return StandalonePaymentCancelResponse, *http.Response, error */ func (a *ModificationsApi) CancelAuthorisedPayment(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentInput) (StandalonePaymentCancelResponse, *http.Response, error) { - res := &StandalonePaymentCancelResponse{} + res := &StandalonePaymentCancelResponse{} path := "/cancels" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.standalonePaymentCancelRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.standalonePaymentCancelRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.CancelAuthorisedPaymentByPspReference type ModificationsApiCancelAuthorisedPaymentByPspReferenceInput struct { - paymentPspReference string - idempotencyKey *string + paymentPspReference string + idempotencyKey *string paymentCancelRequest *PaymentCancelRequest } @@ -101,9 +104,10 @@ func (r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) PaymentCance return r } + /* Prepare a request for CancelAuthorisedPaymentByPspReference -@param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. +@param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. @return ModificationsApiCancelAuthorisedPaymentByPspReferenceInput */ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReferenceInput(paymentPspReference string) ModificationsApiCancelAuthorisedPaymentByPspReferenceInput { @@ -128,32 +132,34 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @return PaymentCancelResponse, *http.Response, error */ func (a *ModificationsApi) CancelAuthorisedPaymentByPspReference(ctx context.Context, r ModificationsApiCancelAuthorisedPaymentByPspReferenceInput) (PaymentCancelResponse, *http.Response, error) { - res := &PaymentCancelResponse{} + res := &PaymentCancelResponse{} path := "/payments/{paymentPspReference}/cancels" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentCancelRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentCancelRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.CaptureAuthorisedPayment type ModificationsApiCaptureAuthorisedPaymentInput struct { - paymentPspReference string - idempotencyKey *string + paymentPspReference string + idempotencyKey *string paymentCaptureRequest *PaymentCaptureRequest } @@ -168,6 +174,7 @@ func (r ModificationsApiCaptureAuthorisedPaymentInput) PaymentCaptureRequest(pay return r } + /* Prepare a request for CaptureAuthorisedPayment @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. @@ -184,7 +191,7 @@ CaptureAuthorisedPayment Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). -You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. +You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. @@ -195,32 +202,34 @@ For more information, refer to [Capture](https://docs.adyen.com/online-payments/ @return PaymentCaptureResponse, *http.Response, error */ func (a *ModificationsApi) CaptureAuthorisedPayment(ctx context.Context, r ModificationsApiCaptureAuthorisedPaymentInput) (PaymentCaptureResponse, *http.Response, error) { - res := &PaymentCaptureResponse{} + res := &PaymentCaptureResponse{} path := "/payments/{paymentPspReference}/captures" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentCaptureRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentCaptureRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.RefundCapturedPayment type ModificationsApiRefundCapturedPaymentInput struct { - paymentPspReference string - idempotencyKey *string + paymentPspReference string + idempotencyKey *string paymentRefundRequest *PaymentRefundRequest } @@ -235,6 +244,7 @@ func (r ModificationsApiRefundCapturedPaymentInput) PaymentRefundRequest(payment return r } + /* Prepare a request for RefundCapturedPayment @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. @@ -253,7 +263,7 @@ Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/# You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. -> Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). +> Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. @@ -264,32 +274,34 @@ For more information, refer to [Refund](https://docs.adyen.com/online-payments/r @return PaymentRefundResponse, *http.Response, error */ func (a *ModificationsApi) RefundCapturedPayment(ctx context.Context, r ModificationsApiRefundCapturedPaymentInput) (PaymentRefundResponse, *http.Response, error) { - res := &PaymentRefundResponse{} + res := &PaymentRefundResponse{} path := "/payments/{paymentPspReference}/refunds" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentRefundRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRefundRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.RefundOrCancelPayment type ModificationsApiRefundOrCancelPaymentInput struct { - paymentPspReference string - idempotencyKey *string + paymentPspReference string + idempotencyKey *string paymentReversalRequest *PaymentReversalRequest } @@ -304,9 +316,10 @@ func (r ModificationsApiRefundOrCancelPaymentInput) PaymentReversalRequest(payme return r } + /* Prepare a request for RefundOrCancelPayment -@param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. +@param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. @return ModificationsApiRefundOrCancelPaymentInput */ func (a *ModificationsApi) RefundOrCancelPaymentInput(paymentPspReference string) ModificationsApiRefundOrCancelPaymentInput { @@ -330,32 +343,34 @@ For more information, refer to [Reversal](https://docs.adyen.com/online-payments @return PaymentReversalResponse, *http.Response, error */ func (a *ModificationsApi) RefundOrCancelPayment(ctx context.Context, r ModificationsApiRefundOrCancelPaymentInput) (PaymentReversalResponse, *http.Response, error) { - res := &PaymentReversalResponse{} + res := &PaymentReversalResponse{} path := "/payments/{paymentPspReference}/reversals" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentReversalRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentReversalRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.UpdateAuthorisedAmount type ModificationsApiUpdateAuthorisedAmountInput struct { - paymentPspReference string - idempotencyKey *string + paymentPspReference string + idempotencyKey *string paymentAmountUpdateRequest *PaymentAmountUpdateRequest } @@ -370,6 +385,7 @@ func (r ModificationsApiUpdateAuthorisedAmountInput) PaymentAmountUpdateRequest( return r } + /* Prepare a request for UpdateAuthorisedAmount @param paymentPspReference The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. @@ -397,24 +413,26 @@ For more information, refer to [Authorisation adjustment](https://docs.adyen.com @return PaymentAmountUpdateResponse, *http.Response, error */ func (a *ModificationsApi) UpdateAuthorisedAmount(ctx context.Context, r ModificationsApiUpdateAuthorisedAmountInput) (PaymentAmountUpdateResponse, *http.Response, error) { - res := &PaymentAmountUpdateResponse{} + res := &PaymentAmountUpdateResponse{} path := "/payments/{paymentPspReference}/amountUpdates" - path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentAmountUpdateRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"paymentPspReference"+"}", url.PathEscape(common.ParameterValueToString(r.paymentPspReference, "paymentPspReference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentAmountUpdateRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_orders.go b/src/checkout/api_orders.go index 5c2cf9ead..99e14d2a5 100644 --- a/src/checkout/api_orders.go +++ b/src/checkout/api_orders.go @@ -10,10 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // OrdersApi service @@ -21,7 +21,7 @@ type OrdersApi common.Service // All parameters accepted by OrdersApi.CancelOrder type OrdersApiCancelOrderInput struct { - idempotencyKey *string + idempotencyKey *string cancelOrderRequest *CancelOrderRequest } @@ -36,13 +36,15 @@ func (r OrdersApiCancelOrderInput) CancelOrderRequest(cancelOrderRequest CancelO return r } + /* Prepare a request for CancelOrder @return OrdersApiCancelOrderInput */ func (a *OrdersApi) CancelOrderInput() OrdersApiCancelOrderInput { - return OrdersApiCancelOrderInput{} + return OrdersApiCancelOrderInput{ + } } /* @@ -55,30 +57,32 @@ Cancels an order. Cancellation of an order results in an automatic rollback of a @return CancelOrderResponse, *http.Response, error */ func (a *OrdersApi) CancelOrder(ctx context.Context, r OrdersApiCancelOrderInput) (CancelOrderResponse, *http.Response, error) { - res := &CancelOrderResponse{} + res := &CancelOrderResponse{} path := "/orders/cancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.cancelOrderRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.cancelOrderRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by OrdersApi.GetBalanceOfGiftCard type OrdersApiGetBalanceOfGiftCardInput struct { - idempotencyKey *string + idempotencyKey *string balanceCheckRequest *BalanceCheckRequest } @@ -93,13 +97,15 @@ func (r OrdersApiGetBalanceOfGiftCardInput) BalanceCheckRequest(balanceCheckRequ return r } + /* Prepare a request for GetBalanceOfGiftCard @return OrdersApiGetBalanceOfGiftCardInput */ func (a *OrdersApi) GetBalanceOfGiftCardInput() OrdersApiGetBalanceOfGiftCardInput { - return OrdersApiGetBalanceOfGiftCardInput{} + return OrdersApiGetBalanceOfGiftCardInput{ + } } /* @@ -112,30 +118,32 @@ Retrieves the balance remaining on a shopper's gift card. To check a gift card's @return BalanceCheckResponse, *http.Response, error */ func (a *OrdersApi) GetBalanceOfGiftCard(ctx context.Context, r OrdersApiGetBalanceOfGiftCardInput) (BalanceCheckResponse, *http.Response, error) { - res := &BalanceCheckResponse{} + res := &BalanceCheckResponse{} path := "/paymentMethods/balance" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.balanceCheckRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.balanceCheckRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by OrdersApi.Orders type OrdersApiOrdersInput struct { - idempotencyKey *string + idempotencyKey *string createOrderRequest *CreateOrderRequest } @@ -150,13 +158,15 @@ func (r OrdersApiOrdersInput) CreateOrderRequest(createOrderRequest CreateOrderR return r } + /* Prepare a request for Orders @return OrdersApiOrdersInput */ func (a *OrdersApi) OrdersInput() OrdersApiOrdersInput { - return OrdersApiOrdersInput{} + return OrdersApiOrdersInput{ + } } /* @@ -169,23 +179,25 @@ Creates an order to be used for partial payments. Make a POST `/orders` call bef @return CreateOrderResponse, *http.Response, error */ func (a *OrdersApi) Orders(ctx context.Context, r OrdersApiOrdersInput) (CreateOrderResponse, *http.Response, error) { - res := &CreateOrderResponse{} + res := &CreateOrderResponse{} path := "/orders" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createOrderRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createOrderRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_payment_links.go b/src/checkout/api_payment_links.go index e3a75537b..8df428991 100644 --- a/src/checkout/api_payment_links.go +++ b/src/checkout/api_payment_links.go @@ -10,11 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentLinksApi service @@ -25,6 +24,7 @@ type PaymentLinksApiGetPaymentLinkInput struct { linkId string } + /* Prepare a request for GetPaymentLink @param linkId Unique identifier of the payment link. @@ -46,28 +46,30 @@ Retrieves the payment link details using the payment link `id`. @return PaymentLinkResponse, *http.Response, error */ func (a *PaymentLinksApi) GetPaymentLink(ctx context.Context, r PaymentLinksApiGetPaymentLinkInput) (PaymentLinkResponse, *http.Response, error) { - res := &PaymentLinkResponse{} + res := &PaymentLinkResponse{} path := "/paymentLinks/{linkId}" - path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentLinksApi.PaymentLinks type PaymentLinksApiPaymentLinksInput struct { - idempotencyKey *string + idempotencyKey *string paymentLinkRequest *PaymentLinkRequest } @@ -82,13 +84,15 @@ func (r PaymentLinksApiPaymentLinksInput) PaymentLinkRequest(paymentLinkRequest return r } + /* Prepare a request for PaymentLinks @return PaymentLinksApiPaymentLinksInput */ func (a *PaymentLinksApi) PaymentLinksInput() PaymentLinksApiPaymentLinksInput { - return PaymentLinksApiPaymentLinksInput{} + return PaymentLinksApiPaymentLinksInput{ + } } /* @@ -103,30 +107,32 @@ For more information, refer to [Pay by Link documentation](https://docs.adyen.co @return PaymentLinkResponse, *http.Response, error */ func (a *PaymentLinksApi) PaymentLinks(ctx context.Context, r PaymentLinksApiPaymentLinksInput) (PaymentLinkResponse, *http.Response, error) { - res := &PaymentLinkResponse{} + res := &PaymentLinkResponse{} path := "/paymentLinks" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentLinkRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentLinkRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentLinksApi.UpdatePaymentLink type PaymentLinksApiUpdatePaymentLinkInput struct { - linkId string + linkId string updatePaymentLinkRequest *UpdatePaymentLinkRequest } @@ -135,6 +141,7 @@ func (r PaymentLinksApiUpdatePaymentLinkInput) UpdatePaymentLinkRequest(updatePa return r } + /* Prepare a request for UpdatePaymentLink @param linkId Unique identifier of the payment link. @@ -156,21 +163,23 @@ Updates the status of a payment link. Use this endpoint to [force the expiry of @return PaymentLinkResponse, *http.Response, error */ func (a *PaymentLinksApi) UpdatePaymentLink(ctx context.Context, r PaymentLinksApiUpdatePaymentLinkInput) (PaymentLinkResponse, *http.Response, error) { - res := &PaymentLinkResponse{} + res := &PaymentLinkResponse{} path := "/paymentLinks/{linkId}" - path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updatePaymentLinkRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"linkId"+"}", url.PathEscape(common.ParameterValueToString(r.linkId, "linkId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updatePaymentLinkRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_payments.go b/src/checkout/api_payments.go index 52a0ece58..284a7c9c3 100644 --- a/src/checkout/api_payments.go +++ b/src/checkout/api_payments.go @@ -10,11 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentsApi service @@ -22,7 +21,7 @@ type PaymentsApi common.Service // All parameters accepted by PaymentsApi.CardDetails type PaymentsApiCardDetailsInput struct { - idempotencyKey *string + idempotencyKey *string cardDetailsRequest *CardDetailsRequest } @@ -37,13 +36,15 @@ func (r PaymentsApiCardDetailsInput) CardDetailsRequest(cardDetailsRequest CardD return r } + /* Prepare a request for CardDetails @return PaymentsApiCardDetailsInput */ func (a *PaymentsApi) CardDetailsInput() PaymentsApiCardDetailsInput { - return PaymentsApiCardDetailsInput{} + return PaymentsApiCardDetailsInput{ + } } /* @@ -60,30 +61,32 @@ If you have an API-only integration and collect card data, use this endpoint to @return CardDetailsResponse, *http.Response, error */ func (a *PaymentsApi) CardDetails(ctx context.Context, r PaymentsApiCardDetailsInput) (CardDetailsResponse, *http.Response, error) { - res := &CardDetailsResponse{} + res := &CardDetailsResponse{} path := "/cardDetails" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.cardDetailsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.cardDetailsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) - return *res, httpRes, err + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Donations type PaymentsApiDonationsInput struct { - idempotencyKey *string + idempotencyKey *string donationPaymentRequest *DonationPaymentRequest } @@ -98,13 +101,15 @@ func (r PaymentsApiDonationsInput) DonationPaymentRequest(donationPaymentRequest return r } + /* Prepare a request for Donations @return PaymentsApiDonationsInput */ func (a *PaymentsApi) DonationsInput() PaymentsApiDonationsInput { - return PaymentsApiDonationsInput{} + return PaymentsApiDonationsInput{ + } } /* @@ -119,30 +124,32 @@ For more information, see [Donations](https://docs.adyen.com/online-payments/don @return DonationPaymentResponse, *http.Response, error */ func (a *PaymentsApi) Donations(ctx context.Context, r PaymentsApiDonationsInput) (DonationPaymentResponse, *http.Response, error) { - res := &DonationPaymentResponse{} + res := &DonationPaymentResponse{} path := "/donations" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.donationPaymentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.donationPaymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + - return *res, httpRes, err + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.GetResultOfPaymentSession type PaymentsApiGetResultOfPaymentSessionInput struct { - sessionId string + sessionId string sessionResult *string } @@ -152,6 +159,7 @@ func (r PaymentsApiGetResultOfPaymentSessionInput) SessionResult(sessionResult s return r } + /* Prepare a request for GetResultOfPaymentSession @param sessionId A unique identifier of the session. @@ -173,31 +181,33 @@ Returns the status of the payment session with the `sessionId` and `sessionResul @return SessionResultResponse, *http.Response, error */ func (a *PaymentsApi) GetResultOfPaymentSession(ctx context.Context, r PaymentsApiGetResultOfPaymentSessionInput) (SessionResultResponse, *http.Response, error) { - res := &SessionResultResponse{} + res := &SessionResultResponse{} path := "/sessions/{sessionId}" - path = strings.Replace(path, "{"+"sessionId"+"}", url.PathEscape(common.ParameterValueToString(r.sessionId, "sessionId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.sessionResult != nil { - common.ParameterAddToQuery(queryParams, "sessionResult", r.sessionResult, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) + path = strings.Replace(path, "{"+"sessionId"+"}", url.PathEscape(common.ParameterValueToString(r.sessionId, "sessionId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.sessionResult != nil { + common.ParameterAddToQuery(queryParams, "sessionResult", r.sessionResult, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) - return *res, httpRes, err + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.PaymentMethods type PaymentsApiPaymentMethodsInput struct { - idempotencyKey *string + idempotencyKey *string paymentMethodsRequest *PaymentMethodsRequest } @@ -212,13 +222,15 @@ func (r PaymentsApiPaymentMethodsInput) PaymentMethodsRequest(paymentMethodsRequ return r } + /* Prepare a request for PaymentMethods @return PaymentsApiPaymentMethodsInput */ func (a *PaymentsApi) PaymentMethodsInput() PaymentsApiPaymentMethodsInput { - return PaymentsApiPaymentMethodsInput{} + return PaymentsApiPaymentMethodsInput{ + } } /* @@ -233,27 +245,29 @@ Although we highly recommend using this endpoint to ensure you are always offeri @return PaymentMethodsResponse, *http.Response, error */ func (a *PaymentsApi) PaymentMethods(ctx context.Context, r PaymentsApiPaymentMethodsInput) (PaymentMethodsResponse, *http.Response, error) { - res := &PaymentMethodsResponse{} + res := &PaymentMethodsResponse{} path := "/paymentMethods" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentMethodsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentMethodsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + - return *res, httpRes, err + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Payments type PaymentsApiPaymentsInput struct { idempotencyKey *string @@ -271,52 +285,56 @@ func (r PaymentsApiPaymentsInput) PaymentRequest(paymentRequest PaymentRequest) return r } + /* Prepare a request for Payments @return PaymentsApiPaymentsInput */ func (a *PaymentsApi) PaymentsInput() PaymentsApiPaymentsInput { - return PaymentsApiPaymentsInput{} + return PaymentsApiPaymentsInput{ + } } /* Payments Start a transaction -Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). +Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): -* For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. -* For a redirect or additional action, the response contains an `action` object. +* For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. +* For a redirect or additional action, the response contains an `action` object. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PaymentsApiPaymentsInput - Request parameters, see PaymentsInput @return PaymentResponse, *http.Response, error */ func (a *PaymentsApi) Payments(ctx context.Context, r PaymentsApiPaymentsInput) (PaymentResponse, *http.Response, error) { - res := &PaymentResponse{} + res := &PaymentResponse{} path := "/payments" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + - return *res, httpRes, err + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.PaymentsDetails type PaymentsApiPaymentsDetailsInput struct { - idempotencyKey *string + idempotencyKey *string paymentDetailsRequest *PaymentDetailsRequest } @@ -331,13 +349,15 @@ func (r PaymentsApiPaymentsDetailsInput) PaymentDetailsRequest(paymentDetailsReq return r } + /* Prepare a request for PaymentsDetails @return PaymentsApiPaymentsDetailsInput */ func (a *PaymentsApi) PaymentsDetailsInput() PaymentsApiPaymentsDetailsInput { - return PaymentsApiPaymentsDetailsInput{} + return PaymentsApiPaymentsDetailsInput{ + } } /* @@ -352,30 +372,32 @@ Submits details for a payment created using `/payments`. This step is only neede @return PaymentDetailsResponse, *http.Response, error */ func (a *PaymentsApi) PaymentsDetails(ctx context.Context, r PaymentsApiPaymentsDetailsInput) (PaymentDetailsResponse, *http.Response, error) { - res := &PaymentDetailsResponse{} + res := &PaymentDetailsResponse{} path := "/payments/details" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentDetailsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentDetailsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + - return *res, httpRes, err + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Sessions type PaymentsApiSessionsInput struct { - idempotencyKey *string + idempotencyKey *string createCheckoutSessionRequest *CreateCheckoutSessionRequest } @@ -390,13 +412,15 @@ func (r PaymentsApiSessionsInput) CreateCheckoutSessionRequest(createCheckoutSes return r } + /* Prepare a request for Sessions @return PaymentsApiSessionsInput */ func (a *PaymentsApi) SessionsInput() PaymentsApiSessionsInput { - return PaymentsApiSessionsInput{} + return PaymentsApiSessionsInput{ + } } /* @@ -413,23 +437,25 @@ You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.a @return CreateCheckoutSessionResponse, *http.Response, error */ func (a *PaymentsApi) Sessions(ctx context.Context, r PaymentsApiSessionsInput) (CreateCheckoutSessionResponse, *http.Response, error) { - res := &CreateCheckoutSessionResponse{} + res := &CreateCheckoutSessionResponse{} path := "/sessions" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createCheckoutSessionRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createCheckoutSessionRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_recurring.go b/src/checkout/api_recurring.go index 56df4ec1c..fae3d27a0 100644 --- a/src/checkout/api_recurring.go +++ b/src/checkout/api_recurring.go @@ -10,11 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // RecurringApi service @@ -23,8 +22,8 @@ type RecurringApi common.Service // All parameters accepted by RecurringApi.DeleteTokenForStoredPaymentDetails type RecurringApiDeleteTokenForStoredPaymentDetailsInput struct { storedPaymentMethodId string - shopperReference *string - merchantAccount *string + shopperReference *string + merchantAccount *string } // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -39,6 +38,7 @@ func (r RecurringApiDeleteTokenForStoredPaymentDetailsInput) MerchantAccount(mer return r } + /* Prepare a request for DeleteTokenForStoredPaymentDetails @param storedPaymentMethodId The unique identifier of the token. @@ -60,35 +60,37 @@ Deletes the token identified in the path. The token can no longer be used with p @return *http.Response, error */ func (a *RecurringApi) DeleteTokenForStoredPaymentDetails(ctx context.Context, r RecurringApiDeleteTokenForStoredPaymentDetailsInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/storedPaymentMethods/{storedPaymentMethodId}" - path = strings.Replace(path, "{"+"storedPaymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.storedPaymentMethodId, "storedPaymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.shopperReference != nil { - common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") - } - if r.merchantAccount != nil { - common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return httpRes, err + path = strings.Replace(path, "{"+"storedPaymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.storedPaymentMethodId, "storedPaymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.shopperReference != nil { + common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") + } + if r.merchantAccount != nil { + common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return httpRes, err } + // All parameters accepted by RecurringApi.GetTokensForStoredPaymentDetails type RecurringApiGetTokensForStoredPaymentDetailsInput struct { shopperReference *string - merchantAccount *string + merchantAccount *string } // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -103,13 +105,15 @@ func (r RecurringApiGetTokensForStoredPaymentDetailsInput) MerchantAccount(merch return r } + /* Prepare a request for GetTokensForStoredPaymentDetails @return RecurringApiGetTokensForStoredPaymentDetailsInput */ func (a *RecurringApi) GetTokensForStoredPaymentDetailsInput() RecurringApiGetTokensForStoredPaymentDetailsInput { - return RecurringApiGetTokensForStoredPaymentDetailsInput{} + return RecurringApiGetTokensForStoredPaymentDetailsInput{ + } } /* @@ -124,26 +128,28 @@ Lists the tokens for stored payment details for the shopper identified in the pa @return ListStoredPaymentMethodsResponse, *http.Response, error */ func (a *RecurringApi) GetTokensForStoredPaymentDetails(ctx context.Context, r RecurringApiGetTokensForStoredPaymentDetailsInput) (ListStoredPaymentMethodsResponse, *http.Response, error) { - res := &ListStoredPaymentMethodsResponse{} + res := &ListStoredPaymentMethodsResponse{} path := "/storedPaymentMethods" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.shopperReference != nil { - common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") - } - if r.merchantAccount != nil { - common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.shopperReference != nil { + common.ParameterAddToQuery(queryParams, "shopperReference", r.shopperReference, "") + } + if r.merchantAccount != nil { + common.ParameterAddToQuery(queryParams, "merchantAccount", r.merchantAccount, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/api_utility.go b/src/checkout/api_utility.go index 4cd036b82..3ca576ac9 100644 --- a/src/checkout/api_utility.go +++ b/src/checkout/api_utility.go @@ -10,10 +10,10 @@ package checkout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // UtilityApi service @@ -21,7 +21,7 @@ type UtilityApi common.Service // All parameters accepted by UtilityApi.GetApplePaySession type UtilityApiGetApplePaySessionInput struct { - idempotencyKey *string + idempotencyKey *string applePaySessionRequest *ApplePaySessionRequest } @@ -36,13 +36,15 @@ func (r UtilityApiGetApplePaySessionInput) ApplePaySessionRequest(applePaySessio return r } + /* Prepare a request for GetApplePaySession @return UtilityApiGetApplePaySessionInput */ func (a *UtilityApi) GetApplePaySessionInput() UtilityApiGetApplePaySessionInput { - return UtilityApiGetApplePaySessionInput{} + return UtilityApiGetApplePaySessionInput{ + } } /* @@ -57,27 +59,29 @@ The endpoint returns the Apple Pay session data which you need to complete the [ @return ApplePaySessionResponse, *http.Response, error */ func (a *UtilityApi) GetApplePaySession(ctx context.Context, r UtilityApiGetApplePaySessionInput) (ApplePaySessionResponse, *http.Response, error) { - res := &ApplePaySessionResponse{} + res := &ApplePaySessionResponse{} path := "/applePay/sessions" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.applePaySessionRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.applePaySessionRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by UtilityApi.OriginKeys type UtilityApiOriginKeysInput struct { idempotencyKey *string @@ -95,6 +99,7 @@ func (r UtilityApiOriginKeysInput) UtilityRequest(utilityRequest UtilityRequest) return r } + /* Prepare a request for OriginKeys @@ -103,14 +108,15 @@ Prepare a request for OriginKeys Deprecated */ func (a *UtilityApi) OriginKeysInput() UtilityApiOriginKeysInput { - return UtilityApiOriginKeysInput{} + return UtilityApiOriginKeysInput{ + } } /* OriginKeys Create originKey values for domains -This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. -> If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. +This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. +> If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r UtilityApiOriginKeysInput - Request parameters, see OriginKeysInput @@ -119,23 +125,25 @@ This operation takes the origin domains and returns a JSON object containing the Deprecated */ func (a *UtilityApi) OriginKeys(ctx context.Context, r UtilityApiOriginKeysInput) (UtilityResponse, *http.Response, error) { - res := &UtilityResponse{} + res := &UtilityResponse{} path := "/originKeys" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.idempotencyKey != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.utilityRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.idempotencyKey != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "Idempotency-Key", r.idempotencyKey, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.utilityRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/checkout/model_account_info.go b/src/checkout/model_account_info.go index bb6a6052a..e9663ee5e 100644 --- a/src/checkout/model_account_info.go +++ b/src/checkout/model_account_info.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountInfo type satisfies the MappedNullable interface at compile time @@ -698,7 +697,7 @@ func (o *AccountInfo) SetWorkPhone(v string) { } func (o AccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -803,57 +802,59 @@ func (v *NullableAccountInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountInfo) isValidAccountAgeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountAgeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountAgeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountChangeIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountType() bool { - var allowedEnumValues = []string{"notApplicable", "credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidDeliveryAddressUsageIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressUsageIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressUsageIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPasswordChangeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPasswordChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPasswordChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPaymentAccountIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccountIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccountIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_acct_info.go b/src/checkout/model_acct_info.go index f46063160..6d5ac322f 100644 --- a/src/checkout/model_acct_info.go +++ b/src/checkout/model_acct_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcctInfo type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AcctInfo) SetTxnActivityYear(v string) { } func (o AcctInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,66 +678,68 @@ func (v *NullableAcctInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcctInfo) isValidChAccAgeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccAgeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccAgeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetChAccChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetChAccChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccPwChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccPwChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccPwChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidPaymentAccInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipAddressUsageInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetShipAddressUsageInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetShipAddressUsageInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipNameIndicator() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetShipNameIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetShipNameIndicator() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidSuspiciousAccActivity() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetSuspiciousAccActivity() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetSuspiciousAccActivity() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_ach_details.go b/src/checkout/model_ach_details.go index 975102435..cfd5f1459 100644 --- a/src/checkout/model_ach_details.go +++ b/src/checkout/model_ach_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AchDetails type satisfies the MappedNullable interface at compile time @@ -380,7 +379,7 @@ func (o *AchDetails) SetType(v string) { } func (o AchDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,21 +455,23 @@ func (v *NullableAchDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AchDetails) isValidBankAccountType() bool { - var allowedEnumValues = []string{"balance", "checking", "deposit", "general", "other", "payment", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetBankAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "balance", "checking", "deposit", "general", "other", "payment", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetBankAccountType() == allowed { + return true + } + } + return false } func (o *AchDetails) isValidType() bool { - var allowedEnumValues = []string{"ach", "ach_plaid"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ach", "ach_plaid" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data3_d_secure.go b/src/checkout/model_additional_data3_d_secure.go index f8bce927b..19550030f 100644 --- a/src/checkout/model_additional_data3_d_secure.go +++ b/src/checkout/model_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,19 +18,19 @@ var _ common.MappedNullable = &AdditionalData3DSecure{} // AdditionalData3DSecure struct for AdditionalData3DSecure type AdditionalData3DSecure struct { - // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. // Deprecated Allow3DS2 *string `json:"allow3DS2,omitempty"` // Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen ChallengeWindowSize *string `json:"challengeWindowSize,omitempty"` - // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. // Deprecated ExecuteThreeD *string `json:"executeThreeD,omitempty"` // In case of Secure+, this field must be set to **CUPSecurePlus**. MpiImplementationType *string `json:"mpiImplementationType,omitempty"` - // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemption *string `json:"scaExemption,omitempty"` - // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. ThreeDSVersion *string `json:"threeDSVersion,omitempty"` } @@ -251,7 +250,7 @@ func (o *AdditionalData3DSecure) SetThreeDSVersion(v string) { } func (o AdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -317,12 +316,14 @@ func (v *NullableAdditionalData3DSecure) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalData3DSecure) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data_airline.go b/src/checkout/model_additional_data_airline.go index 924ae2619..ffd96e872 100644 --- a/src/checkout/model_additional_data_airline.go +++ b/src/checkout/model_additional_data_airline.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataAirline type satisfies the MappedNullable interface at compile time @@ -984,7 +983,7 @@ func (o *AdditionalDataAirline) SetAirlineTravelAgencyName(v string) { } func (o AdditionalDataAirline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1113,3 +1112,6 @@ func (v *NullableAdditionalDataAirline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_car_rental.go b/src/checkout/model_additional_data_car_rental.go index 373067011..b0ef90b9e 100644 --- a/src/checkout/model_additional_data_car_rental.go +++ b/src/checkout/model_additional_data_car_rental.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataCarRental type satisfies the MappedNullable interface at compile time @@ -821,7 +820,7 @@ func (o *AdditionalDataCarRental) SetTravelEntertainmentAuthDataMarket(v string) } func (o AdditionalDataCarRental) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -937,3 +936,6 @@ func (v *NullableAdditionalDataCarRental) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_common.go b/src/checkout/model_additional_data_common.go index 5394abc2d..e37f24921 100644 --- a/src/checkout/model_additional_data_common.go +++ b/src/checkout/model_additional_data_common.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataCommon) SetSubMerchantTaxId(v string) { } func (o AdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,12 +678,14 @@ func (v *NullableAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalDataCommon) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"NoShow", "DelayedCharge"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NoShow", "DelayedCharge" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_additional_data_level23.go b/src/checkout/model_additional_data_level23.go index c1e7a7883..1e6750a12 100644 --- a/src/checkout/model_additional_data_level23.go +++ b/src/checkout/model_additional_data_level23.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataLevel23 type satisfies the MappedNullable interface at compile time @@ -39,7 +38,7 @@ type AdditionalDataLevel23 struct { EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` // The product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces + // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` @@ -617,7 +616,7 @@ func (o *AdditionalDataLevel23) SetEnhancedSchemeDataTotalTaxAmount(v string) { } func (o AdditionalDataLevel23) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableAdditionalDataLevel23) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_lodging.go b/src/checkout/model_additional_data_lodging.go index 1f55813d2..7356bad57 100644 --- a/src/checkout/model_additional_data_lodging.go +++ b/src/checkout/model_additional_data_lodging.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataLodging type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataLodging) SetTravelEntertainmentAuthDataMarket(v string) { } func (o AdditionalDataLodging) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -678,3 +677,6 @@ func (v *NullableAdditionalDataLodging) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_open_invoice.go b/src/checkout/model_additional_data_open_invoice.go index 0969e35a2..a05b78e80 100644 --- a/src/checkout/model_additional_data_open_invoice.go +++ b/src/checkout/model_additional_data_open_invoice.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataOpenInvoice type satisfies the MappedNullable interface at compile time @@ -651,7 +650,7 @@ func (o *AdditionalDataOpenInvoice) SetOpeninvoicedataLineItemNrTrackingUri(v st } func (o AdditionalDataOpenInvoice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -752,3 +751,6 @@ func (v *NullableAdditionalDataOpenInvoice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_opi.go b/src/checkout/model_additional_data_opi.go index 7c4575ce6..d90d1d987 100644 --- a/src/checkout/model_additional_data_opi.go +++ b/src/checkout/model_additional_data_opi.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataOpi) SetOpiIncludeTransToken(v string) { } func (o AdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_ratepay.go b/src/checkout/model_additional_data_ratepay.go index 22017a538..eb676a433 100644 --- a/src/checkout/model_additional_data_ratepay.go +++ b/src/checkout/model_additional_data_ratepay.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRatepay type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *AdditionalDataRatepay) SetRatepaydataInvoiceId(v string) { } func (o AdditionalDataRatepay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableAdditionalDataRatepay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_retry.go b/src/checkout/model_additional_data_retry.go index 123f549e2..557b4a86e 100644 --- a/src/checkout/model_additional_data_retry.go +++ b/src/checkout/model_additional_data_retry.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRetry type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalDataRetry) SetRetrySkipRetry(v string) { } func (o AdditionalDataRetry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalDataRetry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_risk.go b/src/checkout/model_additional_data_risk.go index 05a7c7315..e7fcb8c26 100644 --- a/src/checkout/model_additional_data_risk.go +++ b/src/checkout/model_additional_data_risk.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRisk type satisfies the MappedNullable interface at compile time @@ -753,7 +752,7 @@ func (o *AdditionalDataRisk) SetRiskdataSkipRisk(v string) { } func (o AdditionalDataRisk) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,3 +862,6 @@ func (v *NullableAdditionalDataRisk) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_risk_standalone.go b/src/checkout/model_additional_data_risk_standalone.go index a7ef7a042..b355e31ae 100644 --- a/src/checkout/model_additional_data_risk_standalone.go +++ b/src/checkout/model_additional_data_risk_standalone.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRiskStandalone type satisfies the MappedNullable interface at compile time @@ -549,7 +548,7 @@ func (o *AdditionalDataRiskStandalone) SetTokenDataType(v string) { } func (o AdditionalDataRiskStandalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,3 +640,6 @@ func (v *NullableAdditionalDataRiskStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_sub_merchant.go b/src/checkout/model_additional_data_sub_merchant.go index 059bece54..b28f30085 100644 --- a/src/checkout/model_additional_data_sub_merchant.go +++ b/src/checkout/model_additional_data_sub_merchant.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataSubMerchant type satisfies the MappedNullable interface at compile time @@ -379,7 +378,7 @@ func (o *AdditionalDataSubMerchant) SetSubMerchantSubSellerSubSellerNrTaxId(v st } func (o AdditionalDataSubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,3 +455,6 @@ func (v *NullableAdditionalDataSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_temporary_services.go b/src/checkout/model_additional_data_temporary_services.go index bb80d7255..bb5309423 100644 --- a/src/checkout/model_additional_data_temporary_services.go +++ b/src/checkout/model_additional_data_temporary_services.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataTemporaryServices type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *AdditionalDataTemporaryServices) SetEnhancedSchemeDataTotalTaxAmount(v } func (o AdditionalDataTemporaryServices) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableAdditionalDataTemporaryServices) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_additional_data_wallets.go b/src/checkout/model_additional_data_wallets.go index b7d4a79f4..d536f0f13 100644 --- a/src/checkout/model_additional_data_wallets.go +++ b/src/checkout/model_additional_data_wallets.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataWallets type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *AdditionalDataWallets) SetVisacheckoutCallId(v string) { } func (o AdditionalDataWallets) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableAdditionalDataWallets) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_address.go b/src/checkout/model_address.go index 33d8e7c42..a70e53283 100644 --- a/src/checkout/model_address.go +++ b/src/checkout/model_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_afterpay_details.go b/src/checkout/model_afterpay_details.go index d07076182..29ea66b58 100644 --- a/src/checkout/model_afterpay_details.go +++ b/src/checkout/model_afterpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AfterpayDetails type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *AfterpayDetails) SetType(v string) { } func (o AfterpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -343,12 +342,14 @@ func (v *NullableAfterpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AfterpayDetails) isValidType() bool { - var allowedEnumValues = []string{"afterpay_default", "afterpaytouch", "afterpay_b2b", "clearpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "afterpay_default", "afterpaytouch", "afterpay_b2b", "clearpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_amazon_pay_details.go b/src/checkout/model_amazon_pay_details.go index 35c24c009..04b8dd8b4 100644 --- a/src/checkout/model_amazon_pay_details.go +++ b/src/checkout/model_amazon_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AmazonPayDetails type satisfies the MappedNullable interface at compile time @@ -179,7 +178,7 @@ func (o *AmazonPayDetails) SetType(v string) { } func (o AmazonPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,12 +238,14 @@ func (v *NullableAmazonPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AmazonPayDetails) isValidType() bool { - var allowedEnumValues = []string{"amazonpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amazonpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_amount.go b/src/checkout/model_amount.go index 14259071d..3c0d135cb 100644 --- a/src/checkout/model_amount.go +++ b/src/checkout/model_amount.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_android_pay_details.go b/src/checkout/model_android_pay_details.go index 6a984cae4..548310441 100644 --- a/src/checkout/model_android_pay_details.go +++ b/src/checkout/model_android_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AndroidPayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *AndroidPayDetails) SetType(v string) { } func (o AndroidPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableAndroidPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AndroidPayDetails) isValidType() bool { - var allowedEnumValues = []string{"androidpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "androidpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_apple_pay_details.go b/src/checkout/model_apple_pay_details.go index 560b38cae..256ea7f28 100644 --- a/src/checkout/model_apple_pay_details.go +++ b/src/checkout/model_apple_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplePayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *ApplePayDetails) SetType(v string) { } func (o ApplePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableApplePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ApplePayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *ApplePayDetails) isValidType() bool { - var allowedEnumValues = []string{"applepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "applepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_apple_pay_session_request.go b/src/checkout/model_apple_pay_session_request.go index 5ba08d959..2ce84306f 100644 --- a/src/checkout/model_apple_pay_session_request.go +++ b/src/checkout/model_apple_pay_session_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplePaySessionRequest type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *ApplePaySessionRequest) SetMerchantIdentifier(v string) { } func (o ApplePaySessionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableApplePaySessionRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_apple_pay_session_response.go b/src/checkout/model_apple_pay_session_response.go index 5e7e07f7b..d8cbcbd0e 100644 --- a/src/checkout/model_apple_pay_session_response.go +++ b/src/checkout/model_apple_pay_session_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplePaySessionResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *ApplePaySessionResponse) SetData(v string) { } func (o ApplePaySessionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableApplePaySessionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_application_info.go b/src/checkout/model_application_info.go index f02577148..1959634ef 100644 --- a/src/checkout/model_application_info.go +++ b/src/checkout/model_application_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplicationInfo type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &ApplicationInfo{} // ApplicationInfo struct for ApplicationInfo type ApplicationInfo struct { - AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` - AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` - ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` - MerchantApplication *CommonField `json:"merchantApplication,omitempty"` - MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` + AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` + AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` + ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` + MerchantApplication *CommonField `json:"merchantApplication,omitempty"` + MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` ShopperInteractionDevice *ShopperInteractionDevice `json:"shopperInteractionDevice,omitempty"` } @@ -237,7 +236,7 @@ func (o *ApplicationInfo) SetShopperInteractionDevice(v ShopperInteractionDevice } func (o ApplicationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableApplicationInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_authentication_data.go b/src/checkout/model_authentication_data.go index b893f3d09..52f91ae74 100644 --- a/src/checkout/model_authentication_data.go +++ b/src/checkout/model_authentication_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationData type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type AuthenticationData struct { // Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. AttemptAuthentication *string `json:"attemptAuthentication,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. - AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` + AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` ThreeDSRequestData *ThreeDSRequestData `json:"threeDSRequestData,omitempty"` } @@ -144,7 +143,7 @@ func (o *AuthenticationData) SetThreeDSRequestData(v ThreeDSRequestData) { } func (o AuthenticationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -201,12 +200,14 @@ func (v *NullableAuthenticationData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AuthenticationData) isValidAttemptAuthentication() bool { - var allowedEnumValues = []string{"always", "never"} - for _, allowed := range allowedEnumValues { - if o.GetAttemptAuthentication() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "always", "never" } + for _, allowed := range allowedEnumValues { + if o.GetAttemptAuthentication() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_avs.go b/src/checkout/model_avs.go index 7e9c093b8..8ebda000c 100644 --- a/src/checkout/model_avs.go +++ b/src/checkout/model_avs.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Avs type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Avs) SetEnabled(v string) { } func (o Avs) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAvs) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Avs) isValidEnabled() bool { - var allowedEnumValues = []string{"yes", "no", "automatic"} - for _, allowed := range allowedEnumValues { - if o.GetEnabled() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "yes", "no", "automatic" } + for _, allowed := range allowedEnumValues { + if o.GetEnabled() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_bacs_direct_debit_details.go b/src/checkout/model_bacs_direct_debit_details.go index b6b5f0bee..5d577fb55 100644 --- a/src/checkout/model_bacs_direct_debit_details.go +++ b/src/checkout/model_bacs_direct_debit_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BacsDirectDebitDetails type satisfies the MappedNullable interface at compile time @@ -285,7 +284,7 @@ func (o *BacsDirectDebitDetails) SetType(v string) { } func (o BacsDirectDebitDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -354,12 +353,14 @@ func (v *NullableBacsDirectDebitDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BacsDirectDebitDetails) isValidType() bool { - var allowedEnumValues = []string{"directdebit_GB"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "directdebit_GB" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_balance_check_request.go b/src/checkout/model_balance_check_request.go index 8d9ce060d..3fc2734e2 100644 --- a/src/checkout/model_balance_check_request.go +++ b/src/checkout/model_balance_check_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceCheckRequest type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &BalanceCheckRequest{} // BalanceCheckRequest struct for BalanceCheckRequest type BalanceCheckRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -48,16 +47,16 @@ type BalanceCheckRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // The collection that contains the type of the payment method and its specific information. PaymentMethod map[string]string `json:"paymentMethod"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -75,7 +74,7 @@ type BalanceCheckRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -87,7 +86,7 @@ type BalanceCheckRequest struct { // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated @@ -1510,7 +1509,7 @@ func (o *BalanceCheckRequest) SetTrustedShopper(v bool) { } func (o BalanceCheckRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1684,21 +1683,23 @@ func (v *NullableBalanceCheckRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceCheckRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *BalanceCheckRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_balance_check_response.go b/src/checkout/model_balance_check_response.go index bba0709b7..bf5023b23 100644 --- a/src/checkout/model_balance_check_response.go +++ b/src/checkout/model_balance_check_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BalanceCheckResponse type satisfies the MappedNullable interface at compile time @@ -21,14 +20,14 @@ var _ common.MappedNullable = &BalanceCheckResponse{} type BalanceCheckResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Balance Amount `json:"balance"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + Balance Amount `json:"balance"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReason *string `json:"refusalReason,omitempty"` // The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - ResultCode string `json:"resultCode"` + ResultCode string `json:"resultCode"` TransactionLimit *Amount `json:"transactionLimit,omitempty"` } @@ -260,7 +259,7 @@ func (o *BalanceCheckResponse) SetTransactionLimit(v Amount) { } func (o BalanceCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -325,12 +324,14 @@ func (v *NullableBalanceCheckResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BalanceCheckResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "NotEnoughBalance", "Failed"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "NotEnoughBalance", "Failed" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_bank_account.go b/src/checkout/model_bank_account.go index 166e1a548..663eb10e2 100644 --- a/src/checkout/model_bank_account.go +++ b/src/checkout/model_bank_account.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_bill_desk_details.go b/src/checkout/model_bill_desk_details.go index 4f3ebd7ea..8477586d3 100644 --- a/src/checkout/model_bill_desk_details.go +++ b/src/checkout/model_bill_desk_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BillDeskDetails type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *BillDeskDetails) SetType(v string) { } func (o BillDeskDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableBillDeskDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BillDeskDetails) isValidType() bool { - var allowedEnumValues = []string{"billdesk_online", "billdesk_wallet", "onlinebanking_IN", "wallet_IN"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "billdesk_online", "billdesk_wallet", "onlinebanking_IN", "wallet_IN" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_billing_address.go b/src/checkout/model_billing_address.go index a811cb698..f7bb695e6 100644 --- a/src/checkout/model_billing_address.go +++ b/src/checkout/model_billing_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BillingAddress type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *BillingAddress) SetStreet(v string) { } func (o BillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableBillingAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_blik_details.go b/src/checkout/model_blik_details.go index 24aac3515..9b5c7dcef 100644 --- a/src/checkout/model_blik_details.go +++ b/src/checkout/model_blik_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BlikDetails type satisfies the MappedNullable interface at compile time @@ -213,7 +212,7 @@ func (o *BlikDetails) SetType(v string) { } func (o BlikDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -276,12 +275,14 @@ func (v *NullableBlikDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BlikDetails) isValidType() bool { - var allowedEnumValues = []string{"blik"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "blik" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_browser_info.go b/src/checkout/model_browser_info.go index ec9e0298e..7ac7483e2 100644 --- a/src/checkout/model_browser_info.go +++ b/src/checkout/model_browser_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BrowserInfo type satisfies the MappedNullable interface at compile time @@ -293,7 +292,7 @@ func (o *BrowserInfo) SetUserAgent(v string) { } func (o BrowserInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -351,3 +350,6 @@ func (v *NullableBrowserInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_cancel_order_request.go b/src/checkout/model_cancel_order_request.go index 54df21c08..e4997e5dc 100644 --- a/src/checkout/model_cancel_order_request.go +++ b/src/checkout/model_cancel_order_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CancelOrderRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &CancelOrderRequest{} // CancelOrderRequest struct for CancelOrderRequest type CancelOrderRequest struct { // The merchant account identifier that orderData belongs to. - MerchantAccount string `json:"merchantAccount"` - Order EncryptedOrderData `json:"order"` + MerchantAccount string `json:"merchantAccount"` + Order EncryptedOrderData `json:"order"` } // NewCancelOrderRequest instantiates a new CancelOrderRequest object @@ -92,7 +91,7 @@ func (o *CancelOrderRequest) SetOrder(v EncryptedOrderData) { } func (o CancelOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -141,3 +140,6 @@ func (v *NullableCancelOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_cancel_order_response.go b/src/checkout/model_cancel_order_response.go index f11071626..26b999687 100644 --- a/src/checkout/model_cancel_order_response.go +++ b/src/checkout/model_cancel_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CancelOrderResponse type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *CancelOrderResponse) SetResultCode(v string) { } func (o CancelOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -143,12 +142,14 @@ func (v *NullableCancelOrderResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CancelOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Received"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Received" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_card.go b/src/checkout/model_card.go index f1745867a..cea67696f 100644 --- a/src/checkout/model_card.go +++ b/src/checkout/model_card.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_brand_details.go b/src/checkout/model_card_brand_details.go index 560575e6d..6a17c8f44 100644 --- a/src/checkout/model_card_brand_details.go +++ b/src/checkout/model_card_brand_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardBrandDetails type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CardBrandDetails) SetType(v string) { } func (o CardBrandDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCardBrandDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index d5630ce21..3676f66fc 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardDetails type satisfies the MappedNullable interface at compile time @@ -696,7 +695,7 @@ func (o *CardDetails) SetType(v string) { } func (o CardDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -801,21 +800,23 @@ func (v *NullableCardDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CardDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *CardDetails) isValidType() bool { - var allowedEnumValues = []string{"scheme", "networkToken", "card"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "scheme", "networkToken", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_card_details_request.go b/src/checkout/model_card_details_request.go index 90ddf4061..a5dfbffb6 100644 --- a/src/checkout/model_card_details_request.go +++ b/src/checkout/model_card_details_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardDetailsRequest type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *CardDetailsRequest) SetSupportedBrands(v []string) { } func (o CardDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableCardDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_card_details_response.go b/src/checkout/model_card_details_response.go index 54f8636d3..2db9d0577 100644 --- a/src/checkout/model_card_details_response.go +++ b/src/checkout/model_card_details_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardDetailsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CardDetailsResponse) SetBrands(v []CardBrandDetails) { } func (o CardDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCardDetailsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_cellulant_details.go b/src/checkout/model_cellulant_details.go index 144a9af98..b3616b38f 100644 --- a/src/checkout/model_cellulant_details.go +++ b/src/checkout/model_cellulant_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CellulantDetails type satisfies the MappedNullable interface at compile time @@ -145,7 +144,7 @@ func (o *CellulantDetails) SetType(v string) { } func (o CellulantDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -202,12 +201,14 @@ func (v *NullableCellulantDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CellulantDetails) isValidType() bool { - var allowedEnumValues = []string{"cellulant"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "cellulant" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_await_action.go b/src/checkout/model_checkout_await_action.go index 122dc23a0..8698c690a 100644 --- a/src/checkout/model_checkout_await_action.go +++ b/src/checkout/model_checkout_await_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutAwaitAction type satisfies the MappedNullable interface at compile time @@ -168,7 +167,7 @@ func (o *CheckoutAwaitAction) SetUrl(v string) { } func (o CheckoutAwaitAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -226,12 +225,14 @@ func (v *NullableCheckoutAwaitAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutAwaitAction) isValidType() bool { - var allowedEnumValues = []string{"await"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "await" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_delegated_authentication_action.go b/src/checkout/model_checkout_delegated_authentication_action.go index 8735f8a54..ff368fcfa 100644 --- a/src/checkout/model_checkout_delegated_authentication_action.go +++ b/src/checkout/model_checkout_delegated_authentication_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutDelegatedAuthenticationAction type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *CheckoutDelegatedAuthenticationAction) SetUrl(v string) { } func (o CheckoutDelegatedAuthenticationAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -300,12 +299,14 @@ func (v *NullableCheckoutDelegatedAuthenticationAction) UnmarshalJSON(src []byte return json.Unmarshal(src, &v.value) } + func (o *CheckoutDelegatedAuthenticationAction) isValidType() bool { - var allowedEnumValues = []string{"delegatedAuthentication"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delegatedAuthentication" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_native_redirect_action.go b/src/checkout/model_checkout_native_redirect_action.go index eed84a01b..76ebf1fe5 100644 --- a/src/checkout/model_checkout_native_redirect_action.go +++ b/src/checkout/model_checkout_native_redirect_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutNativeRedirectAction type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *CheckoutNativeRedirectAction) SetUrl(v string) { } func (o CheckoutNativeRedirectAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -300,12 +299,14 @@ func (v *NullableCheckoutNativeRedirectAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutNativeRedirectAction) isValidType() bool { - var allowedEnumValues = []string{"nativeRedirect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nativeRedirect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_order_response.go b/src/checkout/model_checkout_order_response.go index a46d4648a..a744db76a 100644 --- a/src/checkout/model_checkout_order_response.go +++ b/src/checkout/model_checkout_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutOrderResponse type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type CheckoutOrderResponse struct { // The `pspReference` that belongs to the order. PspReference string `json:"pspReference"` // The merchant reference for the order. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` RemainingAmount *Amount `json:"remainingAmount,omitempty"` } @@ -234,7 +233,7 @@ func (o *CheckoutOrderResponse) SetRemainingAmount(v Amount) { } func (o CheckoutOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -297,3 +296,6 @@ func (v *NullableCheckoutOrderResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_payment_method.go b/src/checkout/model_checkout_payment_method.go index 43f3abb1a..11ebee759 100644 --- a/src/checkout/model_checkout_payment_method.go +++ b/src/checkout/model_checkout_payment_method.go @@ -10,50 +10,51 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // CheckoutPaymentMethod - The type and required details of a payment method to use. type CheckoutPaymentMethod struct { - AchDetails *AchDetails - AfterpayDetails *AfterpayDetails - AmazonPayDetails *AmazonPayDetails - AndroidPayDetails *AndroidPayDetails - ApplePayDetails *ApplePayDetails - BacsDirectDebitDetails *BacsDirectDebitDetails - BillDeskDetails *BillDeskDetails - BlikDetails *BlikDetails - CardDetails *CardDetails - CellulantDetails *CellulantDetails - DokuDetails *DokuDetails - DotpayDetails *DotpayDetails - DragonpayDetails *DragonpayDetails - EcontextVoucherDetails *EcontextVoucherDetails + AchDetails *AchDetails + AfterpayDetails *AfterpayDetails + AmazonPayDetails *AmazonPayDetails + AndroidPayDetails *AndroidPayDetails + ApplePayDetails *ApplePayDetails + BacsDirectDebitDetails *BacsDirectDebitDetails + BillDeskDetails *BillDeskDetails + BlikDetails *BlikDetails + CardDetails *CardDetails + CellulantDetails *CellulantDetails + DokuDetails *DokuDetails + DotpayDetails *DotpayDetails + DragonpayDetails *DragonpayDetails + EcontextVoucherDetails *EcontextVoucherDetails GenericIssuerPaymentMethodDetails *GenericIssuerPaymentMethodDetails - GiropayDetails *GiropayDetails - GooglePayDetails *GooglePayDetails - IdealDetails *IdealDetails - KlarnaDetails *KlarnaDetails - MasterpassDetails *MasterpassDetails - MbwayDetails *MbwayDetails - MobilePayDetails *MobilePayDetails - MolPayDetails *MolPayDetails - OpenInvoiceDetails *OpenInvoiceDetails - PayPalDetails *PayPalDetails - PayUUpiDetails *PayUUpiDetails - PayWithGoogleDetails *PayWithGoogleDetails - PaymentDetails *PaymentDetails - RatepayDetails *RatepayDetails - SamsungPayDetails *SamsungPayDetails - SepaDirectDebitDetails *SepaDirectDebitDetails - StoredPaymentMethodDetails *StoredPaymentMethodDetails - UpiCollectDetails *UpiCollectDetails - UpiIntentDetails *UpiIntentDetails - VippsDetails *VippsDetails - VisaCheckoutDetails *VisaCheckoutDetails - WeChatPayDetails *WeChatPayDetails - WeChatPayMiniProgramDetails *WeChatPayMiniProgramDetails - ZipDetails *ZipDetails + GiropayDetails *GiropayDetails + GooglePayDetails *GooglePayDetails + IdealDetails *IdealDetails + KlarnaDetails *KlarnaDetails + MasterpassDetails *MasterpassDetails + MbwayDetails *MbwayDetails + MobilePayDetails *MobilePayDetails + MolPayDetails *MolPayDetails + OpenInvoiceDetails *OpenInvoiceDetails + PayPalDetails *PayPalDetails + PayUUpiDetails *PayUUpiDetails + PayWithGoogleDetails *PayWithGoogleDetails + PaymentDetails *PaymentDetails + RatepayDetails *RatepayDetails + SamsungPayDetails *SamsungPayDetails + SepaDirectDebitDetails *SepaDirectDebitDetails + StoredPaymentMethodDetails *StoredPaymentMethodDetails + UpiCollectDetails *UpiCollectDetails + UpiIntentDetails *UpiIntentDetails + VippsDetails *VippsDetails + VisaCheckoutDetails *VisaCheckoutDetails + WeChatPayDetails *WeChatPayDetails + WeChatPayMiniProgramDetails *WeChatPayMiniProgramDetails + ZipDetails *ZipDetails } // AchDetailsAsCheckoutPaymentMethod is a convenience function that returns AchDetails wrapped in CheckoutPaymentMethod @@ -329,6 +330,7 @@ func ZipDetailsAsCheckoutPaymentMethod(v *ZipDetails) CheckoutPaymentMethod { } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { var err error @@ -339,7 +341,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonAchDetails, _ := json.Marshal(dst.AchDetails) if string(jsonAchDetails) == "{}" || !dst.AchDetails.isValidType() { // empty struct dst.AchDetails = nil - } else { + } else { match++ } } else { @@ -352,7 +354,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonAfterpayDetails, _ := json.Marshal(dst.AfterpayDetails) if string(jsonAfterpayDetails) == "{}" || !dst.AfterpayDetails.isValidType() { // empty struct dst.AfterpayDetails = nil - } else { + } else { match++ } } else { @@ -365,7 +367,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonAmazonPayDetails, _ := json.Marshal(dst.AmazonPayDetails) if string(jsonAmazonPayDetails) == "{}" || !dst.AmazonPayDetails.isValidType() { // empty struct dst.AmazonPayDetails = nil - } else { + } else { match++ } } else { @@ -378,7 +380,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonAndroidPayDetails, _ := json.Marshal(dst.AndroidPayDetails) if string(jsonAndroidPayDetails) == "{}" || !dst.AndroidPayDetails.isValidType() { // empty struct dst.AndroidPayDetails = nil - } else { + } else { match++ } } else { @@ -391,7 +393,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct dst.ApplePayDetails = nil - } else { + } else { match++ } } else { @@ -404,7 +406,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonBacsDirectDebitDetails, _ := json.Marshal(dst.BacsDirectDebitDetails) if string(jsonBacsDirectDebitDetails) == "{}" || !dst.BacsDirectDebitDetails.isValidType() { // empty struct dst.BacsDirectDebitDetails = nil - } else { + } else { match++ } } else { @@ -417,7 +419,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonBillDeskDetails, _ := json.Marshal(dst.BillDeskDetails) if string(jsonBillDeskDetails) == "{}" || !dst.BillDeskDetails.isValidType() { // empty struct dst.BillDeskDetails = nil - } else { + } else { match++ } } else { @@ -430,7 +432,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonBlikDetails, _ := json.Marshal(dst.BlikDetails) if string(jsonBlikDetails) == "{}" || !dst.BlikDetails.isValidType() { // empty struct dst.BlikDetails = nil - } else { + } else { match++ } } else { @@ -443,7 +445,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonCardDetails, _ := json.Marshal(dst.CardDetails) if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct dst.CardDetails = nil - } else { + } else { match++ } } else { @@ -456,7 +458,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonCellulantDetails, _ := json.Marshal(dst.CellulantDetails) if string(jsonCellulantDetails) == "{}" || !dst.CellulantDetails.isValidType() { // empty struct dst.CellulantDetails = nil - } else { + } else { match++ } } else { @@ -469,7 +471,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonDokuDetails, _ := json.Marshal(dst.DokuDetails) if string(jsonDokuDetails) == "{}" || !dst.DokuDetails.isValidType() { // empty struct dst.DokuDetails = nil - } else { + } else { match++ } } else { @@ -482,7 +484,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonDotpayDetails, _ := json.Marshal(dst.DotpayDetails) if string(jsonDotpayDetails) == "{}" || !dst.DotpayDetails.isValidType() { // empty struct dst.DotpayDetails = nil - } else { + } else { match++ } } else { @@ -495,7 +497,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonDragonpayDetails, _ := json.Marshal(dst.DragonpayDetails) if string(jsonDragonpayDetails) == "{}" || !dst.DragonpayDetails.isValidType() { // empty struct dst.DragonpayDetails = nil - } else { + } else { match++ } } else { @@ -508,7 +510,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonEcontextVoucherDetails, _ := json.Marshal(dst.EcontextVoucherDetails) if string(jsonEcontextVoucherDetails) == "{}" || !dst.EcontextVoucherDetails.isValidType() { // empty struct dst.EcontextVoucherDetails = nil - } else { + } else { match++ } } else { @@ -521,7 +523,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonGenericIssuerPaymentMethodDetails, _ := json.Marshal(dst.GenericIssuerPaymentMethodDetails) if string(jsonGenericIssuerPaymentMethodDetails) == "{}" || !dst.GenericIssuerPaymentMethodDetails.isValidType() { // empty struct dst.GenericIssuerPaymentMethodDetails = nil - } else { + } else { match++ } } else { @@ -534,7 +536,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonGiropayDetails, _ := json.Marshal(dst.GiropayDetails) if string(jsonGiropayDetails) == "{}" || !dst.GiropayDetails.isValidType() { // empty struct dst.GiropayDetails = nil - } else { + } else { match++ } } else { @@ -547,7 +549,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct dst.GooglePayDetails = nil - } else { + } else { match++ } } else { @@ -560,7 +562,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct dst.IdealDetails = nil - } else { + } else { match++ } } else { @@ -573,7 +575,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonKlarnaDetails, _ := json.Marshal(dst.KlarnaDetails) if string(jsonKlarnaDetails) == "{}" || !dst.KlarnaDetails.isValidType() { // empty struct dst.KlarnaDetails = nil - } else { + } else { match++ } } else { @@ -586,7 +588,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonMasterpassDetails, _ := json.Marshal(dst.MasterpassDetails) if string(jsonMasterpassDetails) == "{}" || !dst.MasterpassDetails.isValidType() { // empty struct dst.MasterpassDetails = nil - } else { + } else { match++ } } else { @@ -599,7 +601,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonMbwayDetails, _ := json.Marshal(dst.MbwayDetails) if string(jsonMbwayDetails) == "{}" || !dst.MbwayDetails.isValidType() { // empty struct dst.MbwayDetails = nil - } else { + } else { match++ } } else { @@ -612,7 +614,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonMobilePayDetails, _ := json.Marshal(dst.MobilePayDetails) if string(jsonMobilePayDetails) == "{}" || !dst.MobilePayDetails.isValidType() { // empty struct dst.MobilePayDetails = nil - } else { + } else { match++ } } else { @@ -625,7 +627,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonMolPayDetails, _ := json.Marshal(dst.MolPayDetails) if string(jsonMolPayDetails) == "{}" || !dst.MolPayDetails.isValidType() { // empty struct dst.MolPayDetails = nil - } else { + } else { match++ } } else { @@ -638,7 +640,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonOpenInvoiceDetails, _ := json.Marshal(dst.OpenInvoiceDetails) if string(jsonOpenInvoiceDetails) == "{}" || !dst.OpenInvoiceDetails.isValidType() { // empty struct dst.OpenInvoiceDetails = nil - } else { + } else { match++ } } else { @@ -651,7 +653,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonPayPalDetails, _ := json.Marshal(dst.PayPalDetails) if string(jsonPayPalDetails) == "{}" || !dst.PayPalDetails.isValidType() { // empty struct dst.PayPalDetails = nil - } else { + } else { match++ } } else { @@ -664,7 +666,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonPayUUpiDetails, _ := json.Marshal(dst.PayUUpiDetails) if string(jsonPayUUpiDetails) == "{}" || !dst.PayUUpiDetails.isValidType() { // empty struct dst.PayUUpiDetails = nil - } else { + } else { match++ } } else { @@ -677,7 +679,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct dst.PayWithGoogleDetails = nil - } else { + } else { match++ } } else { @@ -690,7 +692,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonPaymentDetails, _ := json.Marshal(dst.PaymentDetails) if string(jsonPaymentDetails) == "{}" || !dst.PaymentDetails.isValidType() { // empty struct dst.PaymentDetails = nil - } else { + } else { match++ } } else { @@ -703,7 +705,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonRatepayDetails, _ := json.Marshal(dst.RatepayDetails) if string(jsonRatepayDetails) == "{}" || !dst.RatepayDetails.isValidType() { // empty struct dst.RatepayDetails = nil - } else { + } else { match++ } } else { @@ -716,7 +718,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonSamsungPayDetails, _ := json.Marshal(dst.SamsungPayDetails) if string(jsonSamsungPayDetails) == "{}" || !dst.SamsungPayDetails.isValidType() { // empty struct dst.SamsungPayDetails = nil - } else { + } else { match++ } } else { @@ -729,7 +731,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonSepaDirectDebitDetails, _ := json.Marshal(dst.SepaDirectDebitDetails) if string(jsonSepaDirectDebitDetails) == "{}" || !dst.SepaDirectDebitDetails.isValidType() { // empty struct dst.SepaDirectDebitDetails = nil - } else { + } else { match++ } } else { @@ -742,7 +744,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonStoredPaymentMethodDetails, _ := json.Marshal(dst.StoredPaymentMethodDetails) if string(jsonStoredPaymentMethodDetails) == "{}" || !dst.StoredPaymentMethodDetails.isValidType() { // empty struct dst.StoredPaymentMethodDetails = nil - } else { + } else { match++ } } else { @@ -755,7 +757,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonUpiCollectDetails, _ := json.Marshal(dst.UpiCollectDetails) if string(jsonUpiCollectDetails) == "{}" || !dst.UpiCollectDetails.isValidType() { // empty struct dst.UpiCollectDetails = nil - } else { + } else { match++ } } else { @@ -768,7 +770,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonUpiIntentDetails, _ := json.Marshal(dst.UpiIntentDetails) if string(jsonUpiIntentDetails) == "{}" || !dst.UpiIntentDetails.isValidType() { // empty struct dst.UpiIntentDetails = nil - } else { + } else { match++ } } else { @@ -781,7 +783,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonVippsDetails, _ := json.Marshal(dst.VippsDetails) if string(jsonVippsDetails) == "{}" || !dst.VippsDetails.isValidType() { // empty struct dst.VippsDetails = nil - } else { + } else { match++ } } else { @@ -794,7 +796,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonVisaCheckoutDetails, _ := json.Marshal(dst.VisaCheckoutDetails) if string(jsonVisaCheckoutDetails) == "{}" || !dst.VisaCheckoutDetails.isValidType() { // empty struct dst.VisaCheckoutDetails = nil - } else { + } else { match++ } } else { @@ -807,7 +809,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonWeChatPayDetails, _ := json.Marshal(dst.WeChatPayDetails) if string(jsonWeChatPayDetails) == "{}" || !dst.WeChatPayDetails.isValidType() { // empty struct dst.WeChatPayDetails = nil - } else { + } else { match++ } } else { @@ -820,7 +822,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonWeChatPayMiniProgramDetails, _ := json.Marshal(dst.WeChatPayMiniProgramDetails) if string(jsonWeChatPayMiniProgramDetails) == "{}" || !dst.WeChatPayMiniProgramDetails.isValidType() { // empty struct dst.WeChatPayMiniProgramDetails = nil - } else { + } else { match++ } } else { @@ -833,7 +835,7 @@ func (dst *CheckoutPaymentMethod) UnmarshalJSON(data []byte) error { jsonZipDetails, _ := json.Marshal(dst.ZipDetails) if string(jsonZipDetails) == "{}" || !dst.ZipDetails.isValidType() { // empty struct dst.ZipDetails = nil - } else { + } else { match++ } } else { @@ -1052,7 +1054,7 @@ func (src CheckoutPaymentMethod) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *CheckoutPaymentMethod) GetActualInstance() interface{} { +func (obj *CheckoutPaymentMethod) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -1251,3 +1253,5 @@ func (v *NullableCheckoutPaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/checkout/model_checkout_qr_code_action.go b/src/checkout/model_checkout_qr_code_action.go index fde44f829..a5b6707d3 100644 --- a/src/checkout/model_checkout_qr_code_action.go +++ b/src/checkout/model_checkout_qr_code_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutQrCodeAction type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *CheckoutQrCodeAction) SetUrl(v string) { } func (o CheckoutQrCodeAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -300,12 +299,14 @@ func (v *NullableCheckoutQrCodeAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutQrCodeAction) isValidType() bool { - var allowedEnumValues = []string{"qrCode"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "qrCode" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_redirect_action.go b/src/checkout/model_checkout_redirect_action.go index eabc44dbf..f72f29f7a 100644 --- a/src/checkout/model_checkout_redirect_action.go +++ b/src/checkout/model_checkout_redirect_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutRedirectAction type satisfies the MappedNullable interface at compile time @@ -202,7 +201,7 @@ func (o *CheckoutRedirectAction) SetUrl(v string) { } func (o CheckoutRedirectAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,12 +262,14 @@ func (v *NullableCheckoutRedirectAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutRedirectAction) isValidType() bool { - var allowedEnumValues = []string{"redirect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "redirect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_sdk_action.go b/src/checkout/model_checkout_sdk_action.go index 0bfb29342..b7b1b4b08 100644 --- a/src/checkout/model_checkout_sdk_action.go +++ b/src/checkout/model_checkout_sdk_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutSDKAction type satisfies the MappedNullable interface at compile time @@ -202,7 +201,7 @@ func (o *CheckoutSDKAction) SetUrl(v string) { } func (o CheckoutSDKAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,12 +262,14 @@ func (v *NullableCheckoutSDKAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutSDKAction) isValidType() bool { - var allowedEnumValues = []string{"sdk", "wechatpaySDK"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sdk", "wechatpaySDK" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_session_installment_option.go b/src/checkout/model_checkout_session_installment_option.go index 839399721..b1183afc8 100644 --- a/src/checkout/model_checkout_session_installment_option.go +++ b/src/checkout/model_checkout_session_installment_option.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutSessionInstallmentOption type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CheckoutSessionInstallmentOption) SetValues(v []int32) { } func (o CheckoutSessionInstallmentOption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCheckoutSessionInstallmentOption) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_checkout_three_ds2_action.go b/src/checkout/model_checkout_three_ds2_action.go index ed0415d88..15d013dc1 100644 --- a/src/checkout/model_checkout_three_ds2_action.go +++ b/src/checkout/model_checkout_three_ds2_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutThreeDS2Action type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *CheckoutThreeDS2Action) SetUrl(v string) { } func (o CheckoutThreeDS2Action) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -337,12 +336,14 @@ func (v *NullableCheckoutThreeDS2Action) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutThreeDS2Action) isValidType() bool { - var allowedEnumValues = []string{"threeDS2"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "threeDS2" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_checkout_voucher_action.go b/src/checkout/model_checkout_voucher_action.go index 3e1fb8b20..70c475a5b 100644 --- a/src/checkout/model_checkout_voucher_action.go +++ b/src/checkout/model_checkout_voucher_action.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CheckoutVoucherAction type satisfies the MappedNullable interface at compile time @@ -28,7 +27,7 @@ type CheckoutVoucherAction struct { // An entity number of Multibanco. Entity *string `json:"entity,omitempty"` // The date time of the voucher expiry. - ExpiresAt *string `json:"expiresAt,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` InitialAmount *Amount `json:"initialAmount,omitempty"` // The URL to the detailed instructions to make payment using the voucher. InstructionsUrl *string `json:"instructionsUrl,omitempty"` @@ -52,7 +51,7 @@ type CheckoutVoucherAction struct { ShopperEmail *string `json:"shopperEmail,omitempty"` // The shopper name. ShopperName *string `json:"shopperName,omitempty"` - Surcharge *Amount `json:"surcharge,omitempty"` + Surcharge *Amount `json:"surcharge,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` // **voucher** Type string `json:"type"` @@ -743,7 +742,7 @@ func (o *CheckoutVoucherAction) SetUrl(v string) { } func (o CheckoutVoucherAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -852,12 +851,14 @@ func (v *NullableCheckoutVoucherAction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CheckoutVoucherAction) isValidType() bool { - var allowedEnumValues = []string{"voucher"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "voucher" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_common_field.go b/src/checkout/model_common_field.go index 43480e54d..3f34f1cec 100644 --- a/src/checkout/model_common_field.go +++ b/src/checkout/model_common_field.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CommonField type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CommonField) SetVersion(v string) { } func (o CommonField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommonField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_company.go b/src/checkout/model_company.go index 3e1f6691b..64e48790e 100644 --- a/src/checkout/model_company.go +++ b/src/checkout/model_company.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Company type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *Company) SetType(v string) { } func (o Company) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableCompany) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_configuration.go b/src/checkout/model_configuration.go index 5490bc72c..9cfb51092 100644 --- a/src/checkout/model_configuration.go +++ b/src/checkout/model_configuration.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Configuration type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &Configuration{} type Configuration struct { Avs *Avs `json:"avs,omitempty"` // Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED - CardHolderName *string `json:"cardHolderName,omitempty"` - Installments *InstallmentsNumber `json:"installments,omitempty"` - ShopperInput *ShopperInput `json:"shopperInput,omitempty"` + CardHolderName *string `json:"cardHolderName,omitempty"` + Installments *InstallmentsNumber `json:"installments,omitempty"` + ShopperInput *ShopperInput `json:"shopperInput,omitempty"` } // NewConfiguration instantiates a new Configuration object @@ -172,7 +171,7 @@ func (o *Configuration) SetShopperInput(v ShopperInput) { } func (o Configuration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,12 +231,14 @@ func (v *NullableConfiguration) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Configuration) isValidCardHolderName() bool { - var allowedEnumValues = []string{"NONE", "OPTIONAL", "REQUIRED"} - for _, allowed := range allowedEnumValues { - if o.GetCardHolderName() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NONE", "OPTIONAL", "REQUIRED" } + for _, allowed := range allowedEnumValues { + if o.GetCardHolderName() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index c8f991014..d903cb331 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCheckoutSessionRequest type satisfies the MappedNullable interface at compile time @@ -20,29 +19,29 @@ var _ common.MappedNullable = &CreateCheckoutSessionRequest{} // CreateCheckoutSessionRequest struct for CreateCheckoutSessionRequest type CreateCheckoutSessionRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - Channel *string `json:"channel,omitempty"` + Channel *string `json:"channel,omitempty"` Company *Company `json:"company,omitempty"` // The shopper's two-letter country code. CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` @@ -51,31 +50,31 @@ type CreateCheckoutSessionRequest struct { // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. EnableRecurring *bool `json:"enableRecurring,omitempty"` // The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - ExpiresAt *time.Time `json:"expiresAt,omitempty"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. InstallmentOptions *map[string]CheckoutSessionInstallmentOption `json:"installmentOptions,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - Mode *string `json:"mode,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Mode *string `json:"mode,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -84,8 +83,8 @@ type CreateCheckoutSessionRequest struct { // The reference to uniquely identify a payment. Reference string `json:"reference"` // The URL to return to when a redirect payment is completed. - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). @@ -94,7 +93,7 @@ type CreateCheckoutSessionRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -1985,7 +1984,7 @@ func (o *CreateCheckoutSessionRequest) SetTrustedShopper(v bool) { } func (o CreateCheckoutSessionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2199,48 +2198,50 @@ func (v *NullableCreateCheckoutSessionRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateCheckoutSessionRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidMode() bool { - var allowedEnumValues = []string{"embedded", "hosted"} - for _, allowed := range allowedEnumValues { - if o.GetMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "embedded", "hosted" } + for _, allowed := range allowedEnumValues { + if o.GetMode() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionRequest) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index deddba628..27e05ff9c 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCheckoutSessionResponse type satisfies the MappedNullable interface at compile time @@ -20,29 +19,29 @@ var _ common.MappedNullable = &CreateCheckoutSessionResponse{} // CreateCheckoutSessionResponse struct for CreateCheckoutSessionResponse type CreateCheckoutSessionResponse struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - Channel *string `json:"channel,omitempty"` + Channel *string `json:"channel,omitempty"` Company *Company `json:"company,omitempty"` // The shopper's two-letter country code. CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. EnableOneClick *bool `json:"enableOneClick,omitempty"` @@ -51,8 +50,8 @@ type CreateCheckoutSessionResponse struct { // When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. EnableRecurring *bool `json:"enableRecurring,omitempty"` // The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - ExpiresAt time.Time `json:"expiresAt"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + ExpiresAt time.Time `json:"expiresAt"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // A unique identifier of the session. Id string `json:"id"` @@ -60,24 +59,24 @@ type CreateCheckoutSessionResponse struct { InstallmentOptions *map[string]CheckoutSessionInstallmentOption `json:"installmentOptions,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - Mode *string `json:"mode,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Mode *string `json:"mode,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -86,8 +85,8 @@ type CreateCheckoutSessionResponse struct { // The reference to uniquely identify a payment. Reference string `json:"reference"` // The URL to return to when a redirect payment is completed. - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The payment session data you need to pass to your front end. SessionData *string `json:"sessionData,omitempty"` // The shopper's email address. @@ -98,7 +97,7 @@ type CreateCheckoutSessionResponse struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -2073,7 +2072,7 @@ func (o *CreateCheckoutSessionResponse) SetUrl(v string) { } func (o CreateCheckoutSessionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2292,48 +2291,50 @@ func (v *NullableCreateCheckoutSessionResponse) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *CreateCheckoutSessionResponse) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidMode() bool { - var allowedEnumValues = []string{"embedded", "hosted"} - for _, allowed := range allowedEnumValues { - if o.GetMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "embedded", "hosted" } + for _, allowed := range allowedEnumValues { + if o.GetMode() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *CreateCheckoutSessionResponse) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_create_order_request.go b/src/checkout/model_create_order_request.go index 4c80d262a..1d14fbffe 100644 --- a/src/checkout/model_create_order_request.go +++ b/src/checkout/model_create_order_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateOrderRequest type satisfies the MappedNullable interface at compile time @@ -153,7 +152,7 @@ func (o *CreateOrderRequest) SetReference(v string) { } func (o CreateOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -206,3 +205,6 @@ func (v *NullableCreateOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_create_order_response.go b/src/checkout/model_create_order_response.go index 23db715b2..b640c0d63 100644 --- a/src/checkout/model_create_order_response.go +++ b/src/checkout/model_create_order_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateOrderResponse type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &CreateOrderResponse{} type CreateOrderResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` // The date that the order will expire. - ExpiresAt string `json:"expiresAt"` + ExpiresAt string `json:"expiresAt"` FraudResult *FraudResult `json:"fraudResult,omitempty"` // The encrypted data that will be used by merchant for adding payments to the order. OrderData string `json:"orderData"` @@ -32,8 +31,8 @@ type CreateOrderResponse struct { // The reference provided by merchant for creating the order. Reference *string `json:"reference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - RefusalReason *string `json:"refusalReason,omitempty"` - RemainingAmount Amount `json:"remainingAmount"` + RefusalReason *string `json:"refusalReason,omitempty"` + RemainingAmount Amount `json:"remainingAmount"` // The result of the order creation request. The value is always **Success**. ResultCode string `json:"resultCode"` } @@ -341,7 +340,7 @@ func (o *CreateOrderResponse) SetResultCode(v string) { } func (o CreateOrderResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,12 +408,14 @@ func (v *NullableCreateOrderResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateOrderResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_delivery_address.go b/src/checkout/model_delivery_address.go index 9135eeb77..dab9e20ef 100644 --- a/src/checkout/model_delivery_address.go +++ b/src/checkout/model_delivery_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeliveryAddress type satisfies the MappedNullable interface at compile time @@ -22,11 +21,11 @@ type DeliveryAddress struct { // The name of the city. Maximum length: 3000 characters. City string `json:"city"` // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - Country string `json:"country"` + Country string `json:"country"` FirstName *string `json:"firstName,omitempty"` // The number or name of the house. Maximum length: 3000 characters. - HouseNumberOrName string `json:"houseNumberOrName"` - LastName *string `json:"lastName,omitempty"` + HouseNumberOrName string `json:"houseNumberOrName"` + LastName *string `json:"lastName,omitempty"` // A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. PostalCode string `json:"postalCode"` // The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. @@ -274,7 +273,7 @@ func (o *DeliveryAddress) SetStreet(v string) { } func (o DeliveryAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -335,3 +334,6 @@ func (v *NullableDeliveryAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_details_request_authentication_data.go b/src/checkout/model_details_request_authentication_data.go index 96f8327ba..ecb24c0a7 100644 --- a/src/checkout/model_details_request_authentication_data.go +++ b/src/checkout/model_details_request_authentication_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DetailsRequestAuthenticationData type satisfies the MappedNullable interface at compile time @@ -77,7 +76,7 @@ func (o *DetailsRequestAuthenticationData) SetAuthenticationOnly(v bool) { } func (o DetailsRequestAuthenticationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -127,3 +126,6 @@ func (v *NullableDetailsRequestAuthenticationData) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_device_render_options.go b/src/checkout/model_device_render_options.go index cb376b7c6..928849311 100644 --- a/src/checkout/model_device_render_options.go +++ b/src/checkout/model_device_render_options.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeviceRenderOptions type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *DeviceRenderOptions) SetSdkUiType(v []string) { } func (o DeviceRenderOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableDeviceRenderOptions) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DeviceRenderOptions) isValidSdkInterface() bool { - var allowedEnumValues = []string{"native", "html", "both"} - for _, allowed := range allowedEnumValues { - if o.GetSdkInterface() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "native", "html", "both" } + for _, allowed := range allowedEnumValues { + if o.GetSdkInterface() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_doku_details.go b/src/checkout/model_doku_details.go index db91456f6..9c8b42d94 100644 --- a/src/checkout/model_doku_details.go +++ b/src/checkout/model_doku_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DokuDetails type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *DokuDetails) SetType(v string) { } func (o DokuDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullableDokuDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DokuDetails) isValidType() bool { - var allowedEnumValues = []string{"doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret", "doku_wallet", "doku_ovo"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "doku_mandiri_va", "doku_cimb_va", "doku_danamon_va", "doku_bni_va", "doku_permata_lite_atm", "doku_bri_va", "doku_bca_va", "doku_alfamart", "doku_indomaret", "doku_wallet", "doku_ovo" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_donation_payment_method.go b/src/checkout/model_donation_payment_method.go index 7d1f97c2b..8d6bfff8e 100644 --- a/src/checkout/model_donation_payment_method.go +++ b/src/checkout/model_donation_payment_method.go @@ -10,15 +10,16 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // DonationPaymentMethod - The type and required details of a payment method to use. type DonationPaymentMethod struct { - ApplePayDetails *ApplePayDetails - CardDetails *CardDetails - GooglePayDetails *GooglePayDetails - IdealDetails *IdealDetails + ApplePayDetails *ApplePayDetails + CardDetails *CardDetails + GooglePayDetails *GooglePayDetails + IdealDetails *IdealDetails PayWithGoogleDetails *PayWithGoogleDetails } @@ -57,6 +58,7 @@ func PayWithGoogleDetailsAsDonationPaymentMethod(v *PayWithGoogleDetails) Donati } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { var err error @@ -67,7 +69,7 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { jsonApplePayDetails, _ := json.Marshal(dst.ApplePayDetails) if string(jsonApplePayDetails) == "{}" || !dst.ApplePayDetails.isValidType() { // empty struct dst.ApplePayDetails = nil - } else { + } else { match++ } } else { @@ -80,7 +82,7 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { jsonCardDetails, _ := json.Marshal(dst.CardDetails) if string(jsonCardDetails) == "{}" || !dst.CardDetails.isValidType() { // empty struct dst.CardDetails = nil - } else { + } else { match++ } } else { @@ -93,7 +95,7 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { jsonGooglePayDetails, _ := json.Marshal(dst.GooglePayDetails) if string(jsonGooglePayDetails) == "{}" || !dst.GooglePayDetails.isValidType() { // empty struct dst.GooglePayDetails = nil - } else { + } else { match++ } } else { @@ -106,7 +108,7 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { jsonIdealDetails, _ := json.Marshal(dst.IdealDetails) if string(jsonIdealDetails) == "{}" || !dst.IdealDetails.isValidType() { // empty struct dst.IdealDetails = nil - } else { + } else { match++ } } else { @@ -119,7 +121,7 @@ func (dst *DonationPaymentMethod) UnmarshalJSON(data []byte) error { jsonPayWithGoogleDetails, _ := json.Marshal(dst.PayWithGoogleDetails) if string(jsonPayWithGoogleDetails) == "{}" || !dst.PayWithGoogleDetails.isValidType() { // empty struct dst.PayWithGoogleDetails = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (src DonationPaymentMethod) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *DonationPaymentMethod) GetActualInstance() interface{} { +func (obj *DonationPaymentMethod) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -231,3 +233,5 @@ func (v *NullableDonationPaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/checkout/model_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index c3855bbc1..cc5ba37cd 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DonationPaymentRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ var _ common.MappedNullable = &DonationPaymentRequest{} type DonationPaymentRequest struct { AccountInfo *AccountInfo `json:"accountInfo,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *BillingAddress `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web Channel *string `json:"channel,omitempty"` // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. @@ -40,7 +39,7 @@ type DonationPaymentRequest struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` @@ -53,15 +52,15 @@ type DonationPaymentRequest struct { // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - Origin *string `json:"origin,omitempty"` + Origin *string `json:"origin,omitempty"` PaymentMethod DonationPaymentMethod `json:"paymentMethod"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -81,13 +80,13 @@ type DonationPaymentRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestFields `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated @@ -1392,7 +1391,7 @@ func (o *DonationPaymentRequest) SetThreeDSAuthenticationOnly(v bool) { } func (o DonationPaymentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1551,30 +1550,32 @@ func (v *NullableDonationPaymentRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DonationPaymentRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *DonationPaymentRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *DonationPaymentRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_donation_payment_response.go b/src/checkout/model_donation_payment_response.go index 228939931..6f676f39a 100644 --- a/src/checkout/model_donation_payment_response.go +++ b/src/checkout/model_donation_payment_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DonationPaymentResponse type satisfies the MappedNullable interface at compile time @@ -25,8 +24,8 @@ type DonationPaymentResponse struct { // Your unique resource identifier. Id *string `json:"id,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount *string `json:"merchantAccount,omitempty"` - Payment *PaymentResponse `json:"payment,omitempty"` + MerchantAccount *string `json:"merchantAccount,omitempty"` + Payment *PaymentResponse `json:"payment,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` // The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** @@ -275,7 +274,7 @@ func (o *DonationPaymentResponse) SetStatus(v string) { } func (o DonationPaymentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,12 +343,14 @@ func (v *NullableDonationPaymentResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DonationPaymentResponse) isValidStatus() bool { - var allowedEnumValues = []string{"completed", "pending", "refused"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "completed", "pending", "refused" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_dotpay_details.go b/src/checkout/model_dotpay_details.go index f5b7f64fc..317df572f 100644 --- a/src/checkout/model_dotpay_details.go +++ b/src/checkout/model_dotpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DotpayDetails type satisfies the MappedNullable interface at compile time @@ -138,7 +137,7 @@ func (o *DotpayDetails) SetType(v string) { } func (o DotpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -193,12 +192,14 @@ func (v *NullableDotpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DotpayDetails) isValidType() bool { - var allowedEnumValues = []string{"dotpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dotpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_dragonpay_details.go b/src/checkout/model_dragonpay_details.go index 4defe9c83..cf91cac75 100644 --- a/src/checkout/model_dragonpay_details.go +++ b/src/checkout/model_dragonpay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DragonpayDetails type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *DragonpayDetails) SetType(v string) { } func (o DragonpayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -217,12 +216,14 @@ func (v *NullableDragonpayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DragonpayDetails) isValidType() bool { - var allowedEnumValues = []string{"dragonpay_ebanking", "dragonpay_otc_banking", "dragonpay_otc_non_banking", "dragonpay_otc_philippines"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dragonpay_ebanking", "dragonpay_otc_banking", "dragonpay_otc_non_banking", "dragonpay_otc_philippines" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_econtext_voucher_details.go b/src/checkout/model_econtext_voucher_details.go index da8f5a216..0c3097e53 100644 --- a/src/checkout/model_econtext_voucher_details.go +++ b/src/checkout/model_econtext_voucher_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the EcontextVoucherDetails type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *EcontextVoucherDetails) SetType(v string) { } func (o EcontextVoucherDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -264,12 +263,14 @@ func (v *NullableEcontextVoucherDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *EcontextVoucherDetails) isValidType() bool { - var allowedEnumValues = []string{"econtext_seveneleven", "econtext_stores"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "econtext_seveneleven", "econtext_stores" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_encrypted_order_data.go b/src/checkout/model_encrypted_order_data.go index c36e39532..246ed693e 100644 --- a/src/checkout/model_encrypted_order_data.go +++ b/src/checkout/model_encrypted_order_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the EncryptedOrderData type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *EncryptedOrderData) SetPspReference(v string) { } func (o EncryptedOrderData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableEncryptedOrderData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_external_platform.go b/src/checkout/model_external_platform.go index 058744ed9..93e80022e 100644 --- a/src/checkout/model_external_platform.go +++ b/src/checkout/model_external_platform.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ExternalPlatform type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ExternalPlatform) SetVersion(v string) { } func (o ExternalPlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableExternalPlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_forex_quote.go b/src/checkout/model_forex_quote.go index 8173e315d..c846bd1c8 100644 --- a/src/checkout/model_forex_quote.go +++ b/src/checkout/model_forex_quote.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ForexQuote type satisfies the MappedNullable interface at compile time @@ -24,14 +23,14 @@ type ForexQuote struct { Account *string `json:"account,omitempty"` // The account type. AccountType *string `json:"accountType,omitempty"` - BaseAmount *Amount `json:"baseAmount,omitempty"` + BaseAmount *Amount `json:"baseAmount,omitempty"` // The base points. - BasePoints int32 `json:"basePoints"` - Buy *Amount `json:"buy,omitempty"` - Interbank *Amount `json:"interbank,omitempty"` + BasePoints int32 `json:"basePoints"` + Buy *Amount `json:"buy,omitempty"` + Interbank *Amount `json:"interbank,omitempty"` // The reference assigned to the forex quote request. Reference *string `json:"reference,omitempty"` - Sell *Amount `json:"sell,omitempty"` + Sell *Amount `json:"sell,omitempty"` // The signature to validate the integrity. Signature *string `json:"signature,omitempty"` // The source of the forex quote. @@ -430,7 +429,7 @@ func (o *ForexQuote) SetValidTill(v time.Time) { } func (o ForexQuote) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -509,3 +508,6 @@ func (v *NullableForexQuote) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fraud_check_result.go b/src/checkout/model_fraud_check_result.go index a4dc632f1..1222dee6d 100644 --- a/src/checkout/model_fraud_check_result.go +++ b/src/checkout/model_fraud_check_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fraud_result.go b/src/checkout/model_fraud_result.go index 68c5a7dad..850ffd31d 100644 --- a/src/checkout/model_fraud_result.go +++ b/src/checkout/model_fraud_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResult) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fund_origin.go b/src/checkout/model_fund_origin.go index bf99fba24..506238387 100644 --- a/src/checkout/model_fund_origin.go +++ b/src/checkout/model_fund_origin.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FundOrigin type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &FundOrigin{} // FundOrigin struct for FundOrigin type FundOrigin struct { BillingAddress *Address `json:"billingAddress,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` } // NewFundOrigin instantiates a new FundOrigin object @@ -105,7 +104,7 @@ func (o *FundOrigin) SetShopperName(v Name) { } func (o FundOrigin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableFundOrigin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_fund_recipient.go b/src/checkout/model_fund_recipient.go index 99223f756..2dae4f080 100644 --- a/src/checkout/model_fund_recipient.go +++ b/src/checkout/model_fund_recipient.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FundRecipient type satisfies the MappedNullable interface at compile time @@ -19,16 +18,16 @@ var _ common.MappedNullable = &FundRecipient{} // FundRecipient struct for FundRecipient type FundRecipient struct { - BillingAddress *Address `json:"billingAddress,omitempty"` - PaymentMethod *CardDetails `json:"paymentMethod,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + PaymentMethod *CardDetails `json:"paymentMethod,omitempty"` // the email address of the person ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. - StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` - SubMerchant *SubMerchant `json:"subMerchant,omitempty"` + StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` + SubMerchant *SubMerchant `json:"subMerchant,omitempty"` // the telephone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` // indicates where the money is going @@ -375,7 +374,7 @@ func (o *FundRecipient) SetWalletOwnerTaxId(v string) { } func (o FundRecipient) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -452,3 +451,6 @@ func (v *NullableFundRecipient) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_generic_issuer_payment_method_details.go b/src/checkout/model_generic_issuer_payment_method_details.go index 666451d09..41a758e2e 100644 --- a/src/checkout/model_generic_issuer_payment_method_details.go +++ b/src/checkout/model_generic_issuer_payment_method_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GenericIssuerPaymentMethodDetails type satisfies the MappedNullable interface at compile time @@ -199,7 +198,7 @@ func (o *GenericIssuerPaymentMethodDetails) SetType(v string) { } func (o GenericIssuerPaymentMethodDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -258,12 +257,14 @@ func (v *NullableGenericIssuerPaymentMethodDetails) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *GenericIssuerPaymentMethodDetails) isValidType() bool { - var allowedEnumValues = []string{"onlineBanking_PL", "eps", "onlineBanking_SK", "onlineBanking_CZ"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "onlineBanking_PL", "eps", "onlineBanking_SK", "onlineBanking_CZ" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_giropay_details.go b/src/checkout/model_giropay_details.go index e1fd55973..eee598cad 100644 --- a/src/checkout/model_giropay_details.go +++ b/src/checkout/model_giropay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GiropayDetails type satisfies the MappedNullable interface at compile time @@ -183,7 +182,7 @@ func (o *GiropayDetails) SetType(v string) { } func (o GiropayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -243,12 +242,14 @@ func (v *NullableGiropayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GiropayDetails) isValidType() bool { - var allowedEnumValues = []string{"giropay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "giropay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_google_pay_details.go b/src/checkout/model_google_pay_details.go index 3ad9dbb4b..c2a1e0ee7 100644 --- a/src/checkout/model_google_pay_details.go +++ b/src/checkout/model_google_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GooglePayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *GooglePayDetails) SetType(v string) { } func (o GooglePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableGooglePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GooglePayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *GooglePayDetails) isValidType() bool { - var allowedEnumValues = []string{"googlepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "googlepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_ideal_details.go b/src/checkout/model_ideal_details.go index 42f9937d6..f96a5b7e7 100644 --- a/src/checkout/model_ideal_details.go +++ b/src/checkout/model_ideal_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IdealDetails type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *IdealDetails) SetType(v string) { } func (o IdealDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableIdealDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IdealDetails) isValidType() bool { - var allowedEnumValues = []string{"ideal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ideal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_input_detail.go b/src/checkout/model_input_detail.go index 203b917a3..cd33f6c58 100644 --- a/src/checkout/model_input_detail.go +++ b/src/checkout/model_input_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InputDetail type satisfies the MappedNullable interface at compile time @@ -349,7 +348,7 @@ func (o *InputDetail) SetValue(v string) { } func (o InputDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -423,3 +422,6 @@ func (v *NullableInputDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_installment_option.go b/src/checkout/model_installment_option.go index bc5b26fd3..14d6adde9 100644 --- a/src/checkout/model_installment_option.go +++ b/src/checkout/model_installment_option.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InstallmentOption type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *InstallmentOption) SetValues(v []int32) { } func (o InstallmentOption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableInstallmentOption) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_installments.go b/src/checkout/model_installments.go index f59190a17..14b90bc1f 100644 --- a/src/checkout/model_installments.go +++ b/src/checkout/model_installments.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Installments type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Installments{} // Installments struct for Installments type Installments struct { - // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** Plan *string `json:"plan,omitempty"` // Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. Value int32 `json:"value"` @@ -100,7 +99,7 @@ func (o *Installments) SetValue(v int32) { } func (o Installments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableInstallments) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Installments) isValidPlan() bool { - var allowedEnumValues = []string{"regular", "revolving"} - for _, allowed := range allowedEnumValues { - if o.GetPlan() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "regular", "revolving" } + for _, allowed := range allowedEnumValues { + if o.GetPlan() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_installments_number.go b/src/checkout/model_installments_number.go index 8ad933a9e..eeb856022 100644 --- a/src/checkout/model_installments_number.go +++ b/src/checkout/model_installments_number.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InstallmentsNumber type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *InstallmentsNumber) SetMaxNumberOfInstallments(v int32) { } func (o InstallmentsNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableInstallmentsNumber) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_item.go b/src/checkout/model_item.go index 2eca14354..4481f2b36 100644 --- a/src/checkout/model_item.go +++ b/src/checkout/model_item.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Item type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Item) SetName(v string) { } func (o Item) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_klarna_details.go b/src/checkout/model_klarna_details.go index ab8a26ac7..267fab24f 100644 --- a/src/checkout/model_klarna_details.go +++ b/src/checkout/model_klarna_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the KlarnaDetails type satisfies the MappedNullable interface at compile time @@ -310,7 +309,7 @@ func (o *KlarnaDetails) SetType(v string) { } func (o KlarnaDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -380,12 +379,14 @@ func (v *NullableKlarnaDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *KlarnaDetails) isValidType() bool { - var allowedEnumValues = []string{"klarna", "klarnapayments", "klarnapayments_account", "klarnapayments_b2b", "klarna_paynow", "klarna_account", "klarna_b2b"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "klarna", "klarnapayments", "klarnapayments_account", "klarnapayments_b2b", "klarna_paynow", "klarna_account", "klarna_b2b" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_line_item.go b/src/checkout/model_line_item.go index 9fc680a1e..13c37fbb0 100644 --- a/src/checkout/model_line_item.go +++ b/src/checkout/model_line_item.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LineItem type satisfies the MappedNullable interface at compile time @@ -617,7 +616,7 @@ func (o *LineItem) SetUpc(v string) { } func (o LineItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableLineItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_list_stored_payment_methods_response.go b/src/checkout/model_list_stored_payment_methods_response.go index d9e14e9e4..5a4d0b6a8 100644 --- a/src/checkout/model_list_stored_payment_methods_response.go +++ b/src/checkout/model_list_stored_payment_methods_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListStoredPaymentMethodsResponse type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ListStoredPaymentMethodsResponse) SetStoredPaymentMethods(v []StoredPay } func (o ListStoredPaymentMethodsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableListStoredPaymentMethodsResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_mandate.go b/src/checkout/model_mandate.go index 28b1335bf..226957876 100644 --- a/src/checkout/model_mandate.go +++ b/src/checkout/model_mandate.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Mandate type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &Mandate{} type Mandate struct { // The billing amount (in minor units) of the recurring transactions. Amount string `json:"amount"` - // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. AmountRule *string `json:"amountRule,omitempty"` - // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. BillingAttemptsRule *string `json:"billingAttemptsRule,omitempty"` // The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. BillingDay *string `json:"billingDay,omitempty"` @@ -290,7 +289,7 @@ func (o *Mandate) SetStartsAt(v string) { } func (o Mandate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -356,30 +355,32 @@ func (v *NullableMandate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Mandate) isValidAmountRule() bool { - var allowedEnumValues = []string{"max", "exact"} - for _, allowed := range allowedEnumValues { - if o.GetAmountRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "max", "exact" } + for _, allowed := range allowedEnumValues { + if o.GetAmountRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidBillingAttemptsRule() bool { - var allowedEnumValues = []string{"on", "before", "after"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAttemptsRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "on", "before", "after" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAttemptsRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidFrequency() bool { - var allowedEnumValues = []string{"adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly"} - for _, allowed := range allowedEnumValues { - if o.GetFrequency() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly" } + for _, allowed := range allowedEnumValues { + if o.GetFrequency() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_masterpass_details.go b/src/checkout/model_masterpass_details.go index 0aea34f2d..7f29dd5ed 100644 --- a/src/checkout/model_masterpass_details.go +++ b/src/checkout/model_masterpass_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MasterpassDetails type satisfies the MappedNullable interface at compile time @@ -172,7 +171,7 @@ func (o *MasterpassDetails) SetType(v string) { } func (o MasterpassDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,21 +229,23 @@ func (v *NullableMasterpassDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MasterpassDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *MasterpassDetails) isValidType() bool { - var allowedEnumValues = []string{"masterpass"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "masterpass" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mbway_details.go b/src/checkout/model_mbway_details.go index bbdf301ce..86ab185b0 100644 --- a/src/checkout/model_mbway_details.go +++ b/src/checkout/model_mbway_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MbwayDetails type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &MbwayDetails{} type MbwayDetails struct { // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - // + // ShopperEmail string `json:"shopperEmail"` - // + // TelephoneNumber string `json:"telephoneNumber"` // **mbway** Type *string `json:"type,omitempty"` @@ -165,7 +164,7 @@ func (o *MbwayDetails) SetType(v string) { } func (o MbwayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,12 +220,14 @@ func (v *NullableMbwayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MbwayDetails) isValidType() bool { - var allowedEnumValues = []string{"mbway"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "mbway" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_merchant_device.go b/src/checkout/model_merchant_device.go index 87a75fa82..26caec1f3 100644 --- a/src/checkout/model_merchant_device.go +++ b/src/checkout/model_merchant_device.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDevice) SetReference(v string) { } func (o MerchantDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_merchant_risk_indicator.go b/src/checkout/model_merchant_risk_indicator.go index 6bb10743e..9d7aa38fc 100644 --- a/src/checkout/model_merchant_risk_indicator.go +++ b/src/checkout/model_merchant_risk_indicator.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantRiskIndicator type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type MerchantRiskIndicator struct { DeliveryEmailAddress *string `json:"deliveryEmailAddress,omitempty"` // The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` DeliveryTimeframe *string `json:"deliveryTimeframe,omitempty"` - GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` + GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` // For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. GiftCardCount *int32 `json:"giftCardCount,omitempty"` // For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. @@ -519,7 +518,7 @@ func (o *MerchantRiskIndicator) SetShipIndicator(v string) { } func (o MerchantRiskIndicator) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -609,21 +608,23 @@ func (v *NullableMerchantRiskIndicator) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MerchantRiskIndicator) isValidDeliveryAddressIndicator() bool { - var allowedEnumValues = []string{"shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressIndicator() == allowed { + return true + } + } + return false } func (o *MerchantRiskIndicator) isValidDeliveryTimeframe() bool { - var allowedEnumValues = []string{"electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryTimeframe() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryTimeframe() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mobile_pay_details.go b/src/checkout/model_mobile_pay_details.go index d168dd2b7..6cfa014ea 100644 --- a/src/checkout/model_mobile_pay_details.go +++ b/src/checkout/model_mobile_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MobilePayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *MobilePayDetails) SetType(v string) { } func (o MobilePayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableMobilePayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MobilePayDetails) isValidType() bool { - var allowedEnumValues = []string{"mobilepay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "mobilepay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_mol_pay_details.go b/src/checkout/model_mol_pay_details.go index a21ad59ba..33eae9b43 100644 --- a/src/checkout/model_mol_pay_details.go +++ b/src/checkout/model_mol_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MolPayDetails type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *MolPayDetails) SetType(v string) { } func (o MolPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableMolPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MolPayDetails) isValidType() bool { - var allowedEnumValues = []string{"molpay_ebanking_fpx_MY", "molpay_ebanking_TH"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "molpay_ebanking_fpx_MY", "molpay_ebanking_TH" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_name.go b/src/checkout/model_name.go index 1dc9c1791..3c12339d1 100644 --- a/src/checkout/model_name.go +++ b/src/checkout/model_name.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_open_invoice_details.go b/src/checkout/model_open_invoice_details.go index 8381fb7d8..ffdbdcff7 100644 --- a/src/checkout/model_open_invoice_details.go +++ b/src/checkout/model_open_invoice_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OpenInvoiceDetails type satisfies the MappedNullable interface at compile time @@ -285,7 +284,7 @@ func (o *OpenInvoiceDetails) SetType(v string) { } func (o OpenInvoiceDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -354,12 +353,14 @@ func (v *NullableOpenInvoiceDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *OpenInvoiceDetails) isValidType() bool { - var allowedEnumValues = []string{"openinvoice", "afterpay_directdebit", "atome_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "openinvoice", "afterpay_directdebit", "atome_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_pal_details.go b/src/checkout/model_pay_pal_details.go index 5b6de3eba..08724a4f7 100644 --- a/src/checkout/model_pay_pal_details.go +++ b/src/checkout/model_pay_pal_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayPalDetails type satisfies the MappedNullable interface at compile time @@ -344,7 +343,7 @@ func (o *PayPalDetails) SetType(v string) { } func (o PayPalDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -417,21 +416,23 @@ func (v *NullablePayPalDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayPalDetails) isValidSubtype() bool { - var allowedEnumValues = []string{"redirect", "sdk"} - for _, allowed := range allowedEnumValues { - if o.GetSubtype() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "redirect", "sdk" } + for _, allowed := range allowedEnumValues { + if o.GetSubtype() == allowed { + return true + } + } + return false } func (o *PayPalDetails) isValidType() bool { - var allowedEnumValues = []string{"paypal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paypal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_u_upi_details.go b/src/checkout/model_pay_u_upi_details.go index 5e749a879..a0cd8fc3b 100644 --- a/src/checkout/model_pay_u_upi_details.go +++ b/src/checkout/model_pay_u_upi_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayUUpiDetails type satisfies the MappedNullable interface at compile time @@ -242,7 +241,7 @@ func (o *PayUUpiDetails) SetVirtualPaymentAddress(v string) { } func (o PayUUpiDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -306,12 +305,14 @@ func (v *NullablePayUUpiDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayUUpiDetails) isValidType() bool { - var allowedEnumValues = []string{"payu_IN_upi"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "payu_IN_upi" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_pay_with_google_details.go b/src/checkout/model_pay_with_google_details.go index d942fb4a8..f5c57e31b 100644 --- a/src/checkout/model_pay_with_google_details.go +++ b/src/checkout/model_pay_with_google_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayWithGoogleDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *PayWithGoogleDetails) SetType(v string) { } func (o PayWithGoogleDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullablePayWithGoogleDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayWithGoogleDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *PayWithGoogleDetails) isValidType() bool { - var allowedEnumValues = []string{"paywithgoogle"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paywithgoogle" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_amount_update_request.go b/src/checkout/model_payment_amount_update_request.go index 008efec4b..19dda2400 100644 --- a/src/checkout/model_payment_amount_update_request.go +++ b/src/checkout/model_payment_amount_update_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentAmountUpdateRequest type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &PaymentAmountUpdateRequest{} // PaymentAmountUpdateRequest struct for PaymentAmountUpdateRequest type PaymentAmountUpdateRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** IndustryUsage *string `json:"industryUsage,omitempty"` @@ -261,7 +260,7 @@ func (o *PaymentAmountUpdateRequest) SetSplits(v []Split) { } func (o PaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -326,12 +325,14 @@ func (v *NullablePaymentAmountUpdateRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentAmountUpdateRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_amount_update_response.go b/src/checkout/model_payment_amount_update_response.go index 8806a2dd7..6de371fe6 100644 --- a/src/checkout/model_payment_amount_update_response.go +++ b/src/checkout/model_payment_amount_update_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentAmountUpdateResponse type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type PaymentAmountUpdateResponse struct { LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the amount update request. PspReference string `json:"pspReference"` @@ -302,7 +301,7 @@ func (o *PaymentAmountUpdateResponse) SetStatus(v string) { } func (o PaymentAmountUpdateResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -365,21 +364,23 @@ func (v *NullablePaymentAmountUpdateResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentAmountUpdateResponse) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } func (o *PaymentAmountUpdateResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_cancel_request.go b/src/checkout/model_payment_cancel_request.go index 97f7579e0..2d6c15331 100644 --- a/src/checkout/model_payment_cancel_request.go +++ b/src/checkout/model_payment_cancel_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentCancelRequest type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *PaymentCancelRequest) SetReference(v string) { } func (o PaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullablePaymentCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_cancel_response.go b/src/checkout/model_payment_cancel_response.go index 5f4e1d121..f54eeabc5 100644 --- a/src/checkout/model_payment_cancel_response.go +++ b/src/checkout/model_payment_cancel_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentCancelResponse type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PaymentCancelResponse{} type PaymentCancelResponse struct { // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the cancel request. PspReference string `json:"pspReference"` @@ -181,7 +180,7 @@ func (o *PaymentCancelResponse) SetStatus(v string) { } func (o PaymentCancelResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullablePaymentCancelResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentCancelResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 56e017e33..715c77282 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentCaptureRequest type satisfies the MappedNullable interface at compile time @@ -19,12 +18,12 @@ var _ common.MappedNullable = &PaymentCaptureRequest{} // PaymentCaptureRequest struct for PaymentCaptureRequest type PaymentCaptureRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the capture request. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -294,7 +293,7 @@ func (o *PaymentCaptureRequest) SetSubMerchants(v []SubMerchantInfo) { } func (o PaymentCaptureRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -361,3 +360,6 @@ func (v *NullablePaymentCaptureRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_capture_response.go b/src/checkout/model_payment_capture_response.go index b6809bdba..e3eafb8fb 100644 --- a/src/checkout/model_payment_capture_response.go +++ b/src/checkout/model_payment_capture_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentCaptureResponse type satisfies the MappedNullable interface at compile time @@ -24,8 +23,8 @@ type PaymentCaptureResponse struct { LineItems []LineItem `json:"lineItems,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. - PaymentPspReference string `json:"paymentPspReference"` + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. + PaymentPspReference string `json:"paymentPspReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Adyen's 16-character reference associated with the capture request. PspReference string `json:"pspReference"` @@ -342,7 +341,7 @@ func (o *PaymentCaptureResponse) SetSubMerchants(v []SubMerchantInfo) { } func (o PaymentCaptureResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -410,12 +409,14 @@ func (v *NullablePaymentCaptureResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentCaptureResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_completion_details.go b/src/checkout/model_payment_completion_details.go index b8d0f5b0c..2eae1c2bc 100644 --- a/src/checkout/model_payment_completion_details.go +++ b/src/checkout/model_payment_completion_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentCompletionDetails type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type PaymentCompletionDetails struct { // (3D) Payment Authentication Request data for the card issuer. PaReq *string `json:"PaReq,omitempty"` // (3D) Payment Authentication Response data by the card issuer. - PaRes *string `json:"PaRes,omitempty"` + PaRes *string `json:"PaRes,omitempty"` AuthorizationToken *string `json:"authorization_token,omitempty"` // PayPal-generated token for recurring payments. BillingToken *string `json:"billingToken,omitempty"` @@ -650,7 +649,7 @@ func (o *PaymentCompletionDetails) SetThreeds2Fingerprint(v string) { } func (o PaymentCompletionDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -751,3 +750,6 @@ func (v *NullablePaymentCompletionDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 61cb5f947..33f1f6628 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentDetails type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PaymentDetails) SetType(v string) { } func (o PaymentDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentDetails) isValidType() bool { - var allowedEnumValues = []string{"alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "paypo", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "alipay", "multibanco", "bankTransfer_IBAN", "paybright", "paynow", "affirm", "affirm_pos", "trustly", "trustlyvector", "oney", "facilypay", "facilypay_3x", "facilypay_4x", "facilypay_6x", "facilypay_10x", "facilypay_12x", "unionpay", "kcp_banktransfer", "kcp_payco", "kcp_creditcard", "wechatpaySDK", "wechatpayQR", "wechatpayWeb", "molpay_boost", "wallet_IN", "payu_IN_cashcard", "payu_IN_nb", "upi_qr", "paytm", "molpay_ebanking_VN", "paybybank", "ebanking_FI", "molpay_ebanking_MY", "molpay_ebanking_direct_MY", "swish", "pix", "walley", "walley_b2b", "alma", "paypo", "molpay_fpx", "konbini", "directEbanking", "boletobancario", "neteller", "paysafecard", "cashticket", "ikano", "karenmillen", "oasis", "warehouse", "primeiropay_boleto", "mada", "benefit", "knet", "omannet", "gopay_wallet", "kcp_naverpay", "onlinebanking_IN", "fawry", "atome", "moneybookers", "naps", "nordea", "boletobancario_bradesco", "boletobancario_itau", "boletobancario_santander", "boletobancario_bancodobrasil", "boletobancario_hsbc", "molpay_maybank2u", "molpay_cimb", "molpay_rhb", "molpay_amb", "molpay_hlb", "molpay_affin_epg", "molpay_bankislam", "molpay_publicbank", "fpx_agrobank", "touchngo", "maybank2u_mae", "duitnow", "promptpay", "twint_pos", "alipay_hk", "alipay_hk_web", "alipay_hk_wap", "alipay_wap", "balanceplatform" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_details_request.go b/src/checkout/model_payment_details_request.go index bae4ba8e4..7482ffc9f 100644 --- a/src/checkout/model_payment_details_request.go +++ b/src/checkout/model_payment_details_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentDetailsRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &PaymentDetailsRequest{} // PaymentDetailsRequest struct for PaymentDetailsRequest type PaymentDetailsRequest struct { AuthenticationData *DetailsRequestAuthenticationData `json:"authenticationData,omitempty"` - Details PaymentCompletionDetails `json:"details"` + Details PaymentCompletionDetails `json:"details"` // Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. PaymentData *string `json:"paymentData,omitempty"` // Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. @@ -170,7 +169,7 @@ func (o *PaymentDetailsRequest) SetThreeDSAuthenticationOnly(v bool) { } func (o PaymentDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -227,3 +226,6 @@ func (v *NullablePaymentDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_details_response.go b/src/checkout/model_payment_details_response.go index bdb91f6cd..f1fb7e276 100644 --- a/src/checkout/model_payment_details_response.go +++ b/src/checkout/model_payment_details_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentDetailsResponse type satisfies the MappedNullable interface at compile time @@ -21,14 +20,14 @@ var _ common.MappedNullable = &PaymentDetailsResponse{} type PaymentDetailsResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // Donation Token containing payment details for Adyen Giving. - DonationToken *string `json:"donationToken,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DonationToken *string `json:"donationToken,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The reference used during the /payments request. - MerchantReference *string `json:"merchantReference,omitempty"` - Order *CheckoutOrderResponse `json:"order,omitempty"` - PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` + MerchantReference *string `json:"merchantReference,omitempty"` + Order *CheckoutOrderResponse `json:"order,omitempty"` + PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -38,9 +37,9 @@ type PaymentDetailsResponse struct { // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. ResultCode *string `json:"resultCode,omitempty"` // The shopperLocale. - ShopperLocale *string `json:"shopperLocale,omitempty"` + ShopperLocale *string `json:"shopperLocale,omitempty"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. ThreeDSPaymentData *string `json:"threeDSPaymentData,omitempty"` } @@ -543,7 +542,7 @@ func (o *PaymentDetailsResponse) SetThreeDSPaymentData(v string) { } func (o PaymentDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -636,12 +635,14 @@ func (v *NullablePaymentDetailsResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentDetailsResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_link_request.go b/src/checkout/model_payment_link_request.go index fc570e9c0..4c832dfb4 100644 --- a/src/checkout/model_payment_link_request.go +++ b/src/checkout/model_payment_link_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentLinkRequest type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &PaymentLinkRequest{} // PaymentLinkRequest struct for PaymentLinkRequest type PaymentLinkRequest struct { // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -34,8 +33,8 @@ type PaymentLinkRequest struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. @@ -54,22 +53,22 @@ type PaymentLinkRequest struct { MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // A reference that is used to uniquely identify the payment in future communications about the payment status. Reference string `json:"reference"` - // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. RequiredShopperFields []string `json:"requiredShopperFields,omitempty"` // Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. ReturnUrl *string `json:"returnUrl,omitempty"` // Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - Reusable *bool `json:"reusable,omitempty"` + Reusable *bool `json:"reusable,omitempty"` RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -1313,7 +1312,7 @@ func (o *PaymentLinkRequest) SetThemeId(v string) { } func (o PaymentLinkRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1469,21 +1468,23 @@ func (v *NullablePaymentLinkRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentLinkRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentLinkRequest) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_link_response.go b/src/checkout/model_payment_link_response.go index 8264cbfc7..1ff291072 100644 --- a/src/checkout/model_payment_link_response.go +++ b/src/checkout/model_payment_link_response.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentLinkResponse type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &PaymentLinkResponse{} // PaymentLinkResponse struct for PaymentLinkResponse type PaymentLinkResponse struct { // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -34,8 +33,8 @@ type PaymentLinkResponse struct { // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD DateOfBirth *string `json:"dateOfBirth,omitempty"` // The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - DeliverAt *time.Time `json:"deliverAt,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // A short description visible on the payment page. Maximum length: 280 characters. Description *string `json:"description,omitempty"` // The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. @@ -56,22 +55,22 @@ type PaymentLinkResponse struct { MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` // Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. Metadata *map[string]string `json:"metadata,omitempty"` - // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // A reference that is used to uniquely identify the payment in future communications about the payment status. Reference string `json:"reference"` - // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + // List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. RequiredShopperFields []string `json:"requiredShopperFields,omitempty"` // Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. ReturnUrl *string `json:"returnUrl,omitempty"` // Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - Reusable *bool `json:"reusable,omitempty"` + Reusable *bool `json:"reusable,omitempty"` RiskData *RiskData `json:"riskData,omitempty"` // The shopper's email address. ShopperEmail *string `json:"shopperEmail,omitempty"` // The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -1428,7 +1427,7 @@ func (o *PaymentLinkResponse) SetUrl(v string) { } func (o PaymentLinkResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1590,30 +1589,32 @@ func (v *NullablePaymentLinkResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentLinkResponse) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentLinkResponse) isValidStatus() bool { - var allowedEnumValues = []string{"active", "completed", "expired", "paid", "paymentPending"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "completed", "expired", "paid", "paymentPending" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *PaymentLinkResponse) isValidStorePaymentMethodMode() bool { - var allowedEnumValues = []string{"askForConsent", "disabled", "enabled"} - for _, allowed := range allowedEnumValues { - if o.GetStorePaymentMethodMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "askForConsent", "disabled", "enabled" } + for _, allowed := range allowedEnumValues { + if o.GetStorePaymentMethodMode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_method.go b/src/checkout/model_payment_method.go index 421f84631..cc092ec69 100644 --- a/src/checkout/model_payment_method.go +++ b/src/checkout/model_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethod type satisfies the MappedNullable interface at compile time @@ -26,8 +25,8 @@ type PaymentMethod struct { // The configuration of the payment method. Configuration *map[string]string `json:"configuration,omitempty"` // The funding source of the payment method. - FundingSource *string `json:"fundingSource,omitempty"` - Group *PaymentMethodGroup `json:"group,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Group *PaymentMethodGroup `json:"group,omitempty"` // All input details to be provided to complete the payment with this payment method. // Deprecated InputDetails []InputDetail `json:"inputDetails,omitempty"` @@ -348,7 +347,7 @@ func (o *PaymentMethod) SetType(v string) { } func (o PaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -423,12 +422,14 @@ func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethod) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_method_group.go b/src/checkout/model_payment_method_group.go index af7eb66b7..947abb88c 100644 --- a/src/checkout/model_payment_method_group.go +++ b/src/checkout/model_payment_method_group.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodGroup type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PaymentMethodGroup) SetType(v string) { } func (o PaymentMethodGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullablePaymentMethodGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_method_issuer.go b/src/checkout/model_payment_method_issuer.go index 52477c3be..db11e1829 100644 --- a/src/checkout/model_payment_method_issuer.go +++ b/src/checkout/model_payment_method_issuer.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodIssuer type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *PaymentMethodIssuer) SetName(v string) { } func (o PaymentMethodIssuer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -183,3 +182,6 @@ func (v *NullablePaymentMethodIssuer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_methods_request.go b/src/checkout/model_payment_methods_request.go index 07ff9d824..fbf8fb70d 100644 --- a/src/checkout/model_payment_methods_request.go +++ b/src/checkout/model_payment_methods_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodsRequest type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type PaymentMethodsRequest struct { AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web @@ -31,8 +30,8 @@ type PaymentMethodsRequest struct { // The shopper's country code. CountryCode *string `json:"countryCode,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - Order *EncryptedOrderData `json:"order,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Order *EncryptedOrderData `json:"order,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. @@ -442,7 +441,7 @@ func (o *PaymentMethodsRequest) SetStore(v string) { } func (o PaymentMethodsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -524,12 +523,14 @@ func (v *NullablePaymentMethodsRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodsRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_methods_response.go b/src/checkout/model_payment_methods_response.go index 03703b634..b38222a26 100644 --- a/src/checkout/model_payment_methods_response.go +++ b/src/checkout/model_payment_methods_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodsResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PaymentMethodsResponse) SetStoredPaymentMethods(v []StoredPaymentMethod } func (o PaymentMethodsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePaymentMethodsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_refund_request.go b/src/checkout/model_payment_refund_request.go index b46c07486..aae11ece8 100644 --- a/src/checkout/model_payment_refund_request.go +++ b/src/checkout/model_payment_refund_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRefundRequest type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &PaymentRefundRequest{} // PaymentRefundRequest struct for PaymentRefundRequest type PaymentRefundRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` @@ -261,7 +260,7 @@ func (o *PaymentRefundRequest) SetSplits(v []Split) { } func (o PaymentRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -326,12 +325,14 @@ func (v *NullablePaymentRefundRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRefundRequest) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER" } + for _, allowed := range allowedEnumValues { + if o.GetMerchantRefundReason() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_refund_response.go b/src/checkout/model_payment_refund_response.go index d9fac716d..f606150c6 100644 --- a/src/checkout/model_payment_refund_response.go +++ b/src/checkout/model_payment_refund_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRefundResponse type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type PaymentRefundResponse struct { MerchantAccount string `json:"merchantAccount"` // Your reason for the refund request. MerchantRefundReason *string `json:"merchantRefundReason,omitempty"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the refund request. PspReference string `json:"pspReference"` @@ -309,7 +308,7 @@ func (o *PaymentRefundResponse) SetStatus(v string) { } func (o PaymentRefundResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -374,21 +373,23 @@ func (v *NullablePaymentRefundResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRefundResponse) isValidMerchantRefundReason() bool { - var allowedEnumValues = []string{"FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER"} - for _, allowed := range allowedEnumValues { - if o.GetMerchantRefundReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "FRAUD", "CUSTOMER REQUEST", "RETURN", "DUPLICATE", "OTHER" } + for _, allowed := range allowedEnumValues { + if o.GetMerchantRefundReason() == allowed { + return true + } + } + return false } func (o *PaymentRefundResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index dbbf383a6..68939003c 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRequest type satisfies the MappedNullable interface at compile time @@ -20,32 +19,32 @@ var _ common.MappedNullable = &PaymentRequest{} // PaymentRequest struct for PaymentRequest type PaymentRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` AuthenticationData *AuthenticationData `json:"authenticationData,omitempty"` - BillingAddress *BillingAddress `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + BillingAddress *BillingAddress `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web Channel *string `json:"channel,omitempty"` // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Company *Company `json:"company,omitempty"` + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + Company *Company `json:"company,omitempty"` // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. // Deprecated ConversionId *string `json:"conversionId,omitempty"` // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE CountryCode *string `json:"countryCode,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DateOfBirth *time.Time `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - DeliverAt *time.Time `json:"deliverAt,omitempty"` + DeliverAt *time.Time `json:"deliverAt,omitempty"` DeliveryAddress *DeliveryAddress `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 // Deprecated @@ -61,39 +60,39 @@ type PaymentRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` + FundOrigin *FundOrigin `json:"fundOrigin,omitempty"` FundRecipient *FundRecipient `json:"fundRecipient,omitempty"` // The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - IndustryUsage *string `json:"industryUsage,omitempty"` - Installments *Installments `json:"installments,omitempty"` + IndustryUsage *string `json:"industryUsage,omitempty"` + Installments *Installments `json:"installments,omitempty"` // Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` - Order *EncryptedOrderData `json:"order,omitempty"` + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + Metadata *map[string]string `json:"metadata,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + Order *EncryptedOrderData `json:"order,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - Origin *string `json:"origin,omitempty"` - PaymentMethod CheckoutPaymentMethod `json:"paymentMethod"` + Origin *string `json:"origin,omitempty"` + PaymentMethod CheckoutPaymentMethod `json:"paymentMethod"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` // Minimum number of days between authorisations. Only for 3D Secure 2. RecurringFrequency *string `json:"recurringFrequency,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // Specifies the redirect method (GET or POST) when redirecting back from the issuer. RedirectFromIssuerMethod *string `json:"redirectFromIssuerMethod,omitempty"` @@ -102,8 +101,8 @@ type PaymentRequest struct { // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 SessionValidity *string `json:"sessionValidity,omitempty"` // The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. @@ -114,7 +113,7 @@ type PaymentRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -128,7 +127,7 @@ type PaymentRequest struct { // When true and `shopperReference` is provided, the payment details will be stored. StorePaymentMethod *bool `json:"storePaymentMethod,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestFields `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated @@ -2277,7 +2276,7 @@ func (o *PaymentRequest) SetTrustedShopper(v bool) { } func (o PaymentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2516,48 +2515,50 @@ func (v *NullablePaymentRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"delayedCharge", "installment", "noShow"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "delayedCharge", "installment", "noShow" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_response.go b/src/checkout/model_payment_response.go index 445269d07..f6e595dc8 100644 --- a/src/checkout/model_payment_response.go +++ b/src/checkout/model_payment_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentResponse type satisfies the MappedNullable interface at compile time @@ -22,14 +21,14 @@ type PaymentResponse struct { Action *PaymentResponseAction `json:"action,omitempty"` // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` + Amount *Amount `json:"amount,omitempty"` // Donation Token containing payment details for Adyen Giving. - DonationToken *string `json:"donationToken,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DonationToken *string `json:"donationToken,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - MerchantReference *string `json:"merchantReference,omitempty"` - Order *CheckoutOrderResponse `json:"order,omitempty"` - PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` + MerchantReference *string `json:"merchantReference,omitempty"` + Order *CheckoutOrderResponse `json:"order,omitempty"` + PaymentMethod *ResponsePaymentMethod `json:"paymentMethod,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -37,9 +36,9 @@ type PaymentResponse struct { // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - ResultCode *string `json:"resultCode,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` ThreeDS2ResponseData *ThreeDS2ResponseData `json:"threeDS2ResponseData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. ThreeDSPaymentData *string `json:"threeDSPaymentData,omitempty"` } @@ -542,7 +541,7 @@ func (o *PaymentResponse) SetThreeDSPaymentData(v string) { } func (o PaymentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -635,12 +634,14 @@ func (v *NullablePaymentResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_response_action.go b/src/checkout/model_payment_response_action.go index 01fd48b0a..8b728eb55 100644 --- a/src/checkout/model_payment_response_action.go +++ b/src/checkout/model_payment_response_action.go @@ -10,19 +10,20 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // PaymentResponseAction - Action to be taken for completing the payment. type PaymentResponseAction struct { - CheckoutAwaitAction *CheckoutAwaitAction + CheckoutAwaitAction *CheckoutAwaitAction CheckoutDelegatedAuthenticationAction *CheckoutDelegatedAuthenticationAction - CheckoutNativeRedirectAction *CheckoutNativeRedirectAction - CheckoutQrCodeAction *CheckoutQrCodeAction - CheckoutRedirectAction *CheckoutRedirectAction - CheckoutSDKAction *CheckoutSDKAction - CheckoutThreeDS2Action *CheckoutThreeDS2Action - CheckoutVoucherAction *CheckoutVoucherAction + CheckoutNativeRedirectAction *CheckoutNativeRedirectAction + CheckoutQrCodeAction *CheckoutQrCodeAction + CheckoutRedirectAction *CheckoutRedirectAction + CheckoutSDKAction *CheckoutSDKAction + CheckoutThreeDS2Action *CheckoutThreeDS2Action + CheckoutVoucherAction *CheckoutVoucherAction } // CheckoutAwaitActionAsPaymentResponseAction is a convenience function that returns CheckoutAwaitAction wrapped in PaymentResponseAction @@ -81,6 +82,7 @@ func CheckoutVoucherActionAsPaymentResponseAction(v *CheckoutVoucherAction) Paym } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { var err error @@ -91,7 +93,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutAwaitAction, _ := json.Marshal(dst.CheckoutAwaitAction) if string(jsonCheckoutAwaitAction) == "{}" || !dst.CheckoutAwaitAction.isValidType() { // empty struct dst.CheckoutAwaitAction = nil - } else { + } else { match++ } } else { @@ -104,7 +106,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutDelegatedAuthenticationAction, _ := json.Marshal(dst.CheckoutDelegatedAuthenticationAction) if string(jsonCheckoutDelegatedAuthenticationAction) == "{}" || !dst.CheckoutDelegatedAuthenticationAction.isValidType() { // empty struct dst.CheckoutDelegatedAuthenticationAction = nil - } else { + } else { match++ } } else { @@ -117,7 +119,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutNativeRedirectAction, _ := json.Marshal(dst.CheckoutNativeRedirectAction) if string(jsonCheckoutNativeRedirectAction) == "{}" || !dst.CheckoutNativeRedirectAction.isValidType() { // empty struct dst.CheckoutNativeRedirectAction = nil - } else { + } else { match++ } } else { @@ -130,7 +132,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutQrCodeAction, _ := json.Marshal(dst.CheckoutQrCodeAction) if string(jsonCheckoutQrCodeAction) == "{}" || !dst.CheckoutQrCodeAction.isValidType() { // empty struct dst.CheckoutQrCodeAction = nil - } else { + } else { match++ } } else { @@ -143,7 +145,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutRedirectAction, _ := json.Marshal(dst.CheckoutRedirectAction) if string(jsonCheckoutRedirectAction) == "{}" || !dst.CheckoutRedirectAction.isValidType() { // empty struct dst.CheckoutRedirectAction = nil - } else { + } else { match++ } } else { @@ -156,7 +158,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutSDKAction, _ := json.Marshal(dst.CheckoutSDKAction) if string(jsonCheckoutSDKAction) == "{}" || !dst.CheckoutSDKAction.isValidType() { // empty struct dst.CheckoutSDKAction = nil - } else { + } else { match++ } } else { @@ -169,7 +171,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutThreeDS2Action, _ := json.Marshal(dst.CheckoutThreeDS2Action) if string(jsonCheckoutThreeDS2Action) == "{}" || !dst.CheckoutThreeDS2Action.isValidType() { // empty struct dst.CheckoutThreeDS2Action = nil - } else { + } else { match++ } } else { @@ -182,7 +184,7 @@ func (dst *PaymentResponseAction) UnmarshalJSON(data []byte) error { jsonCheckoutVoucherAction, _ := json.Marshal(dst.CheckoutVoucherAction) if string(jsonCheckoutVoucherAction) == "{}" || !dst.CheckoutVoucherAction.isValidType() { // empty struct dst.CheckoutVoucherAction = nil - } else { + } else { match++ } } else { @@ -246,7 +248,7 @@ func (src PaymentResponseAction) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *PaymentResponseAction) GetActualInstance() interface{} { +func (obj *PaymentResponseAction) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -321,3 +323,5 @@ func (v *NullablePaymentResponseAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/checkout/model_payment_reversal_request.go b/src/checkout/model_payment_reversal_request.go index a2a3c1acf..53b769b59 100644 --- a/src/checkout/model_payment_reversal_request.go +++ b/src/checkout/model_payment_reversal_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentReversalRequest type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *PaymentReversalRequest) SetReference(v string) { } func (o PaymentReversalRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullablePaymentReversalRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_reversal_response.go b/src/checkout/model_payment_reversal_response.go index 6ac1db3ed..64bdbb46e 100644 --- a/src/checkout/model_payment_reversal_response.go +++ b/src/checkout/model_payment_reversal_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentReversalResponse type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PaymentReversalResponse{} type PaymentReversalResponse struct { // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` - // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. + // The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. PaymentPspReference string `json:"paymentPspReference"` // Adyen's 16-character reference associated with the reversal request. PspReference string `json:"pspReference"` @@ -181,7 +180,7 @@ func (o *PaymentReversalResponse) SetStatus(v string) { } func (o PaymentReversalResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullablePaymentReversalResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentReversalResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_setup_request.go b/src/checkout/model_payment_setup_request.go index 4b3f9aca2..690fa6d9a 100644 --- a/src/checkout/model_payment_setup_request.go +++ b/src/checkout/model_payment_setup_request.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentSetupRequest type satisfies the MappedNullable interface at compile time @@ -24,10 +23,10 @@ type PaymentSetupRequest struct { // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` - AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` + AllowedPaymentMethods []string `json:"allowedPaymentMethods,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` // List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` BlockedPaymentMethods []string `json:"blockedPaymentMethods,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. @@ -35,18 +34,18 @@ type PaymentSetupRequest struct { // The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web Channel *string `json:"channel,omitempty"` // Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Company *Company `json:"company,omitempty"` - Configuration *Configuration `json:"configuration,omitempty"` + CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` + Company *Company `json:"company,omitempty"` + Configuration *Configuration `json:"configuration,omitempty"` // Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. // Deprecated ConversionId *string `json:"conversionId,omitempty"` // The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE CountryCode string `json:"countryCode"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. @@ -58,25 +57,25 @@ type PaymentSetupRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. LineItems []LineItem `json:"lineItems,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. - Origin *string `json:"origin,omitempty"` + Origin *string `json:"origin,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. RecurringExpiry *string `json:"recurringExpiry,omitempty"` @@ -85,8 +84,8 @@ type PaymentSetupRequest struct { // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` - ReturnUrl string `json:"returnUrl"` - RiskData *RiskData `json:"riskData,omitempty"` + ReturnUrl string `json:"returnUrl"` + RiskData *RiskData `json:"riskData,omitempty"` // The version of the SDK you are using (for Web SDK integrations only). SdkVersion *string `json:"sdkVersion,omitempty"` // The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 @@ -99,7 +98,7 @@ type PaymentSetupRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -1908,7 +1907,7 @@ func (o *PaymentSetupRequest) SetTrustedShopper(v bool) { } func (o PaymentSetupRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2114,30 +2113,32 @@ func (v *NullablePaymentSetupRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentSetupRequest) isValidChannel() bool { - var allowedEnumValues = []string{"iOS", "Android", "Web"} - for _, allowed := range allowedEnumValues { - if o.GetChannel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iOS", "Android", "Web" } + for _, allowed := range allowedEnumValues { + if o.GetChannel() == allowed { + return true + } + } + return false } func (o *PaymentSetupRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } func (o *PaymentSetupRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_payment_setup_response.go b/src/checkout/model_payment_setup_response.go index 9f54aabb0..a0c903d65 100644 --- a/src/checkout/model_payment_setup_response.go +++ b/src/checkout/model_payment_setup_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentSetupResponse type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *PaymentSetupResponse) SetRecurringDetails(v []RecurringDetail) { } func (o PaymentSetupResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -164,3 +163,6 @@ func (v *NullablePaymentSetupResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_verification_request.go b/src/checkout/model_payment_verification_request.go index 541bb59f2..f9cd0451f 100644 --- a/src/checkout/model_payment_verification_request.go +++ b/src/checkout/model_payment_verification_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentVerificationRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *PaymentVerificationRequest) SetPayload(v string) { } func (o PaymentVerificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullablePaymentVerificationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 92163443a..2aa43742c 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentVerificationResponse type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &PaymentVerificationResponse{} type PaymentVerificationResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // A unique value that you provided in the initial `/paymentSession` request as a `reference` field. - MerchantReference string `json:"merchantReference"` - Order *CheckoutOrderResponse `json:"order,omitempty"` + MerchantReference string `json:"merchantReference"` + Order *CheckoutOrderResponse `json:"order,omitempty"` // Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). @@ -32,7 +31,7 @@ type PaymentVerificationResponse struct { // Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). RefusalReasonCode *string `json:"refusalReasonCode,omitempty"` // The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - ResultCode *string `json:"resultCode,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` ServiceError *ServiceErrorDetails `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. ShopperLocale string `json:"shopperLocale"` @@ -362,7 +361,7 @@ func (o *PaymentVerificationResponse) SetShopperLocale(v string) { } func (o PaymentVerificationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -436,12 +435,14 @@ func (v *NullablePaymentVerificationResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentVerificationResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_phone.go b/src/checkout/model_phone.go index e4c6782a6..f31a4d80c 100644 --- a/src/checkout/model_phone.go +++ b/src/checkout/model_phone.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Phone) SetSubscriber(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_platform_chargeback_logic.go b/src/checkout/model_platform_chargeback_logic.go index 0ce5ec062..ff03f5cb8 100644 --- a/src/checkout/model_platform_chargeback_logic.go +++ b/src/checkout/model_platform_chargeback_logic.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PlatformChargebackLogic type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PlatformChargebackLogic) SetTargetAccount(v string) { } func (o PlatformChargebackLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullablePlatformChargebackLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PlatformChargebackLogic) isValidBehavior() bool { - var allowedEnumValues = []string{"deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetBehavior() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetBehavior() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_ratepay_details.go b/src/checkout/model_ratepay_details.go index 8c9e5e8c7..1ad9ed87e 100644 --- a/src/checkout/model_ratepay_details.go +++ b/src/checkout/model_ratepay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RatepayDetails type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *RatepayDetails) SetType(v string) { } func (o RatepayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -343,12 +342,14 @@ func (v *NullableRatepayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *RatepayDetails) isValidType() bool { - var allowedEnumValues = []string{"ratepay", "ratepay_directdebit"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ratepay", "ratepay_directdebit" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_recurring.go b/src/checkout/model_recurring.go index 69f39fbc5..b17ddc6e3 100644 --- a/src/checkout/model_recurring.go +++ b/src/checkout/model_recurring.go @@ -10,9 +10,8 @@ package checkout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_recurring_detail.go b/src/checkout/model_recurring_detail.go index 1f6eb92b4..632740870 100644 --- a/src/checkout/model_recurring_detail.go +++ b/src/checkout/model_recurring_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RecurringDetail type satisfies the MappedNullable interface at compile time @@ -26,8 +25,8 @@ type RecurringDetail struct { // The configuration of the payment method. Configuration *map[string]string `json:"configuration,omitempty"` // The funding source of the payment method. - FundingSource *string `json:"fundingSource,omitempty"` - Group *PaymentMethodGroup `json:"group,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Group *PaymentMethodGroup `json:"group,omitempty"` // All input details to be provided to complete the payment with this payment method. // Deprecated InputDetails []InputDetail `json:"inputDetails,omitempty"` @@ -36,8 +35,8 @@ type RecurringDetail struct { // The displayable name of this payment method. Name *string `json:"name,omitempty"` // The reference that uniquely identifies the recurring detail. - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` - StoredDetails *StoredDetails `json:"storedDetails,omitempty"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + StoredDetails *StoredDetails `json:"storedDetails,omitempty"` // The unique payment method code. Type *string `json:"type,omitempty"` } @@ -415,7 +414,7 @@ func (o *RecurringDetail) SetType(v string) { } func (o RecurringDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -496,12 +495,14 @@ func (v *NullableRecurringDetail) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *RecurringDetail) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_response_additional_data3_d_secure.go b/src/checkout/model_response_additional_data3_d_secure.go index bacbd5342..fe8aad033 100644 --- a/src/checkout/model_response_additional_data3_d_secure.go +++ b/src/checkout/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_billing_address.go b/src/checkout/model_response_additional_data_billing_address.go index bd146627c..ff503a634 100644 --- a/src/checkout/model_response_additional_data_billing_address.go +++ b/src/checkout/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_card.go b/src/checkout/model_response_additional_data_card.go index 5c3746eed..545aa6030 100644 --- a/src/checkout/model_response_additional_data_card.go +++ b/src/checkout/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_common.go b/src/checkout/model_response_additional_data_common.go index 62215a14e..4b7eaca8c 100644 --- a/src/checkout/model_response_additional_data_common.go +++ b/src/checkout/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_response_additional_data_domestic_error.go b/src/checkout/model_response_additional_data_domestic_error.go index 9793cf5e9..1a0716223 100644 --- a/src/checkout/model_response_additional_data_domestic_error.go +++ b/src/checkout/model_response_additional_data_domestic_error.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataDomesticError type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ResponseAdditionalDataDomesticError) SetDomesticShopperAdvice(v string) } func (o ResponseAdditionalDataDomesticError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableResponseAdditionalDataDomesticError) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_installments.go b/src/checkout/model_response_additional_data_installments.go index a75ae1701..a15b1659f 100644 --- a/src/checkout/model_response_additional_data_installments.go +++ b/src/checkout/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_network_tokens.go b/src/checkout/model_response_additional_data_network_tokens.go index aac040f99..a5d1aceef 100644 --- a/src/checkout/model_response_additional_data_network_tokens.go +++ b/src/checkout/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_opi.go b/src/checkout/model_response_additional_data_opi.go index aede45fa8..67819082e 100644 --- a/src/checkout/model_response_additional_data_opi.go +++ b/src/checkout/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_additional_data_sepa.go b/src/checkout/model_response_additional_data_sepa.go index fb44dfb92..07128a620 100644 --- a/src/checkout/model_response_additional_data_sepa.go +++ b/src/checkout/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_response_payment_method.go b/src/checkout/model_response_payment_method.go index 61c1cc867..478073040 100644 --- a/src/checkout/model_response_payment_method.go +++ b/src/checkout/model_response_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponsePaymentMethod type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ResponsePaymentMethod) SetType(v string) { } func (o ResponsePaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableResponsePaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_risk_data.go b/src/checkout/model_risk_data.go index c754d1987..9b1a06ff0 100644 --- a/src/checkout/model_risk_data.go +++ b/src/checkout/model_risk_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RiskData type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *RiskData) SetProfileReference(v string) { } func (o RiskData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableRiskData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_samsung_pay_details.go b/src/checkout/model_samsung_pay_details.go index 029f56d9f..11935b3ff 100644 --- a/src/checkout/model_samsung_pay_details.go +++ b/src/checkout/model_samsung_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SamsungPayDetails type satisfies the MappedNullable interface at compile time @@ -244,7 +243,7 @@ func (o *SamsungPayDetails) SetType(v string) { } func (o SamsungPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,21 +307,23 @@ func (v *NullableSamsungPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SamsungPayDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *SamsungPayDetails) isValidType() bool { - var allowedEnumValues = []string{"samsungpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "samsungpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_sdk_ephem_pub_key.go b/src/checkout/model_sdk_ephem_pub_key.go index 0e53e9a62..2e16b0a65 100644 --- a/src/checkout/model_sdk_ephem_pub_key.go +++ b/src/checkout/model_sdk_ephem_pub_key.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SDKEphemPubKey type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *SDKEphemPubKey) SetY(v string) { } func (o SDKEphemPubKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSDKEphemPubKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sepa_direct_debit_details.go b/src/checkout/model_sepa_direct_debit_details.go index e6ca475e0..f22eaca3e 100644 --- a/src/checkout/model_sepa_direct_debit_details.go +++ b/src/checkout/model_sepa_direct_debit_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SepaDirectDebitDetails type satisfies the MappedNullable interface at compile time @@ -237,7 +236,7 @@ func (o *SepaDirectDebitDetails) SetType(v string) { } func (o SepaDirectDebitDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,12 +298,14 @@ func (v *NullableSepaDirectDebitDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SepaDirectDebitDetails) isValidType() bool { - var allowedEnumValues = []string{"sepadirectdebit", "sepadirectdebit_amazonpay"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sepadirectdebit", "sepadirectdebit_amazonpay" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_service_error.go b/src/checkout/model_service_error.go index 81e78e0ee..d7d2c6c18 100644 --- a/src/checkout/model_service_error.go +++ b/src/checkout/model_service_error.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_service_error_details.go b/src/checkout/model_service_error_details.go index 95fb00855..d67dd5bee 100644 --- a/src/checkout/model_service_error_details.go +++ b/src/checkout/model_service_error_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceErrorDetails type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &ServiceErrorDetails{} // ServiceErrorDetails struct for ServiceErrorDetails type ServiceErrorDetails struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorType *string `json:"errorType,omitempty"` - Message *string `json:"message,omitempty"` + ErrorCode *string `json:"errorCode,omitempty"` + ErrorType *string `json:"errorType,omitempty"` + Message *string `json:"message,omitempty"` PspReference *string `json:"pspReference,omitempty"` } @@ -171,7 +170,7 @@ func (o *ServiceErrorDetails) SetPspReference(v string) { } func (o ServiceErrorDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,3 +229,6 @@ func (v *NullableServiceErrorDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_session_result_response.go b/src/checkout/model_session_result_response.go index e5eae54f8..16d7a940f 100644 --- a/src/checkout/model_session_result_response.go +++ b/src/checkout/model_session_result_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SessionResultResponse type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SessionResultResponse{} type SessionResultResponse struct { // A unique identifier of the session. Id *string `json:"id,omitempty"` - // The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed** – The shopper completed the payment. This means that the payment was authorized. * **paymentPending** – The shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow. * **refused** – The session has been refused, due to too many refused payment attempts. Shoppers can no longer complete the payment with this session. * **canceled** – The shopper canceled the payment. * **active** – The session is still active and can be paid. * **expired** – The session expired (default: 1 hour after session creation). Shoppers can no longer complete the payment with this session. + // The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed** – The shopper completed the payment. This means that the payment was authorized. * **paymentPending** – The shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow. * **refused** – The session has been refused, due to too many refused payment attempts. Shoppers can no longer complete the payment with this session. * **canceled** – The shopper canceled the payment. * **active** – The session is still active and can be paid. * **expired** – The session expired (default: 1 hour after session creation). Shoppers can no longer complete the payment with this session. Status *string `json:"status,omitempty"` } @@ -107,7 +106,7 @@ func (o *SessionResultResponse) SetStatus(v string) { } func (o SessionResultResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableSessionResultResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SessionResultResponse) isValidStatus() bool { - var allowedEnumValues = []string{"active", "canceled", "completed", "expired", "paymentPending", "refused"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "canceled", "completed", "expired", "paymentPending", "refused" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_shopper_input.go b/src/checkout/model_shopper_input.go index 8bba71d5f..de740c60a 100644 --- a/src/checkout/model_shopper_input.go +++ b/src/checkout/model_shopper_input.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ShopperInput type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInput) SetPersonalDetails(v string) { } func (o ShopperInput) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,30 +197,32 @@ func (v *NullableShopperInput) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ShopperInput) isValidBillingAddress() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAddress() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAddress() == allowed { + return true + } + } + return false } func (o *ShopperInput) isValidDeliveryAddress() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddress() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddress() == allowed { + return true + } + } + return false } func (o *ShopperInput) isValidPersonalDetails() bool { - var allowedEnumValues = []string{"editable", "hidden", "readOnly"} - for _, allowed := range allowedEnumValues { - if o.GetPersonalDetails() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "editable", "hidden", "readOnly" } + for _, allowed := range allowedEnumValues { + if o.GetPersonalDetails() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_shopper_interaction_device.go b/src/checkout/model_shopper_interaction_device.go index c5eac1b8e..53c56dc45 100644 --- a/src/checkout/model_shopper_interaction_device.go +++ b/src/checkout/model_shopper_interaction_device.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ShopperInteractionDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInteractionDevice) SetOsVersion(v string) { } func (o ShopperInteractionDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableShopperInteractionDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_split.go b/src/checkout/model_split.go index 94e64de6a..783764c29 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Split type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { // The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. - Account *string `json:"account,omitempty"` - Amount *SplitAmount `json:"amount,omitempty"` + Account *string `json:"account,omitempty"` + Amount *SplitAmount `json:"amount,omitempty"` // Your description for the split item. Description *string `json:"description,omitempty"` // Your unique reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. @@ -201,7 +200,7 @@ func (o *Split) SetType(v string) { } func (o Split) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -262,12 +261,14 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_split_amount.go b/src/checkout/model_split_amount.go index e1dbba771..4c70d6cba 100644 --- a/src/checkout/model_split_amount.go +++ b/src/checkout/model_split_amount.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitAmount type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *SplitAmount) SetValue(v int64) { } func (o SplitAmount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableSplitAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_standalone_payment_cancel_request.go b/src/checkout/model_standalone_payment_cancel_request.go index 6e69a66b7..55b722e5e 100644 --- a/src/checkout/model_standalone_payment_cancel_request.go +++ b/src/checkout/model_standalone_payment_cancel_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StandalonePaymentCancelRequest type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *StandalonePaymentCancelRequest) SetReference(v string) { } func (o StandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableStandalonePaymentCancelRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_standalone_payment_cancel_response.go b/src/checkout/model_standalone_payment_cancel_response.go index 6f2931a78..80c944ab7 100644 --- a/src/checkout/model_standalone_payment_cancel_response.go +++ b/src/checkout/model_standalone_payment_cancel_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StandalonePaymentCancelResponse type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *StandalonePaymentCancelResponse) SetStatus(v string) { } func (o StandalonePaymentCancelResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -236,12 +235,14 @@ func (v *NullableStandalonePaymentCancelResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StandalonePaymentCancelResponse) isValidStatus() bool { - var allowedEnumValues = []string{"received"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "received" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_stored_details.go b/src/checkout/model_stored_details.go index ed45cb4c6..0bfe61c11 100644 --- a/src/checkout/model_stored_details.go +++ b/src/checkout/model_stored_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredDetails type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &StoredDetails{} // StoredDetails struct for StoredDetails type StoredDetails struct { Bank *BankAccount `json:"bank,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // The email associated with stored payment details. EmailAddress *string `json:"emailAddress,omitempty"` } @@ -139,7 +138,7 @@ func (o *StoredDetails) SetEmailAddress(v string) { } func (o StoredDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,3 +194,6 @@ func (v *NullableStoredDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_stored_payment_method.go b/src/checkout/model_stored_payment_method.go index 1b99dd393..1bbc88170 100644 --- a/src/checkout/model_stored_payment_method.go +++ b/src/checkout/model_stored_payment_method.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredPaymentMethod type satisfies the MappedNullable interface at compile time @@ -515,7 +514,7 @@ func (o *StoredPaymentMethod) SetType(v string) { } func (o StoredPaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -604,3 +603,6 @@ func (v *NullableStoredPaymentMethod) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_stored_payment_method_details.go b/src/checkout/model_stored_payment_method_details.go index 035c87a80..d87dd2e09 100644 --- a/src/checkout/model_stored_payment_method_details.go +++ b/src/checkout/model_stored_payment_method_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredPaymentMethodDetails type satisfies the MappedNullable interface at compile time @@ -179,7 +178,7 @@ func (o *StoredPaymentMethodDetails) SetType(v string) { } func (o StoredPaymentMethodDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,12 +238,14 @@ func (v *NullableStoredPaymentMethodDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredPaymentMethodDetails) isValidType() bool { - var allowedEnumValues = []string{"bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "dana", "kakaopay", "truemoney"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bcmc_mobile", "bcmc_mobile_QR", "bcmc_mobile_app", "momo_wallet", "momo_wallet_app", "twint", "paymaya_wallet", "grabpay_SG", "grabpay_MY", "grabpay_TH", "grabpay_ID", "grabpay_VN", "grabpay_PH", "oxxo", "gcash", "dana", "kakaopay", "truemoney" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_stored_payment_method_resource.go b/src/checkout/model_stored_payment_method_resource.go index 12a05ebe3..ff7cf3f6f 100644 --- a/src/checkout/model_stored_payment_method_resource.go +++ b/src/checkout/model_stored_payment_method_resource.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredPaymentMethodResource type satisfies the MappedNullable interface at compile time @@ -617,7 +616,7 @@ func (o *StoredPaymentMethodResource) SetType(v string) { } func (o StoredPaymentMethodResource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableStoredPaymentMethodResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sub_input_detail.go b/src/checkout/model_sub_input_detail.go index af87aac9b..11e0c2487 100644 --- a/src/checkout/model_sub_input_detail.go +++ b/src/checkout/model_sub_input_detail.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubInputDetail type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *SubInputDetail) SetValue(v string) { } func (o SubInputDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableSubInputDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sub_merchant.go b/src/checkout/model_sub_merchant.go index ce4447589..633a78133 100644 --- a/src/checkout/model_sub_merchant.go +++ b/src/checkout/model_sub_merchant.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubMerchant type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *SubMerchant) SetTaxId(v string) { } func (o SubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_sub_merchant_info.go b/src/checkout/model_sub_merchant_info.go index 4caff73d8..38496b1e0 100644 --- a/src/checkout/model_sub_merchant_info.go +++ b/src/checkout/model_sub_merchant_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubMerchantInfo type satisfies the MappedNullable interface at compile time @@ -20,10 +19,10 @@ var _ common.MappedNullable = &SubMerchantInfo{} // SubMerchantInfo struct for SubMerchantInfo type SubMerchantInfo struct { Address *BillingAddress `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Mcc *string `json:"mcc,omitempty"` - Name *string `json:"name,omitempty"` - TaxId *string `json:"taxId,omitempty"` + Id *string `json:"id,omitempty"` + Mcc *string `json:"mcc,omitempty"` + Name *string `json:"name,omitempty"` + TaxId *string `json:"taxId,omitempty"` } // NewSubMerchantInfo instantiates a new SubMerchantInfo object @@ -204,7 +203,7 @@ func (o *SubMerchantInfo) SetTaxId(v string) { } func (o SubMerchantInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -266,3 +265,6 @@ func (v *NullableSubMerchantInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_three_d_secure_data.go b/src/checkout/model_three_d_secure_data.go index 5deb62498..8d00cbccf 100644 --- a/src/checkout/model_three_d_secure_data.go +++ b/src/checkout/model_three_d_secure_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSecureData type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ThreeDSecureData) SetXid(v string) { } func (o ThreeDSecureData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -531,30 +530,32 @@ func (v *NullableThreeDSecureData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSecureData) isValidAuthenticationResponse() bool { - var allowedEnumValues = []string{"Y", "N", "U", "A"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N", "U", "A" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationResponse() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidDirectoryResponse() bool { - var allowedEnumValues = []string{"A", "C", "D", "I", "N", "R", "U", "Y"} - for _, allowed := range allowedEnumValues { - if o.GetDirectoryResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "A", "C", "D", "I", "N", "R", "U", "Y" } + for _, allowed := range allowedEnumValues { + if o.GetDirectoryResponse() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds2_request_data.go b/src/checkout/model_three_ds2_request_data.go index 3e7e8b536..4e948f40e 100644 --- a/src/checkout/model_three_ds2_request_data.go +++ b/src/checkout/model_three_ds2_request_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2RequestData type satisfies the MappedNullable interface at compile time @@ -31,20 +30,20 @@ type ThreeDS2RequestData struct { // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` - // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` // Deprecated ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The environment of the shopper. Allowed values: * `app` * `browser` - DeviceChannel string `json:"deviceChannel"` + DeviceChannel string `json:"deviceChannel"` DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` - HomePhone *Phone `json:"homePhone,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. Mcc *string `json:"mcc,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. MerchantName *string `json:"merchantName,omitempty"` // The `messageVersion` value indicating the 3D Secure 2 protocol version. MessageVersion *string `json:"messageVersion,omitempty"` - MobilePhone *Phone `json:"mobilePhone,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. NotificationURL *string `json:"notificationURL,omitempty"` // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. @@ -60,7 +59,7 @@ type ThreeDS2RequestData struct { // The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. SdkAppID *string `json:"sdkAppID,omitempty"` // The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - SdkEncData *string `json:"sdkEncData,omitempty"` + SdkEncData *string `json:"sdkEncData,omitempty"` SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` @@ -73,14 +72,14 @@ type ThreeDS2RequestData struct { // Completion indicator for the device fingerprinting. ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` // Indicates the type of Authentication request. - ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` @@ -90,7 +89,7 @@ type ThreeDS2RequestData struct { TransactionType *string `json:"transactionType,omitempty"` // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. WhiteListStatus *string `json:"whiteListStatus,omitempty"` - WorkPhone *Phone `json:"workPhone,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` } // NewThreeDS2RequestData instantiates a new ThreeDS2RequestData object @@ -1366,7 +1365,7 @@ func (o *ThreeDS2RequestData) SetWorkPhone(v Phone) { } func (o ThreeDS2RequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1529,57 +1528,59 @@ func (v *NullableThreeDS2RequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2RequestData) isValidAcctType() bool { - var allowedEnumValues = []string{"01", "02", "03"} - for _, allowed := range allowedEnumValues { - if o.GetAcctType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidAddrMatch() bool { - var allowedEnumValues = []string{"Y", "N"} - for _, allowed := range allowedEnumValues { - if o.GetAddrMatch() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransType() bool { - var allowedEnumValues = []string{"01", "03", "10", "11", "28"} - for _, allowed := range allowedEnumValues { - if o.GetTransType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransactionType() bool { - var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} - for _, allowed := range allowedEnumValues { - if o.GetTransactionType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds2_request_fields.go b/src/checkout/model_three_ds2_request_fields.go index 4bb6a1af0..8d2dd613e 100644 --- a/src/checkout/model_three_ds2_request_fields.go +++ b/src/checkout/model_three_ds2_request_fields.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2RequestFields type satisfies the MappedNullable interface at compile time @@ -31,18 +30,18 @@ type ThreeDS2RequestFields struct { // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` - // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` // Deprecated - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` + ChallengeIndicator *string `json:"challengeIndicator,omitempty"` DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` - HomePhone *Phone `json:"homePhone,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. Mcc *string `json:"mcc,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. MerchantName *string `json:"merchantName,omitempty"` // The `messageVersion` value indicating the 3D Secure 2 protocol version. MessageVersion *string `json:"messageVersion,omitempty"` - MobilePhone *Phone `json:"mobilePhone,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. NotificationURL *string `json:"notificationURL,omitempty"` // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. @@ -56,7 +55,7 @@ type ThreeDS2RequestFields struct { // Indicates the minimum number of days between authorisations. Maximum length: 4 characters. RecurringFrequency *string `json:"recurringFrequency,omitempty"` // The `sdkAppID` value as received from the 3D Secure 2 SDK. - SdkAppID *string `json:"sdkAppID,omitempty"` + SdkAppID *string `json:"sdkAppID,omitempty"` SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` @@ -67,14 +66,14 @@ type ThreeDS2RequestFields struct { // Completion indicator for the device fingerprinting. ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` // Indicates the type of Authentication request. - ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` @@ -84,7 +83,7 @@ type ThreeDS2RequestFields struct { TransactionType *string `json:"transactionType,omitempty"` // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. WhiteListStatus *string `json:"whiteListStatus,omitempty"` - WorkPhone *Phone `json:"workPhone,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` } // NewThreeDS2RequestFields instantiates a new ThreeDS2RequestFields object @@ -1271,7 +1270,7 @@ func (o *ThreeDS2RequestFields) SetWorkPhone(v Phone) { } func (o ThreeDS2RequestFields) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1427,57 +1426,59 @@ func (v *NullableThreeDS2RequestFields) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2RequestFields) isValidAcctType() bool { - var allowedEnumValues = []string{"01", "02", "03"} - for _, allowed := range allowedEnumValues { - if o.GetAcctType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestFields) isValidAddrMatch() bool { - var allowedEnumValues = []string{"Y", "N"} - for _, allowed := range allowedEnumValues { - if o.GetAddrMatch() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestFields) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestFields) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestFields) isValidTransType() bool { - var allowedEnumValues = []string{"01", "03", "10", "11", "28"} - for _, allowed := range allowedEnumValues { - if o.GetTransType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestFields) isValidTransactionType() bool { - var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} - for _, allowed := range allowedEnumValues { - if o.GetTransactionType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds2_response_data.go b/src/checkout/model_three_ds2_response_data.go index e9619bd83..97f7aa540 100644 --- a/src/checkout/model_three_ds2_response_data.go +++ b/src/checkout/model_three_ds2_response_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2ResponseData type satisfies the MappedNullable interface at compile time @@ -20,24 +19,24 @@ var _ common.MappedNullable = &ThreeDS2ResponseData{} // ThreeDS2ResponseData struct for ThreeDS2ResponseData type ThreeDS2ResponseData struct { AcsChallengeMandated *string `json:"acsChallengeMandated,omitempty"` - AcsOperatorID *string `json:"acsOperatorID,omitempty"` - AcsReferenceNumber *string `json:"acsReferenceNumber,omitempty"` - AcsSignedContent *string `json:"acsSignedContent,omitempty"` - AcsTransID *string `json:"acsTransID,omitempty"` - AcsURL *string `json:"acsURL,omitempty"` - AuthenticationType *string `json:"authenticationType,omitempty"` - CardHolderInfo *string `json:"cardHolderInfo,omitempty"` - CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` - DsReferenceNumber *string `json:"dsReferenceNumber,omitempty"` - DsTransID *string `json:"dsTransID,omitempty"` - ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` - MessageVersion *string `json:"messageVersion,omitempty"` - RiskScore *string `json:"riskScore,omitempty"` - SdkEphemPubKey *string `json:"sdkEphemPubKey,omitempty"` + AcsOperatorID *string `json:"acsOperatorID,omitempty"` + AcsReferenceNumber *string `json:"acsReferenceNumber,omitempty"` + AcsSignedContent *string `json:"acsSignedContent,omitempty"` + AcsTransID *string `json:"acsTransID,omitempty"` + AcsURL *string `json:"acsURL,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + CardHolderInfo *string `json:"cardHolderInfo,omitempty"` + CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` + ChallengeIndicator *string `json:"challengeIndicator,omitempty"` + DsReferenceNumber *string `json:"dsReferenceNumber,omitempty"` + DsTransID *string `json:"dsTransID,omitempty"` + ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` + MessageVersion *string `json:"messageVersion,omitempty"` + RiskScore *string `json:"riskScore,omitempty"` + SdkEphemPubKey *string `json:"sdkEphemPubKey,omitempty"` ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` - TransStatus *string `json:"transStatus,omitempty"` - TransStatusReason *string `json:"transStatusReason,omitempty"` + TransStatus *string `json:"transStatus,omitempty"` + TransStatusReason *string `json:"transStatusReason,omitempty"` } // NewThreeDS2ResponseData instantiates a new ThreeDS2ResponseData object @@ -666,7 +665,7 @@ func (o *ThreeDS2ResponseData) SetTransStatusReason(v string) { } func (o ThreeDS2ResponseData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -770,3 +769,6 @@ func (v *NullableThreeDS2ResponseData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_three_ds2_result.go b/src/checkout/model_three_ds2_result.go index 6a50a401b..e9a0ae1cd 100644 --- a/src/checkout/model_three_ds2_result.go +++ b/src/checkout/model_three_ds2_result.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2Result type satisfies the MappedNullable interface at compile time @@ -29,7 +28,7 @@ type ThreeDS2Result struct { DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. Eci *string `json:"eci,omitempty"` - // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` // The `messageVersion` value as defined in the 3D Secure 2 specification. MessageVersion *string `json:"messageVersion,omitempty"` @@ -515,7 +514,7 @@ func (o *ThreeDS2Result) SetWhiteListStatus(v string) { } func (o ThreeDS2Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -605,30 +604,32 @@ func (v *NullableThreeDS2Result) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2Result) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} - for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis" } + for _, allowed := range allowedEnumValues { + if o.GetExemptionIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_request_data.go b/src/checkout/model_three_ds_request_data.go index 33eff0451..8d5bd79c5 100644 --- a/src/checkout/model_three_ds_request_data.go +++ b/src/checkout/model_three_ds_request_data.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSRequestData type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestData) SetThreeDSVersion(v string) { } func (o ThreeDSRequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,39 +234,41 @@ func (v *NullableThreeDSRequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestData) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidDataOnly() bool { - var allowedEnumValues = []string{"false", "true"} - for _, allowed := range allowedEnumValues { - if o.GetDataOnly() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "false", "true" } + for _, allowed := range allowedEnumValues { + if o.GetDataOnly() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidNativeThreeDS() bool { - var allowedEnumValues = []string{"preferred"} - for _, allowed := range allowedEnumValues { - if o.GetNativeThreeDS() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "preferred" } + for _, allowed := range allowedEnumValues { + if o.GetNativeThreeDS() == allowed { + return true + } + } + return false } func (o *ThreeDSRequestData) isValidThreeDSVersion() bool { - var allowedEnumValues = []string{"2.1.0", "2.2.0"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSVersion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "2.1.0", "2.2.0" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSVersion() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_requestor_authentication_info.go b/src/checkout/model_three_ds_requestor_authentication_info.go index a677adf6c..3ed9852d8 100644 --- a/src/checkout/model_three_ds_requestor_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_authentication_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSRequestorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ThreeDSRequestorAuthenticationInfo) SetThreeDSReqAuthTimestamp(v string } func (o ThreeDSRequestorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableThreeDSRequestorAuthenticationInfo) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorAuthenticationInfo) isValidThreeDSReqAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_three_ds_requestor_prior_authentication_info.go b/src/checkout/model_three_ds_requestor_prior_authentication_info.go index 9a41f8466..798e01906 100644 --- a/src/checkout/model_three_ds_requestor_prior_authentication_info.go +++ b/src/checkout/model_three_ds_requestor_prior_authentication_info.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSRequestorPriorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestorPriorAuthenticationInfo) SetThreeDSReqPriorRef(v string } func (o ThreeDSRequestorPriorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableThreeDSRequestorPriorAuthenticationInfo) UnmarshalJSON(src []by return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorPriorAuthenticationInfo) isValidThreeDSReqPriorAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqPriorAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqPriorAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_update_payment_link_request.go b/src/checkout/model_update_payment_link_request.go index a23828083..96097d0b6 100644 --- a/src/checkout/model_update_payment_link_request.go +++ b/src/checkout/model_update_payment_link_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdatePaymentLinkRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *UpdatePaymentLinkRequest) SetStatus(v string) { } func (o UpdatePaymentLinkRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -115,12 +114,14 @@ func (v *NullableUpdatePaymentLinkRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdatePaymentLinkRequest) isValidStatus() bool { - var allowedEnumValues = []string{"expired"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "expired" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_upi_collect_details.go b/src/checkout/model_upi_collect_details.go index c3d9e4090..d80c692bf 100644 --- a/src/checkout/model_upi_collect_details.go +++ b/src/checkout/model_upi_collect_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpiCollectDetails type satisfies the MappedNullable interface at compile time @@ -269,7 +268,7 @@ func (o *UpiCollectDetails) SetVirtualPaymentAddress(v string) { } func (o UpiCollectDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -334,12 +333,14 @@ func (v *NullableUpiCollectDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpiCollectDetails) isValidType() bool { - var allowedEnumValues = []string{"upi_collect"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "upi_collect" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_upi_intent_details.go b/src/checkout/model_upi_intent_details.go index 4f0cd2c65..c640473f6 100644 --- a/src/checkout/model_upi_intent_details.go +++ b/src/checkout/model_upi_intent_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpiIntentDetails type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *UpiIntentDetails) SetType(v string) { } func (o UpiIntentDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -269,12 +268,14 @@ func (v *NullableUpiIntentDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpiIntentDetails) isValidType() bool { - var allowedEnumValues = []string{"upi_intent"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "upi_intent" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_utility_request.go b/src/checkout/model_utility_request.go index 496906050..91049be6d 100644 --- a/src/checkout/model_utility_request.go +++ b/src/checkout/model_utility_request.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UtilityRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *UtilityRequest) SetOriginDomains(v []string) { } func (o UtilityRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableUtilityRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_utility_response.go b/src/checkout/model_utility_response.go index c042d560f..b01f1c9c7 100644 --- a/src/checkout/model_utility_response.go +++ b/src/checkout/model_utility_response.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UtilityResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *UtilityResponse) SetOriginKeys(v map[string]string) { } func (o UtilityResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableUtilityResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/checkout/model_vipps_details.go b/src/checkout/model_vipps_details.go index c5d084d7e..9b88cc46e 100644 --- a/src/checkout/model_vipps_details.go +++ b/src/checkout/model_vipps_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VippsDetails type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type VippsDetails struct { RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // This is the `recurringDetailReference` returned in the response when you created the token. StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"` - // + // TelephoneNumber string `json:"telephoneNumber"` // **vipps** Type *string `json:"type,omitempty"` @@ -210,7 +209,7 @@ func (o *VippsDetails) SetType(v string) { } func (o VippsDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableVippsDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VippsDetails) isValidType() bool { - var allowedEnumValues = []string{"vipps"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "vipps" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_visa_checkout_details.go b/src/checkout/model_visa_checkout_details.go index ea57a0d39..775ca1461 100644 --- a/src/checkout/model_visa_checkout_details.go +++ b/src/checkout/model_visa_checkout_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VisaCheckoutDetails type satisfies the MappedNullable interface at compile time @@ -172,7 +171,7 @@ func (o *VisaCheckoutDetails) SetVisaCheckoutCallId(v string) { } func (o VisaCheckoutDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,21 +229,23 @@ func (v *NullableVisaCheckoutDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VisaCheckoutDetails) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *VisaCheckoutDetails) isValidType() bool { - var allowedEnumValues = []string{"visacheckout"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "visacheckout" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_we_chat_pay_details.go b/src/checkout/model_we_chat_pay_details.go index c2752e88a..0252f797b 100644 --- a/src/checkout/model_we_chat_pay_details.go +++ b/src/checkout/model_we_chat_pay_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WeChatPayDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *WeChatPayDetails) SetType(v string) { } func (o WeChatPayDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableWeChatPayDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WeChatPayDetails) isValidType() bool { - var allowedEnumValues = []string{"wechatpay", "wechatpay_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "wechatpay", "wechatpay_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_we_chat_pay_mini_program_details.go b/src/checkout/model_we_chat_pay_mini_program_details.go index f59de52a4..dffa00d61 100644 --- a/src/checkout/model_we_chat_pay_mini_program_details.go +++ b/src/checkout/model_we_chat_pay_mini_program_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WeChatPayMiniProgramDetails type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type WeChatPayMiniProgramDetails struct { AppId *string `json:"appId,omitempty"` // The checkout attempt identifier. CheckoutAttemptId *string `json:"checkoutAttemptId,omitempty"` - Openid *string `json:"openid,omitempty"` + Openid *string `json:"openid,omitempty"` // **wechatpayMiniProgram** Type *string `json:"type,omitempty"` } @@ -177,7 +176,7 @@ func (o *WeChatPayMiniProgramDetails) SetType(v string) { } func (o WeChatPayMiniProgramDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -237,12 +236,14 @@ func (v *NullableWeChatPayMiniProgramDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WeChatPayMiniProgramDetails) isValidType() bool { - var allowedEnumValues = []string{"wechatpayMiniProgram"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "wechatpayMiniProgram" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/checkout/model_zip_details.go b/src/checkout/model_zip_details.go index 2b455de2e..39fac149e 100644 --- a/src/checkout/model_zip_details.go +++ b/src/checkout/model_zip_details.go @@ -10,8 +10,7 @@ package checkout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ZipDetails type satisfies the MappedNullable interface at compile time @@ -217,7 +216,7 @@ func (o *ZipDetails) SetType(v string) { } func (o ZipDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -280,12 +279,14 @@ func (v *NullableZipDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ZipDetails) isValidType() bool { - var allowedEnumValues = []string{"zip", "zip_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "zip", "zip_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/configurationWebhook/model_account_holder.go b/src/configurationWebhook/model_account_holder.go new file mode 100644 index 000000000..646035210 --- /dev/null +++ b/src/configurationWebhook/model_account_holder.go @@ -0,0 +1,561 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AccountHolder type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountHolder{} + +// AccountHolder struct for AccountHolder +type AccountHolder struct { + // The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + Capabilities *map[string]AccountHolderCapability `json:"capabilities,omitempty"` + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // Your description for the account holder, maximum 300 characters. + Description *string `json:"description,omitempty"` + // The unique identifier of the account holder. + Id string `json:"id"` + // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + LegalEntityId string `json:"legalEntityId"` + // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` + // The unique identifier of the migrated account holder in the classic integration. + MigratedAccountHolderCode *string `json:"migratedAccountHolderCode,omitempty"` + // The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + PrimaryBalanceAccount *string `json:"primaryBalanceAccount,omitempty"` + // Your reference for the account holder, maximum 150 characters. + Reference *string `json:"reference,omitempty"` + // The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone. + Status *string `json:"status,omitempty"` + // The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + TimeZone *string `json:"timeZone,omitempty"` + // List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + VerificationDeadlines []VerificationDeadline `json:"verificationDeadlines,omitempty"` +} + +// NewAccountHolder instantiates a new AccountHolder 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 NewAccountHolder(id string, legalEntityId string) *AccountHolder { + this := AccountHolder{} + this.Id = id + this.LegalEntityId = legalEntityId + return &this +} + +// NewAccountHolderWithDefaults instantiates a new AccountHolder 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 NewAccountHolderWithDefaults() *AccountHolder { + this := AccountHolder{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *AccountHolder) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *AccountHolder) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *AccountHolder) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +func (o *AccountHolder) GetCapabilities() map[string]AccountHolderCapability { + if o == nil || common.IsNil(o.Capabilities) { + var ret map[string]AccountHolderCapability + return ret + } + return *o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetCapabilitiesOk() (*map[string]AccountHolderCapability, bool) { + if o == nil || common.IsNil(o.Capabilities) { + return nil, false + } + return o.Capabilities, true +} + +// HasCapabilities returns a boolean if a field has been set. +func (o *AccountHolder) HasCapabilities() bool { + if o != nil && !common.IsNil(o.Capabilities) { + return true + } + + return false +} + +// SetCapabilities gets a reference to the given map[string]AccountHolderCapability and assigns it to the Capabilities field. +func (o *AccountHolder) SetCapabilities(v map[string]AccountHolderCapability) { + o.Capabilities = &v +} + +// GetContactDetails returns the ContactDetails field value if set, zero value otherwise. +func (o *AccountHolder) GetContactDetails() ContactDetails { + if o == nil || common.IsNil(o.ContactDetails) { + var ret ContactDetails + return ret + } + return *o.ContactDetails +} + +// GetContactDetailsOk returns a tuple with the ContactDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetContactDetailsOk() (*ContactDetails, bool) { + if o == nil || common.IsNil(o.ContactDetails) { + return nil, false + } + return o.ContactDetails, true +} + +// HasContactDetails returns a boolean if a field has been set. +func (o *AccountHolder) HasContactDetails() bool { + if o != nil && !common.IsNil(o.ContactDetails) { + return true + } + + return false +} + +// SetContactDetails gets a reference to the given ContactDetails and assigns it to the ContactDetails field. +func (o *AccountHolder) SetContactDetails(v ContactDetails) { + o.ContactDetails = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AccountHolder) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AccountHolder) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AccountHolder) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value +func (o *AccountHolder) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *AccountHolder) SetId(v string) { + o.Id = v +} + +// GetLegalEntityId returns the LegalEntityId field value +func (o *AccountHolder) GetLegalEntityId() string { + if o == nil { + var ret string + return ret + } + + return o.LegalEntityId +} + +// GetLegalEntityIdOk returns a tuple with the LegalEntityId field value +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetLegalEntityIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LegalEntityId, true +} + +// SetLegalEntityId sets field value +func (o *AccountHolder) SetLegalEntityId(v string) { + o.LegalEntityId = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *AccountHolder) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *AccountHolder) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *AccountHolder) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetMigratedAccountHolderCode returns the MigratedAccountHolderCode field value if set, zero value otherwise. +func (o *AccountHolder) GetMigratedAccountHolderCode() string { + if o == nil || common.IsNil(o.MigratedAccountHolderCode) { + var ret string + return ret + } + return *o.MigratedAccountHolderCode +} + +// GetMigratedAccountHolderCodeOk returns a tuple with the MigratedAccountHolderCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetMigratedAccountHolderCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.MigratedAccountHolderCode) { + return nil, false + } + return o.MigratedAccountHolderCode, true +} + +// HasMigratedAccountHolderCode returns a boolean if a field has been set. +func (o *AccountHolder) HasMigratedAccountHolderCode() bool { + if o != nil && !common.IsNil(o.MigratedAccountHolderCode) { + return true + } + + return false +} + +// SetMigratedAccountHolderCode gets a reference to the given string and assigns it to the MigratedAccountHolderCode field. +func (o *AccountHolder) SetMigratedAccountHolderCode(v string) { + o.MigratedAccountHolderCode = &v +} + +// GetPrimaryBalanceAccount returns the PrimaryBalanceAccount field value if set, zero value otherwise. +func (o *AccountHolder) GetPrimaryBalanceAccount() string { + if o == nil || common.IsNil(o.PrimaryBalanceAccount) { + var ret string + return ret + } + return *o.PrimaryBalanceAccount +} + +// GetPrimaryBalanceAccountOk returns a tuple with the PrimaryBalanceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetPrimaryBalanceAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.PrimaryBalanceAccount) { + return nil, false + } + return o.PrimaryBalanceAccount, true +} + +// HasPrimaryBalanceAccount returns a boolean if a field has been set. +func (o *AccountHolder) HasPrimaryBalanceAccount() bool { + if o != nil && !common.IsNil(o.PrimaryBalanceAccount) { + return true + } + + return false +} + +// SetPrimaryBalanceAccount gets a reference to the given string and assigns it to the PrimaryBalanceAccount field. +func (o *AccountHolder) SetPrimaryBalanceAccount(v string) { + o.PrimaryBalanceAccount = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *AccountHolder) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *AccountHolder) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *AccountHolder) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *AccountHolder) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *AccountHolder) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *AccountHolder) SetStatus(v string) { + o.Status = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise. +func (o *AccountHolder) GetTimeZone() string { + if o == nil || common.IsNil(o.TimeZone) { + var ret string + return ret + } + return *o.TimeZone +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetTimeZoneOk() (*string, bool) { + if o == nil || common.IsNil(o.TimeZone) { + return nil, false + } + return o.TimeZone, true +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *AccountHolder) HasTimeZone() bool { + if o != nil && !common.IsNil(o.TimeZone) { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field. +func (o *AccountHolder) SetTimeZone(v string) { + o.TimeZone = &v +} + +// GetVerificationDeadlines returns the VerificationDeadlines field value if set, zero value otherwise. +func (o *AccountHolder) GetVerificationDeadlines() []VerificationDeadline { + if o == nil || common.IsNil(o.VerificationDeadlines) { + var ret []VerificationDeadline + return ret + } + return o.VerificationDeadlines +} + +// GetVerificationDeadlinesOk returns a tuple with the VerificationDeadlines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolder) GetVerificationDeadlinesOk() ([]VerificationDeadline, bool) { + if o == nil || common.IsNil(o.VerificationDeadlines) { + return nil, false + } + return o.VerificationDeadlines, true +} + +// HasVerificationDeadlines returns a boolean if a field has been set. +func (o *AccountHolder) HasVerificationDeadlines() bool { + if o != nil && !common.IsNil(o.VerificationDeadlines) { + return true + } + + return false +} + +// SetVerificationDeadlines gets a reference to the given []VerificationDeadline and assigns it to the VerificationDeadlines field. +func (o *AccountHolder) SetVerificationDeadlines(v []VerificationDeadline) { + o.VerificationDeadlines = v +} + +func (o AccountHolder) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountHolder) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } + if !common.IsNil(o.ContactDetails) { + toSerialize["contactDetails"] = o.ContactDetails + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + toSerialize["legalEntityId"] = o.LegalEntityId + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !common.IsNil(o.MigratedAccountHolderCode) { + toSerialize["migratedAccountHolderCode"] = o.MigratedAccountHolderCode + } + if !common.IsNil(o.PrimaryBalanceAccount) { + toSerialize["primaryBalanceAccount"] = o.PrimaryBalanceAccount + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.TimeZone) { + toSerialize["timeZone"] = o.TimeZone + } + if !common.IsNil(o.VerificationDeadlines) { + toSerialize["verificationDeadlines"] = o.VerificationDeadlines + } + return toSerialize, nil +} + +type NullableAccountHolder struct { + value *AccountHolder + isSet bool +} + +func (v NullableAccountHolder) Get() *AccountHolder { + return v.value +} + +func (v *NullableAccountHolder) Set(val *AccountHolder) { + v.value = val + v.isSet = true +} + +func (v NullableAccountHolder) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountHolder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountHolder(val *AccountHolder) *NullableAccountHolder { + return &NullableAccountHolder{value: val, isSet: true} +} + +func (v NullableAccountHolder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountHolder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AccountHolder) isValidStatus() bool { + var allowedEnumValues = []string{ "Active", "Closed", "Inactive", "Suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_account_holder_capability.go b/src/configurationWebhook/model_account_holder_capability.go new file mode 100644 index 000000000..bdab03b66 --- /dev/null +++ b/src/configurationWebhook/model_account_holder_capability.go @@ -0,0 +1,485 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AccountHolderCapability type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountHolderCapability{} + +// AccountHolderCapability struct for AccountHolderCapability +type AccountHolderCapability struct { + // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + Allowed *bool `json:"allowed,omitempty"` + // The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + AllowedLevel *string `json:"allowedLevel,omitempty"` + AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` + // Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + Enabled *bool `json:"enabled,omitempty"` + // Contains verification errors and the actions that you can take to resolve them. + Problems []CapabilityProblem `json:"problems,omitempty"` + // Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + Requested *bool `json:"requested,omitempty"` + // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + RequestedLevel *string `json:"requestedLevel,omitempty"` + RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` + // Contains the status of the transfer instruments associated with this capability. + TransferInstruments []AccountSupportingEntityCapability `json:"transferInstruments,omitempty"` + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + VerificationStatus *string `json:"verificationStatus,omitempty"` +} + +// NewAccountHolderCapability instantiates a new AccountHolderCapability 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 NewAccountHolderCapability() *AccountHolderCapability { + this := AccountHolderCapability{} + return &this +} + +// NewAccountHolderCapabilityWithDefaults instantiates a new AccountHolderCapability 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 NewAccountHolderCapabilityWithDefaults() *AccountHolderCapability { + this := AccountHolderCapability{} + return &this +} + +// GetAllowed returns the Allowed field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetAllowed() bool { + if o == nil || common.IsNil(o.Allowed) { + var ret bool + return ret + } + return *o.Allowed +} + +// GetAllowedOk returns a tuple with the Allowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetAllowedOk() (*bool, bool) { + if o == nil || common.IsNil(o.Allowed) { + return nil, false + } + return o.Allowed, true +} + +// HasAllowed returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasAllowed() bool { + if o != nil && !common.IsNil(o.Allowed) { + return true + } + + return false +} + +// SetAllowed gets a reference to the given bool and assigns it to the Allowed field. +func (o *AccountHolderCapability) SetAllowed(v bool) { + o.Allowed = &v +} + +// GetAllowedLevel returns the AllowedLevel field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetAllowedLevel() string { + if o == nil || common.IsNil(o.AllowedLevel) { + var ret string + return ret + } + return *o.AllowedLevel +} + +// GetAllowedLevelOk returns a tuple with the AllowedLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetAllowedLevelOk() (*string, bool) { + if o == nil || common.IsNil(o.AllowedLevel) { + return nil, false + } + return o.AllowedLevel, true +} + +// HasAllowedLevel returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasAllowedLevel() bool { + if o != nil && !common.IsNil(o.AllowedLevel) { + return true + } + + return false +} + +// SetAllowedLevel gets a reference to the given string and assigns it to the AllowedLevel field. +func (o *AccountHolderCapability) SetAllowedLevel(v string) { + o.AllowedLevel = &v +} + +// GetAllowedSettings returns the AllowedSettings field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetAllowedSettings() CapabilitySettings { + if o == nil || common.IsNil(o.AllowedSettings) { + var ret CapabilitySettings + return ret + } + return *o.AllowedSettings +} + +// GetAllowedSettingsOk returns a tuple with the AllowedSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetAllowedSettingsOk() (*CapabilitySettings, bool) { + if o == nil || common.IsNil(o.AllowedSettings) { + return nil, false + } + return o.AllowedSettings, true +} + +// HasAllowedSettings returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasAllowedSettings() bool { + if o != nil && !common.IsNil(o.AllowedSettings) { + return true + } + + return false +} + +// SetAllowedSettings gets a reference to the given CapabilitySettings and assigns it to the AllowedSettings field. +func (o *AccountHolderCapability) SetAllowedSettings(v CapabilitySettings) { + o.AllowedSettings = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetEnabled() bool { + if o == nil || common.IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetEnabledOk() (*bool, bool) { + if o == nil || common.IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasEnabled() bool { + if o != nil && !common.IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *AccountHolderCapability) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetProblems returns the Problems field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetProblems() []CapabilityProblem { + if o == nil || common.IsNil(o.Problems) { + var ret []CapabilityProblem + return ret + } + return o.Problems +} + +// GetProblemsOk returns a tuple with the Problems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetProblemsOk() ([]CapabilityProblem, bool) { + if o == nil || common.IsNil(o.Problems) { + return nil, false + } + return o.Problems, true +} + +// HasProblems returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasProblems() bool { + if o != nil && !common.IsNil(o.Problems) { + return true + } + + return false +} + +// SetProblems gets a reference to the given []CapabilityProblem and assigns it to the Problems field. +func (o *AccountHolderCapability) SetProblems(v []CapabilityProblem) { + o.Problems = v +} + +// GetRequested returns the Requested field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetRequested() bool { + if o == nil || common.IsNil(o.Requested) { + var ret bool + return ret + } + return *o.Requested +} + +// GetRequestedOk returns a tuple with the Requested field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetRequestedOk() (*bool, bool) { + if o == nil || common.IsNil(o.Requested) { + return nil, false + } + return o.Requested, true +} + +// HasRequested returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasRequested() bool { + if o != nil && !common.IsNil(o.Requested) { + return true + } + + return false +} + +// SetRequested gets a reference to the given bool and assigns it to the Requested field. +func (o *AccountHolderCapability) SetRequested(v bool) { + o.Requested = &v +} + +// GetRequestedLevel returns the RequestedLevel field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetRequestedLevel() string { + if o == nil || common.IsNil(o.RequestedLevel) { + var ret string + return ret + } + return *o.RequestedLevel +} + +// GetRequestedLevelOk returns a tuple with the RequestedLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetRequestedLevelOk() (*string, bool) { + if o == nil || common.IsNil(o.RequestedLevel) { + return nil, false + } + return o.RequestedLevel, true +} + +// HasRequestedLevel returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasRequestedLevel() bool { + if o != nil && !common.IsNil(o.RequestedLevel) { + return true + } + + return false +} + +// SetRequestedLevel gets a reference to the given string and assigns it to the RequestedLevel field. +func (o *AccountHolderCapability) SetRequestedLevel(v string) { + o.RequestedLevel = &v +} + +// GetRequestedSettings returns the RequestedSettings field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetRequestedSettings() CapabilitySettings { + if o == nil || common.IsNil(o.RequestedSettings) { + var ret CapabilitySettings + return ret + } + return *o.RequestedSettings +} + +// GetRequestedSettingsOk returns a tuple with the RequestedSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetRequestedSettingsOk() (*CapabilitySettings, bool) { + if o == nil || common.IsNil(o.RequestedSettings) { + return nil, false + } + return o.RequestedSettings, true +} + +// HasRequestedSettings returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasRequestedSettings() bool { + if o != nil && !common.IsNil(o.RequestedSettings) { + return true + } + + return false +} + +// SetRequestedSettings gets a reference to the given CapabilitySettings and assigns it to the RequestedSettings field. +func (o *AccountHolderCapability) SetRequestedSettings(v CapabilitySettings) { + o.RequestedSettings = &v +} + +// GetTransferInstruments returns the TransferInstruments field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetTransferInstruments() []AccountSupportingEntityCapability { + if o == nil || common.IsNil(o.TransferInstruments) { + var ret []AccountSupportingEntityCapability + return ret + } + return o.TransferInstruments +} + +// GetTransferInstrumentsOk returns a tuple with the TransferInstruments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetTransferInstrumentsOk() ([]AccountSupportingEntityCapability, bool) { + if o == nil || common.IsNil(o.TransferInstruments) { + return nil, false + } + return o.TransferInstruments, true +} + +// HasTransferInstruments returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasTransferInstruments() bool { + if o != nil && !common.IsNil(o.TransferInstruments) { + return true + } + + return false +} + +// SetTransferInstruments gets a reference to the given []AccountSupportingEntityCapability and assigns it to the TransferInstruments field. +func (o *AccountHolderCapability) SetTransferInstruments(v []AccountSupportingEntityCapability) { + o.TransferInstruments = v +} + +// GetVerificationStatus returns the VerificationStatus field value if set, zero value otherwise. +func (o *AccountHolderCapability) GetVerificationStatus() string { + if o == nil || common.IsNil(o.VerificationStatus) { + var ret string + return ret + } + return *o.VerificationStatus +} + +// GetVerificationStatusOk returns a tuple with the VerificationStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderCapability) GetVerificationStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.VerificationStatus) { + return nil, false + } + return o.VerificationStatus, true +} + +// HasVerificationStatus returns a boolean if a field has been set. +func (o *AccountHolderCapability) HasVerificationStatus() bool { + if o != nil && !common.IsNil(o.VerificationStatus) { + return true + } + + return false +} + +// SetVerificationStatus gets a reference to the given string and assigns it to the VerificationStatus field. +func (o *AccountHolderCapability) SetVerificationStatus(v string) { + o.VerificationStatus = &v +} + +func (o AccountHolderCapability) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.AllowedLevel) { + toSerialize["allowedLevel"] = o.AllowedLevel + } + if !common.IsNil(o.AllowedSettings) { + toSerialize["allowedSettings"] = o.AllowedSettings + } + if !common.IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !common.IsNil(o.Problems) { + toSerialize["problems"] = o.Problems + } + if !common.IsNil(o.Requested) { + toSerialize["requested"] = o.Requested + } + if !common.IsNil(o.RequestedLevel) { + toSerialize["requestedLevel"] = o.RequestedLevel + } + if !common.IsNil(o.RequestedSettings) { + toSerialize["requestedSettings"] = o.RequestedSettings + } + if !common.IsNil(o.TransferInstruments) { + toSerialize["transferInstruments"] = o.TransferInstruments + } + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } + return toSerialize, nil +} + +type NullableAccountHolderCapability struct { + value *AccountHolderCapability + isSet bool +} + +func (v NullableAccountHolderCapability) Get() *AccountHolderCapability { + return v.value +} + +func (v *NullableAccountHolderCapability) Set(val *AccountHolderCapability) { + v.value = val + v.isSet = true +} + +func (v NullableAccountHolderCapability) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountHolderCapability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountHolderCapability(val *AccountHolderCapability) *NullableAccountHolderCapability { + return &NullableAccountHolderCapability{value: val, isSet: true} +} + +func (v NullableAccountHolderCapability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountHolderCapability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AccountHolderCapability) isValidAllowedLevel() bool { + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false +} +func (o *AccountHolderCapability) isValidRequestedLevel() bool { + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false +} +func (o *AccountHolderCapability) isValidVerificationStatus() bool { + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_account_holder_notification_data.go b/src/configurationWebhook/model_account_holder_notification_data.go new file mode 100644 index 000000000..aeb038377 --- /dev/null +++ b/src/configurationWebhook/model_account_holder_notification_data.go @@ -0,0 +1,163 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AccountHolderNotificationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountHolderNotificationData{} + +// AccountHolderNotificationData struct for AccountHolderNotificationData +type AccountHolderNotificationData struct { + AccountHolder *AccountHolder `json:"accountHolder,omitempty"` + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` +} + +// NewAccountHolderNotificationData instantiates a new AccountHolderNotificationData 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 NewAccountHolderNotificationData() *AccountHolderNotificationData { + this := AccountHolderNotificationData{} + return &this +} + +// NewAccountHolderNotificationDataWithDefaults instantiates a new AccountHolderNotificationData 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 NewAccountHolderNotificationDataWithDefaults() *AccountHolderNotificationData { + this := AccountHolderNotificationData{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value if set, zero value otherwise. +func (o *AccountHolderNotificationData) GetAccountHolder() AccountHolder { + if o == nil || common.IsNil(o.AccountHolder) { + var ret AccountHolder + return ret + } + return *o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderNotificationData) GetAccountHolderOk() (*AccountHolder, bool) { + if o == nil || common.IsNil(o.AccountHolder) { + return nil, false + } + return o.AccountHolder, true +} + +// HasAccountHolder returns a boolean if a field has been set. +func (o *AccountHolderNotificationData) HasAccountHolder() bool { + if o != nil && !common.IsNil(o.AccountHolder) { + return true + } + + return false +} + +// SetAccountHolder gets a reference to the given AccountHolder and assigns it to the AccountHolder field. +func (o *AccountHolderNotificationData) SetAccountHolder(v AccountHolder) { + o.AccountHolder = &v +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *AccountHolderNotificationData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountHolderNotificationData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *AccountHolderNotificationData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *AccountHolderNotificationData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +func (o AccountHolderNotificationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountHolderNotificationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountHolder) { + toSerialize["accountHolder"] = o.AccountHolder + } + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + return toSerialize, nil +} + +type NullableAccountHolderNotificationData struct { + value *AccountHolderNotificationData + isSet bool +} + +func (v NullableAccountHolderNotificationData) Get() *AccountHolderNotificationData { + return v.value +} + +func (v *NullableAccountHolderNotificationData) Set(val *AccountHolderNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableAccountHolderNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountHolderNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountHolderNotificationData(val *AccountHolderNotificationData) *NullableAccountHolderNotificationData { + return &NullableAccountHolderNotificationData{value: val, isSet: true} +} + +func (v NullableAccountHolderNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountHolderNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_account_holder_notification_request.go b/src/configurationWebhook/model_account_holder_notification_request.go new file mode 100644 index 000000000..e6c16f626 --- /dev/null +++ b/src/configurationWebhook/model_account_holder_notification_request.go @@ -0,0 +1,182 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AccountHolderNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountHolderNotificationRequest{} + +// AccountHolderNotificationRequest struct for AccountHolderNotificationRequest +type AccountHolderNotificationRequest struct { + Data AccountHolderNotificationData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewAccountHolderNotificationRequest instantiates a new AccountHolderNotificationRequest 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 NewAccountHolderNotificationRequest(data AccountHolderNotificationData, environment string, type_ string) *AccountHolderNotificationRequest { + this := AccountHolderNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewAccountHolderNotificationRequestWithDefaults instantiates a new AccountHolderNotificationRequest 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 NewAccountHolderNotificationRequestWithDefaults() *AccountHolderNotificationRequest { + this := AccountHolderNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *AccountHolderNotificationRequest) GetData() AccountHolderNotificationData { + if o == nil { + var ret AccountHolderNotificationData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *AccountHolderNotificationRequest) GetDataOk() (*AccountHolderNotificationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *AccountHolderNotificationRequest) SetData(v AccountHolderNotificationData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *AccountHolderNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *AccountHolderNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *AccountHolderNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *AccountHolderNotificationRequest) 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 *AccountHolderNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AccountHolderNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o AccountHolderNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountHolderNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAccountHolderNotificationRequest struct { + value *AccountHolderNotificationRequest + isSet bool +} + +func (v NullableAccountHolderNotificationRequest) Get() *AccountHolderNotificationRequest { + return v.value +} + +func (v *NullableAccountHolderNotificationRequest) Set(val *AccountHolderNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAccountHolderNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountHolderNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountHolderNotificationRequest(val *AccountHolderNotificationRequest) *NullableAccountHolderNotificationRequest { + return &NullableAccountHolderNotificationRequest{value: val, isSet: true} +} + +func (v NullableAccountHolderNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountHolderNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AccountHolderNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.accountHolder.updated", "balancePlatform.accountHolder.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_account_supporting_entity_capability.go b/src/configurationWebhook/model_account_supporting_entity_capability.go new file mode 100644 index 000000000..5e17dc956 --- /dev/null +++ b/src/configurationWebhook/model_account_supporting_entity_capability.go @@ -0,0 +1,376 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AccountSupportingEntityCapability type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AccountSupportingEntityCapability{} + +// AccountSupportingEntityCapability struct for AccountSupportingEntityCapability +type AccountSupportingEntityCapability struct { + // Indicates whether the supporting entity capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + Allowed *bool `json:"allowed,omitempty"` + // The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + AllowedLevel *string `json:"allowedLevel,omitempty"` + // Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + Enabled *bool `json:"enabled,omitempty"` + // The ID of the supporting entity. + Id *string `json:"id,omitempty"` + // Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + Requested *bool `json:"requested,omitempty"` + // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + RequestedLevel *string `json:"requestedLevel,omitempty"` + // The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + VerificationStatus *string `json:"verificationStatus,omitempty"` +} + +// NewAccountSupportingEntityCapability instantiates a new AccountSupportingEntityCapability 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 NewAccountSupportingEntityCapability() *AccountSupportingEntityCapability { + this := AccountSupportingEntityCapability{} + return &this +} + +// NewAccountSupportingEntityCapabilityWithDefaults instantiates a new AccountSupportingEntityCapability 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 NewAccountSupportingEntityCapabilityWithDefaults() *AccountSupportingEntityCapability { + this := AccountSupportingEntityCapability{} + return &this +} + +// GetAllowed returns the Allowed field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetAllowed() bool { + if o == nil || common.IsNil(o.Allowed) { + var ret bool + return ret + } + return *o.Allowed +} + +// GetAllowedOk returns a tuple with the Allowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetAllowedOk() (*bool, bool) { + if o == nil || common.IsNil(o.Allowed) { + return nil, false + } + return o.Allowed, true +} + +// HasAllowed returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasAllowed() bool { + if o != nil && !common.IsNil(o.Allowed) { + return true + } + + return false +} + +// SetAllowed gets a reference to the given bool and assigns it to the Allowed field. +func (o *AccountSupportingEntityCapability) SetAllowed(v bool) { + o.Allowed = &v +} + +// GetAllowedLevel returns the AllowedLevel field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetAllowedLevel() string { + if o == nil || common.IsNil(o.AllowedLevel) { + var ret string + return ret + } + return *o.AllowedLevel +} + +// GetAllowedLevelOk returns a tuple with the AllowedLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetAllowedLevelOk() (*string, bool) { + if o == nil || common.IsNil(o.AllowedLevel) { + return nil, false + } + return o.AllowedLevel, true +} + +// HasAllowedLevel returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasAllowedLevel() bool { + if o != nil && !common.IsNil(o.AllowedLevel) { + return true + } + + return false +} + +// SetAllowedLevel gets a reference to the given string and assigns it to the AllowedLevel field. +func (o *AccountSupportingEntityCapability) SetAllowedLevel(v string) { + o.AllowedLevel = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetEnabled() bool { + if o == nil || common.IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetEnabledOk() (*bool, bool) { + if o == nil || common.IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasEnabled() bool { + if o != nil && !common.IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *AccountSupportingEntityCapability) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AccountSupportingEntityCapability) SetId(v string) { + o.Id = &v +} + +// GetRequested returns the Requested field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetRequested() bool { + if o == nil || common.IsNil(o.Requested) { + var ret bool + return ret + } + return *o.Requested +} + +// GetRequestedOk returns a tuple with the Requested field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetRequestedOk() (*bool, bool) { + if o == nil || common.IsNil(o.Requested) { + return nil, false + } + return o.Requested, true +} + +// HasRequested returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasRequested() bool { + if o != nil && !common.IsNil(o.Requested) { + return true + } + + return false +} + +// SetRequested gets a reference to the given bool and assigns it to the Requested field. +func (o *AccountSupportingEntityCapability) SetRequested(v bool) { + o.Requested = &v +} + +// GetRequestedLevel returns the RequestedLevel field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetRequestedLevel() string { + if o == nil || common.IsNil(o.RequestedLevel) { + var ret string + return ret + } + return *o.RequestedLevel +} + +// GetRequestedLevelOk returns a tuple with the RequestedLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetRequestedLevelOk() (*string, bool) { + if o == nil || common.IsNil(o.RequestedLevel) { + return nil, false + } + return o.RequestedLevel, true +} + +// HasRequestedLevel returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasRequestedLevel() bool { + if o != nil && !common.IsNil(o.RequestedLevel) { + return true + } + + return false +} + +// SetRequestedLevel gets a reference to the given string and assigns it to the RequestedLevel field. +func (o *AccountSupportingEntityCapability) SetRequestedLevel(v string) { + o.RequestedLevel = &v +} + +// GetVerificationStatus returns the VerificationStatus field value if set, zero value otherwise. +func (o *AccountSupportingEntityCapability) GetVerificationStatus() string { + if o == nil || common.IsNil(o.VerificationStatus) { + var ret string + return ret + } + return *o.VerificationStatus +} + +// GetVerificationStatusOk returns a tuple with the VerificationStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountSupportingEntityCapability) GetVerificationStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.VerificationStatus) { + return nil, false + } + return o.VerificationStatus, true +} + +// HasVerificationStatus returns a boolean if a field has been set. +func (o *AccountSupportingEntityCapability) HasVerificationStatus() bool { + if o != nil && !common.IsNil(o.VerificationStatus) { + return true + } + + return false +} + +// SetVerificationStatus gets a reference to the given string and assigns it to the VerificationStatus field. +func (o *AccountSupportingEntityCapability) SetVerificationStatus(v string) { + o.VerificationStatus = &v +} + +func (o AccountSupportingEntityCapability) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccountSupportingEntityCapability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Allowed) { + toSerialize["allowed"] = o.Allowed + } + if !common.IsNil(o.AllowedLevel) { + toSerialize["allowedLevel"] = o.AllowedLevel + } + if !common.IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Requested) { + toSerialize["requested"] = o.Requested + } + if !common.IsNil(o.RequestedLevel) { + toSerialize["requestedLevel"] = o.RequestedLevel + } + if !common.IsNil(o.VerificationStatus) { + toSerialize["verificationStatus"] = o.VerificationStatus + } + return toSerialize, nil +} + +type NullableAccountSupportingEntityCapability struct { + value *AccountSupportingEntityCapability + isSet bool +} + +func (v NullableAccountSupportingEntityCapability) Get() *AccountSupportingEntityCapability { + return v.value +} + +func (v *NullableAccountSupportingEntityCapability) Set(val *AccountSupportingEntityCapability) { + v.value = val + v.isSet = true +} + +func (v NullableAccountSupportingEntityCapability) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountSupportingEntityCapability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountSupportingEntityCapability(val *AccountSupportingEntityCapability) *NullableAccountSupportingEntityCapability { + return &NullableAccountSupportingEntityCapability{value: val, isSet: true} +} + +func (v NullableAccountSupportingEntityCapability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountSupportingEntityCapability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AccountSupportingEntityCapability) isValidAllowedLevel() bool { + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false +} +func (o *AccountSupportingEntityCapability) isValidRequestedLevel() bool { + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false +} +func (o *AccountSupportingEntityCapability) isValidVerificationStatus() bool { + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_address.go b/src/configurationWebhook/model_address.go new file mode 100644 index 000000000..f7916c226 --- /dev/null +++ b/src/configurationWebhook/model_address.go @@ -0,0 +1,267 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Address type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Address{} + +// Address struct for Address +type Address struct { + // The name of the city. Maximum length: 3000 characters. + City string `json:"city"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + Country string `json:"country"` + // The number or name of the house. Maximum length: 3000 characters. + HouseNumberOrName string `json:"houseNumberOrName"` + // A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + PostalCode string `json:"postalCode"` + // The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + Street string `json:"street"` +} + +// NewAddress instantiates a new Address 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 NewAddress(city string, country string, houseNumberOrName string, postalCode string, street string) *Address { + this := Address{} + this.City = city + this.Country = country + this.HouseNumberOrName = houseNumberOrName + this.PostalCode = postalCode + this.Street = street + return &this +} + +// NewAddressWithDefaults instantiates a new Address 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 NewAddressWithDefaults() *Address { + this := Address{} + return &this +} + +// GetCity returns the City field value +func (o *Address) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *Address) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +func (o *Address) SetCity(v string) { + o.City = v +} + +// GetCountry returns the Country field value +func (o *Address) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *Address) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *Address) SetCountry(v string) { + o.Country = v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value +func (o *Address) GetHouseNumberOrName() string { + if o == nil { + var ret string + return ret + } + + return o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value +// and a boolean to check if the value has been set. +func (o *Address) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HouseNumberOrName, true +} + +// SetHouseNumberOrName sets field value +func (o *Address) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = v +} + +// GetPostalCode returns the PostalCode field value +func (o *Address) GetPostalCode() string { + if o == nil { + var ret string + return ret + } + + return o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value +// and a boolean to check if the value has been set. +func (o *Address) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PostalCode, true +} + +// SetPostalCode sets field value +func (o *Address) SetPostalCode(v string) { + o.PostalCode = v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *Address) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *Address) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *Address) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value +func (o *Address) GetStreet() string { + if o == nil { + var ret string + return ret + } + + return o.Street +} + +// GetStreetOk returns a tuple with the Street field value +// and a boolean to check if the value has been set. +func (o *Address) GetStreetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Street, true +} + +// SetStreet sets field value +func (o *Address) SetStreet(v string) { + o.Street = v +} + +func (o Address) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Address) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["city"] = o.City + toSerialize["country"] = o.Country + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + toSerialize["postalCode"] = o.PostalCode + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + toSerialize["street"] = o.Street + return toSerialize, nil +} + +type NullableAddress struct { + value *Address + isSet bool +} + +func (v NullableAddress) Get() *Address { + return v.value +} + +func (v *NullableAddress) Set(val *Address) { + v.value = val + v.isSet = true +} + +func (v NullableAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddress(val *Address) *NullableAddress { + return &NullableAddress{value: val, isSet: true} +} + +func (v NullableAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_amount.go b/src/configurationWebhook/model_amount.go new file mode 100644 index 000000000..51d084cb5 --- /dev/null +++ b/src/configurationWebhook/model_amount.go @@ -0,0 +1,146 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Amount type satisfies the MappedNullable interface at compile time +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). + Currency string `json:"currency"` + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + Value int64 `json:"value"` +} + +// NewAmount instantiates a new Amount 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 NewAmount(currency string, value int64) *Amount { + this := Amount{} + this.Currency = currency + this.Value = value + return &this +} + +// NewAmountWithDefaults instantiates a new Amount 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 NewAmountWithDefaults() *Amount { + this := Amount{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *Amount) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Amount) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Amount) SetCurrency(v string) { + o.Currency = v +} + +// GetValue returns the Value field value +func (o *Amount) GetValue() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Amount) GetValueOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Amount) SetValue(v int64) { + o.Value = v +} + +func (o Amount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Amount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableAmount struct { + value *Amount + isSet bool +} + +func (v NullableAmount) Get() *Amount { + return v.value +} + +func (v *NullableAmount) Set(val *Amount) { + v.value = val + v.isSet = true +} + +func (v NullableAmount) IsSet() bool { + return v.isSet +} + +func (v *NullableAmount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmount(val *Amount) *NullableAmount { + return &NullableAmount{value: val, isSet: true} +} + +func (v NullableAmount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_authentication.go b/src/configurationWebhook/model_authentication.go new file mode 100644 index 000000000..0f344c305 --- /dev/null +++ b/src/configurationWebhook/model_authentication.go @@ -0,0 +1,200 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Authentication type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Authentication{} + +// Authentication struct for Authentication +type Authentication struct { + // The email address where the one-time password (OTP) is sent. + Email *string `json:"email,omitempty"` + // The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + Password *string `json:"password,omitempty"` + Phone *Phone `json:"phone,omitempty"` +} + +// NewAuthentication instantiates a new Authentication 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 NewAuthentication() *Authentication { + this := Authentication{} + return &this +} + +// NewAuthenticationWithDefaults instantiates a new Authentication 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 NewAuthenticationWithDefaults() *Authentication { + this := Authentication{} + return &this +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *Authentication) GetEmail() string { + if o == nil || common.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Authentication) GetEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *Authentication) HasEmail() bool { + if o != nil && !common.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *Authentication) SetEmail(v string) { + o.Email = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *Authentication) GetPassword() string { + if o == nil || common.IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Authentication) GetPasswordOk() (*string, bool) { + if o == nil || common.IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *Authentication) HasPassword() bool { + if o != nil && !common.IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *Authentication) SetPassword(v string) { + o.Password = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *Authentication) GetPhone() Phone { + if o == nil || common.IsNil(o.Phone) { + var ret Phone + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Authentication) GetPhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *Authentication) HasPhone() bool { + if o != nil && !common.IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given Phone and assigns it to the Phone field. +func (o *Authentication) SetPhone(v Phone) { + o.Phone = &v +} + +func (o Authentication) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Authentication) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !common.IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !common.IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + return toSerialize, nil +} + +type NullableAuthentication struct { + value *Authentication + isSet bool +} + +func (v NullableAuthentication) Get() *Authentication { + return v.value +} + +func (v *NullableAuthentication) Set(val *Authentication) { + v.value = val + v.isSet = true +} + +func (v NullableAuthentication) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthentication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthentication(val *Authentication) *NullableAuthentication { + return &NullableAuthentication{value: val, isSet: true} +} + +func (v NullableAuthentication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthentication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_balance.go b/src/configurationWebhook/model_balance.go new file mode 100644 index 000000000..25f8f18e5 --- /dev/null +++ b/src/configurationWebhook/model_balance.go @@ -0,0 +1,239 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Balance type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Balance{} + +// Balance struct for Balance +type Balance struct { + // The remaining amount available for spending. + Available int64 `json:"available"` + // The total amount in the balance. + Balance int64 `json:"balance"` + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + Currency string `json:"currency"` + // The amount pending to be paid out but not yet available in the balance. + Pending *int64 `json:"pending,omitempty"` + // The amount reserved for payments that have been authorised, but have not been captured yet. + Reserved int64 `json:"reserved"` +} + +// NewBalance instantiates a new Balance 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 NewBalance(available int64, balance int64, currency string, reserved int64) *Balance { + this := Balance{} + this.Available = available + this.Balance = balance + this.Currency = currency + this.Reserved = reserved + return &this +} + +// NewBalanceWithDefaults instantiates a new Balance 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 NewBalanceWithDefaults() *Balance { + this := Balance{} + return &this +} + +// GetAvailable returns the Available field value +func (o *Balance) GetAvailable() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Available +} + +// GetAvailableOk returns a tuple with the Available field value +// and a boolean to check if the value has been set. +func (o *Balance) GetAvailableOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Available, true +} + +// SetAvailable sets field value +func (o *Balance) SetAvailable(v int64) { + o.Available = v +} + +// GetBalance returns the Balance field value +func (o *Balance) GetBalance() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value +// and a boolean to check if the value has been set. +func (o *Balance) GetBalanceOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Balance, true +} + +// SetBalance sets field value +func (o *Balance) SetBalance(v int64) { + o.Balance = v +} + +// GetCurrency returns the Currency field value +func (o *Balance) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Balance) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Balance) SetCurrency(v string) { + o.Currency = v +} + +// GetPending returns the Pending field value if set, zero value otherwise. +func (o *Balance) GetPending() int64 { + if o == nil || common.IsNil(o.Pending) { + var ret int64 + return ret + } + return *o.Pending +} + +// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Balance) GetPendingOk() (*int64, bool) { + if o == nil || common.IsNil(o.Pending) { + return nil, false + } + return o.Pending, true +} + +// HasPending returns a boolean if a field has been set. +func (o *Balance) HasPending() bool { + if o != nil && !common.IsNil(o.Pending) { + return true + } + + return false +} + +// SetPending gets a reference to the given int64 and assigns it to the Pending field. +func (o *Balance) SetPending(v int64) { + o.Pending = &v +} + +// GetReserved returns the Reserved field value +func (o *Balance) GetReserved() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Reserved +} + +// GetReservedOk returns a tuple with the Reserved field value +// and a boolean to check if the value has been set. +func (o *Balance) GetReservedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Reserved, true +} + +// SetReserved sets field value +func (o *Balance) SetReserved(v int64) { + o.Reserved = v +} + +func (o Balance) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Balance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["available"] = o.Available + toSerialize["balance"] = o.Balance + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Pending) { + toSerialize["pending"] = o.Pending + } + toSerialize["reserved"] = o.Reserved + return toSerialize, nil +} + +type NullableBalance struct { + value *Balance + isSet bool +} + +func (v NullableBalance) Get() *Balance { + return v.value +} + +func (v *NullableBalance) Set(val *Balance) { + v.value = val + v.isSet = true +} + +func (v NullableBalance) IsSet() bool { + return v.isSet +} + +func (v *NullableBalance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalance(val *Balance) *NullableBalance { + return &NullableBalance{value: val, isSet: true} +} + +func (v NullableBalance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_balance_account.go b/src/configurationWebhook/model_balance_account.go new file mode 100644 index 000000000..43fbaf08b --- /dev/null +++ b/src/configurationWebhook/model_balance_account.go @@ -0,0 +1,524 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalanceAccount type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalanceAccount{} + +// BalanceAccount struct for BalanceAccount +type BalanceAccount struct { + // The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + AccountHolderId string `json:"accountHolderId"` + // List of balances with the amount and currency. + Balances []Balance `json:"balances,omitempty"` + // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. > After a balance account is created, you cannot change its default currency. + DefaultCurrencyCode *string `json:"defaultCurrencyCode,omitempty"` + // A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + Description *string `json:"description,omitempty"` + // The unique identifier of the balance account. + Id string `json:"id"` + // A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + Metadata *map[string]string `json:"metadata,omitempty"` + // The unique identifier of the account of the migrated account holder in the classic integration. + MigratedAccountCode *string `json:"migratedAccountCode,omitempty"` + // List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account. + PaymentInstruments []PaymentInstrumentReference `json:"paymentInstruments,omitempty"` + PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"` + // Your reference for the balance account, maximum 150 characters. + Reference *string `json:"reference,omitempty"` + // The status of the balance account, set to **Active** by default. + Status *string `json:"status,omitempty"` + // The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + TimeZone *string `json:"timeZone,omitempty"` +} + +// NewBalanceAccount instantiates a new BalanceAccount 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 NewBalanceAccount(accountHolderId string, id string) *BalanceAccount { + this := BalanceAccount{} + this.AccountHolderId = accountHolderId + this.Id = id + return &this +} + +// NewBalanceAccountWithDefaults instantiates a new BalanceAccount 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 NewBalanceAccountWithDefaults() *BalanceAccount { + this := BalanceAccount{} + return &this +} + +// GetAccountHolderId returns the AccountHolderId field value +func (o *BalanceAccount) GetAccountHolderId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountHolderId +} + +// GetAccountHolderIdOk returns a tuple with the AccountHolderId field value +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetAccountHolderIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolderId, true +} + +// SetAccountHolderId sets field value +func (o *BalanceAccount) SetAccountHolderId(v string) { + o.AccountHolderId = v +} + +// GetBalances returns the Balances field value if set, zero value otherwise. +func (o *BalanceAccount) GetBalances() []Balance { + if o == nil || common.IsNil(o.Balances) { + var ret []Balance + return ret + } + return o.Balances +} + +// GetBalancesOk returns a tuple with the Balances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetBalancesOk() ([]Balance, bool) { + if o == nil || common.IsNil(o.Balances) { + return nil, false + } + return o.Balances, true +} + +// HasBalances returns a boolean if a field has been set. +func (o *BalanceAccount) HasBalances() bool { + if o != nil && !common.IsNil(o.Balances) { + return true + } + + return false +} + +// SetBalances gets a reference to the given []Balance and assigns it to the Balances field. +func (o *BalanceAccount) SetBalances(v []Balance) { + o.Balances = v +} + +// GetDefaultCurrencyCode returns the DefaultCurrencyCode field value if set, zero value otherwise. +func (o *BalanceAccount) GetDefaultCurrencyCode() string { + if o == nil || common.IsNil(o.DefaultCurrencyCode) { + var ret string + return ret + } + return *o.DefaultCurrencyCode +} + +// GetDefaultCurrencyCodeOk returns a tuple with the DefaultCurrencyCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetDefaultCurrencyCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.DefaultCurrencyCode) { + return nil, false + } + return o.DefaultCurrencyCode, true +} + +// HasDefaultCurrencyCode returns a boolean if a field has been set. +func (o *BalanceAccount) HasDefaultCurrencyCode() bool { + if o != nil && !common.IsNil(o.DefaultCurrencyCode) { + return true + } + + return false +} + +// SetDefaultCurrencyCode gets a reference to the given string and assigns it to the DefaultCurrencyCode field. +func (o *BalanceAccount) SetDefaultCurrencyCode(v string) { + o.DefaultCurrencyCode = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BalanceAccount) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BalanceAccount) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BalanceAccount) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value +func (o *BalanceAccount) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BalanceAccount) SetId(v string) { + o.Id = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *BalanceAccount) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *BalanceAccount) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *BalanceAccount) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetMigratedAccountCode returns the MigratedAccountCode field value if set, zero value otherwise. +func (o *BalanceAccount) GetMigratedAccountCode() string { + if o == nil || common.IsNil(o.MigratedAccountCode) { + var ret string + return ret + } + return *o.MigratedAccountCode +} + +// GetMigratedAccountCodeOk returns a tuple with the MigratedAccountCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetMigratedAccountCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.MigratedAccountCode) { + return nil, false + } + return o.MigratedAccountCode, true +} + +// HasMigratedAccountCode returns a boolean if a field has been set. +func (o *BalanceAccount) HasMigratedAccountCode() bool { + if o != nil && !common.IsNil(o.MigratedAccountCode) { + return true + } + + return false +} + +// SetMigratedAccountCode gets a reference to the given string and assigns it to the MigratedAccountCode field. +func (o *BalanceAccount) SetMigratedAccountCode(v string) { + o.MigratedAccountCode = &v +} + +// GetPaymentInstruments returns the PaymentInstruments field value if set, zero value otherwise. +func (o *BalanceAccount) GetPaymentInstruments() []PaymentInstrumentReference { + if o == nil || common.IsNil(o.PaymentInstruments) { + var ret []PaymentInstrumentReference + return ret + } + return o.PaymentInstruments +} + +// GetPaymentInstrumentsOk returns a tuple with the PaymentInstruments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetPaymentInstrumentsOk() ([]PaymentInstrumentReference, bool) { + if o == nil || common.IsNil(o.PaymentInstruments) { + return nil, false + } + return o.PaymentInstruments, true +} + +// HasPaymentInstruments returns a boolean if a field has been set. +func (o *BalanceAccount) HasPaymentInstruments() bool { + if o != nil && !common.IsNil(o.PaymentInstruments) { + return true + } + + return false +} + +// SetPaymentInstruments gets a reference to the given []PaymentInstrumentReference and assigns it to the PaymentInstruments field. +func (o *BalanceAccount) SetPaymentInstruments(v []PaymentInstrumentReference) { + o.PaymentInstruments = v +} + +// GetPlatformPaymentConfiguration returns the PlatformPaymentConfiguration field value if set, zero value otherwise. +func (o *BalanceAccount) GetPlatformPaymentConfiguration() PlatformPaymentConfiguration { + if o == nil || common.IsNil(o.PlatformPaymentConfiguration) { + var ret PlatformPaymentConfiguration + return ret + } + return *o.PlatformPaymentConfiguration +} + +// GetPlatformPaymentConfigurationOk returns a tuple with the PlatformPaymentConfiguration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetPlatformPaymentConfigurationOk() (*PlatformPaymentConfiguration, bool) { + if o == nil || common.IsNil(o.PlatformPaymentConfiguration) { + return nil, false + } + return o.PlatformPaymentConfiguration, true +} + +// HasPlatformPaymentConfiguration returns a boolean if a field has been set. +func (o *BalanceAccount) HasPlatformPaymentConfiguration() bool { + if o != nil && !common.IsNil(o.PlatformPaymentConfiguration) { + return true + } + + return false +} + +// SetPlatformPaymentConfiguration gets a reference to the given PlatformPaymentConfiguration and assigns it to the PlatformPaymentConfiguration field. +func (o *BalanceAccount) SetPlatformPaymentConfiguration(v PlatformPaymentConfiguration) { + o.PlatformPaymentConfiguration = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *BalanceAccount) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *BalanceAccount) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *BalanceAccount) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *BalanceAccount) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *BalanceAccount) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *BalanceAccount) SetStatus(v string) { + o.Status = &v +} + +// GetTimeZone returns the TimeZone field value if set, zero value otherwise. +func (o *BalanceAccount) GetTimeZone() string { + if o == nil || common.IsNil(o.TimeZone) { + var ret string + return ret + } + return *o.TimeZone +} + +// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccount) GetTimeZoneOk() (*string, bool) { + if o == nil || common.IsNil(o.TimeZone) { + return nil, false + } + return o.TimeZone, true +} + +// HasTimeZone returns a boolean if a field has been set. +func (o *BalanceAccount) HasTimeZone() bool { + if o != nil && !common.IsNil(o.TimeZone) { + return true + } + + return false +} + +// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field. +func (o *BalanceAccount) SetTimeZone(v string) { + o.TimeZone = &v +} + +func (o BalanceAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalanceAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountHolderId"] = o.AccountHolderId + if !common.IsNil(o.Balances) { + toSerialize["balances"] = o.Balances + } + if !common.IsNil(o.DefaultCurrencyCode) { + toSerialize["defaultCurrencyCode"] = o.DefaultCurrencyCode + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !common.IsNil(o.MigratedAccountCode) { + toSerialize["migratedAccountCode"] = o.MigratedAccountCode + } + if !common.IsNil(o.PaymentInstruments) { + toSerialize["paymentInstruments"] = o.PaymentInstruments + } + if !common.IsNil(o.PlatformPaymentConfiguration) { + toSerialize["platformPaymentConfiguration"] = o.PlatformPaymentConfiguration + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.TimeZone) { + toSerialize["timeZone"] = o.TimeZone + } + return toSerialize, nil +} + +type NullableBalanceAccount struct { + value *BalanceAccount + isSet bool +} + +func (v NullableBalanceAccount) Get() *BalanceAccount { + return v.value +} + +func (v *NullableBalanceAccount) Set(val *BalanceAccount) { + v.value = val + v.isSet = true +} + +func (v NullableBalanceAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableBalanceAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalanceAccount(val *BalanceAccount) *NullableBalanceAccount { + return &NullableBalanceAccount{value: val, isSet: true} +} + +func (v NullableBalanceAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalanceAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *BalanceAccount) isValidStatus() bool { + var allowedEnumValues = []string{ "Active", "Closed", "Inactive", "Suspended" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_balance_account_notification_data.go b/src/configurationWebhook/model_balance_account_notification_data.go new file mode 100644 index 000000000..5600393c1 --- /dev/null +++ b/src/configurationWebhook/model_balance_account_notification_data.go @@ -0,0 +1,163 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalanceAccountNotificationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalanceAccountNotificationData{} + +// BalanceAccountNotificationData struct for BalanceAccountNotificationData +type BalanceAccountNotificationData struct { + BalanceAccount *BalanceAccount `json:"balanceAccount,omitempty"` + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` +} + +// NewBalanceAccountNotificationData instantiates a new BalanceAccountNotificationData 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 NewBalanceAccountNotificationData() *BalanceAccountNotificationData { + this := BalanceAccountNotificationData{} + return &this +} + +// NewBalanceAccountNotificationDataWithDefaults instantiates a new BalanceAccountNotificationData 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 NewBalanceAccountNotificationDataWithDefaults() *BalanceAccountNotificationData { + this := BalanceAccountNotificationData{} + return &this +} + +// GetBalanceAccount returns the BalanceAccount field value if set, zero value otherwise. +func (o *BalanceAccountNotificationData) GetBalanceAccount() BalanceAccount { + if o == nil || common.IsNil(o.BalanceAccount) { + var ret BalanceAccount + return ret + } + return *o.BalanceAccount +} + +// GetBalanceAccountOk returns a tuple with the BalanceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccountNotificationData) GetBalanceAccountOk() (*BalanceAccount, bool) { + if o == nil || common.IsNil(o.BalanceAccount) { + return nil, false + } + return o.BalanceAccount, true +} + +// HasBalanceAccount returns a boolean if a field has been set. +func (o *BalanceAccountNotificationData) HasBalanceAccount() bool { + if o != nil && !common.IsNil(o.BalanceAccount) { + return true + } + + return false +} + +// SetBalanceAccount gets a reference to the given BalanceAccount and assigns it to the BalanceAccount field. +func (o *BalanceAccountNotificationData) SetBalanceAccount(v BalanceAccount) { + o.BalanceAccount = &v +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *BalanceAccountNotificationData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceAccountNotificationData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *BalanceAccountNotificationData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *BalanceAccountNotificationData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +func (o BalanceAccountNotificationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalanceAccountNotificationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccount) { + toSerialize["balanceAccount"] = o.BalanceAccount + } + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + return toSerialize, nil +} + +type NullableBalanceAccountNotificationData struct { + value *BalanceAccountNotificationData + isSet bool +} + +func (v NullableBalanceAccountNotificationData) Get() *BalanceAccountNotificationData { + return v.value +} + +func (v *NullableBalanceAccountNotificationData) Set(val *BalanceAccountNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableBalanceAccountNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableBalanceAccountNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalanceAccountNotificationData(val *BalanceAccountNotificationData) *NullableBalanceAccountNotificationData { + return &NullableBalanceAccountNotificationData{value: val, isSet: true} +} + +func (v NullableBalanceAccountNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalanceAccountNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_balance_account_notification_request.go b/src/configurationWebhook/model_balance_account_notification_request.go new file mode 100644 index 000000000..d15cc8a89 --- /dev/null +++ b/src/configurationWebhook/model_balance_account_notification_request.go @@ -0,0 +1,182 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalanceAccountNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalanceAccountNotificationRequest{} + +// BalanceAccountNotificationRequest struct for BalanceAccountNotificationRequest +type BalanceAccountNotificationRequest struct { + Data BalanceAccountNotificationData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewBalanceAccountNotificationRequest instantiates a new BalanceAccountNotificationRequest 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 NewBalanceAccountNotificationRequest(data BalanceAccountNotificationData, environment string, type_ string) *BalanceAccountNotificationRequest { + this := BalanceAccountNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewBalanceAccountNotificationRequestWithDefaults instantiates a new BalanceAccountNotificationRequest 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 NewBalanceAccountNotificationRequestWithDefaults() *BalanceAccountNotificationRequest { + this := BalanceAccountNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *BalanceAccountNotificationRequest) GetData() BalanceAccountNotificationData { + if o == nil { + var ret BalanceAccountNotificationData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *BalanceAccountNotificationRequest) GetDataOk() (*BalanceAccountNotificationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BalanceAccountNotificationRequest) SetData(v BalanceAccountNotificationData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *BalanceAccountNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *BalanceAccountNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *BalanceAccountNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *BalanceAccountNotificationRequest) 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 *BalanceAccountNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BalanceAccountNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o BalanceAccountNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalanceAccountNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBalanceAccountNotificationRequest struct { + value *BalanceAccountNotificationRequest + isSet bool +} + +func (v NullableBalanceAccountNotificationRequest) Get() *BalanceAccountNotificationRequest { + return v.value +} + +func (v *NullableBalanceAccountNotificationRequest) Set(val *BalanceAccountNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableBalanceAccountNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableBalanceAccountNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalanceAccountNotificationRequest(val *BalanceAccountNotificationRequest) *NullableBalanceAccountNotificationRequest { + return &NullableBalanceAccountNotificationRequest{value: val, isSet: true} +} + +func (v NullableBalanceAccountNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalanceAccountNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *BalanceAccountNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.balanceAccount.updated", "balancePlatform.balanceAccount.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_balance_platform_notification_response.go b/src/configurationWebhook/model_balance_platform_notification_response.go new file mode 100644 index 000000000..45d24dfc5 --- /dev/null +++ b/src/configurationWebhook/model_balance_platform_notification_response.go @@ -0,0 +1,127 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalancePlatformNotificationResponse{} + +// BalancePlatformNotificationResponse struct for BalancePlatformNotificationResponse +type BalancePlatformNotificationResponse struct { + // Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewBalancePlatformNotificationResponse instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponse() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// NewBalancePlatformNotificationResponseWithDefaults instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponseWithDefaults() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalancePlatformNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableBalancePlatformNotificationResponse struct { + value *BalancePlatformNotificationResponse + isSet bool +} + +func (v NullableBalancePlatformNotificationResponse) Get() *BalancePlatformNotificationResponse { + return v.value +} + +func (v *NullableBalancePlatformNotificationResponse) Set(val *BalancePlatformNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBalancePlatformNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBalancePlatformNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalancePlatformNotificationResponse(val *BalancePlatformNotificationResponse) *NullableBalancePlatformNotificationResponse { + return &NullableBalancePlatformNotificationResponse{value: val, isSet: true} +} + +func (v NullableBalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_bulk_address.go b/src/configurationWebhook/model_bulk_address.go new file mode 100644 index 000000000..dcdaf8b1d --- /dev/null +++ b/src/configurationWebhook/model_bulk_address.go @@ -0,0 +1,414 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BulkAddress type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BulkAddress{} + +// BulkAddress struct for BulkAddress +type BulkAddress struct { + // The name of the city. + City *string `json:"city,omitempty"` + // The name of the company. + Company *string `json:"company,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + Country string `json:"country"` + // The email address. + Email *string `json:"email,omitempty"` + // The house number or name. + HouseNumberOrName *string `json:"houseNumberOrName,omitempty"` + // The full telephone number. + Mobile *string `json:"mobile,omitempty"` + // The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + PostalCode *string `json:"postalCode,omitempty"` + // The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + StateOrProvince *string `json:"stateOrProvince,omitempty"` + // The streetname of the house. + Street *string `json:"street,omitempty"` +} + +// NewBulkAddress instantiates a new BulkAddress 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 NewBulkAddress(country string) *BulkAddress { + this := BulkAddress{} + this.Country = country + return &this +} + +// NewBulkAddressWithDefaults instantiates a new BulkAddress 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 NewBulkAddressWithDefaults() *BulkAddress { + this := BulkAddress{} + return &this +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *BulkAddress) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *BulkAddress) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *BulkAddress) SetCity(v string) { + o.City = &v +} + +// GetCompany returns the Company field value if set, zero value otherwise. +func (o *BulkAddress) GetCompany() string { + if o == nil || common.IsNil(o.Company) { + var ret string + return ret + } + return *o.Company +} + +// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetCompanyOk() (*string, bool) { + if o == nil || common.IsNil(o.Company) { + return nil, false + } + return o.Company, true +} + +// HasCompany returns a boolean if a field has been set. +func (o *BulkAddress) HasCompany() bool { + if o != nil && !common.IsNil(o.Company) { + return true + } + + return false +} + +// SetCompany gets a reference to the given string and assigns it to the Company field. +func (o *BulkAddress) SetCompany(v string) { + o.Company = &v +} + +// GetCountry returns the Country field value +func (o *BulkAddress) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *BulkAddress) SetCountry(v string) { + o.Country = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *BulkAddress) GetEmail() string { + if o == nil || common.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *BulkAddress) HasEmail() bool { + if o != nil && !common.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *BulkAddress) SetEmail(v string) { + o.Email = &v +} + +// GetHouseNumberOrName returns the HouseNumberOrName field value if set, zero value otherwise. +func (o *BulkAddress) GetHouseNumberOrName() string { + if o == nil || common.IsNil(o.HouseNumberOrName) { + var ret string + return ret + } + return *o.HouseNumberOrName +} + +// GetHouseNumberOrNameOk returns a tuple with the HouseNumberOrName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetHouseNumberOrNameOk() (*string, bool) { + if o == nil || common.IsNil(o.HouseNumberOrName) { + return nil, false + } + return o.HouseNumberOrName, true +} + +// HasHouseNumberOrName returns a boolean if a field has been set. +func (o *BulkAddress) HasHouseNumberOrName() bool { + if o != nil && !common.IsNil(o.HouseNumberOrName) { + return true + } + + return false +} + +// SetHouseNumberOrName gets a reference to the given string and assigns it to the HouseNumberOrName field. +func (o *BulkAddress) SetHouseNumberOrName(v string) { + o.HouseNumberOrName = &v +} + +// GetMobile returns the Mobile field value if set, zero value otherwise. +func (o *BulkAddress) GetMobile() string { + if o == nil || common.IsNil(o.Mobile) { + var ret string + return ret + } + return *o.Mobile +} + +// GetMobileOk returns a tuple with the Mobile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetMobileOk() (*string, bool) { + if o == nil || common.IsNil(o.Mobile) { + return nil, false + } + return o.Mobile, true +} + +// HasMobile returns a boolean if a field has been set. +func (o *BulkAddress) HasMobile() bool { + if o != nil && !common.IsNil(o.Mobile) { + return true + } + + return false +} + +// SetMobile gets a reference to the given string and assigns it to the Mobile field. +func (o *BulkAddress) SetMobile(v string) { + o.Mobile = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *BulkAddress) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *BulkAddress) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *BulkAddress) SetPostalCode(v string) { + o.PostalCode = &v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *BulkAddress) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *BulkAddress) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *BulkAddress) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +// GetStreet returns the Street field value if set, zero value otherwise. +func (o *BulkAddress) GetStreet() string { + if o == nil || common.IsNil(o.Street) { + var ret string + return ret + } + return *o.Street +} + +// GetStreetOk returns a tuple with the Street field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BulkAddress) GetStreetOk() (*string, bool) { + if o == nil || common.IsNil(o.Street) { + return nil, false + } + return o.Street, true +} + +// HasStreet returns a boolean if a field has been set. +func (o *BulkAddress) HasStreet() bool { + if o != nil && !common.IsNil(o.Street) { + return true + } + + return false +} + +// SetStreet gets a reference to the given string and assigns it to the Street field. +func (o *BulkAddress) SetStreet(v string) { + o.Street = &v +} + +func (o BulkAddress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BulkAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !common.IsNil(o.Company) { + toSerialize["company"] = o.Company + } + toSerialize["country"] = o.Country + if !common.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !common.IsNil(o.HouseNumberOrName) { + toSerialize["houseNumberOrName"] = o.HouseNumberOrName + } + if !common.IsNil(o.Mobile) { + toSerialize["mobile"] = o.Mobile + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + if !common.IsNil(o.Street) { + toSerialize["street"] = o.Street + } + return toSerialize, nil +} + +type NullableBulkAddress struct { + value *BulkAddress + isSet bool +} + +func (v NullableBulkAddress) Get() *BulkAddress { + return v.value +} + +func (v *NullableBulkAddress) Set(val *BulkAddress) { + v.value = val + v.isSet = true +} + +func (v NullableBulkAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableBulkAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBulkAddress(val *BulkAddress) *NullableBulkAddress { + return &NullableBulkAddress{value: val, isSet: true} +} + +func (v NullableBulkAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBulkAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_capability_problem.go b/src/configurationWebhook/model_capability_problem.go new file mode 100644 index 000000000..10755e677 --- /dev/null +++ b/src/configurationWebhook/model_capability_problem.go @@ -0,0 +1,163 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CapabilityProblem type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CapabilityProblem{} + +// CapabilityProblem struct for CapabilityProblem +type CapabilityProblem struct { + Entity *CapabilityProblemEntity `json:"entity,omitempty"` + // Contains information about the verification error. + VerificationErrors []VerificationError `json:"verificationErrors,omitempty"` +} + +// NewCapabilityProblem instantiates a new CapabilityProblem 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 NewCapabilityProblem() *CapabilityProblem { + this := CapabilityProblem{} + return &this +} + +// NewCapabilityProblemWithDefaults instantiates a new CapabilityProblem 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 NewCapabilityProblemWithDefaults() *CapabilityProblem { + this := CapabilityProblem{} + return &this +} + +// GetEntity returns the Entity field value if set, zero value otherwise. +func (o *CapabilityProblem) GetEntity() CapabilityProblemEntity { + if o == nil || common.IsNil(o.Entity) { + var ret CapabilityProblemEntity + return ret + } + return *o.Entity +} + +// GetEntityOk returns a tuple with the Entity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblem) GetEntityOk() (*CapabilityProblemEntity, bool) { + if o == nil || common.IsNil(o.Entity) { + return nil, false + } + return o.Entity, true +} + +// HasEntity returns a boolean if a field has been set. +func (o *CapabilityProblem) HasEntity() bool { + if o != nil && !common.IsNil(o.Entity) { + return true + } + + return false +} + +// SetEntity gets a reference to the given CapabilityProblemEntity and assigns it to the Entity field. +func (o *CapabilityProblem) SetEntity(v CapabilityProblemEntity) { + o.Entity = &v +} + +// GetVerificationErrors returns the VerificationErrors field value if set, zero value otherwise. +func (o *CapabilityProblem) GetVerificationErrors() []VerificationError { + if o == nil || common.IsNil(o.VerificationErrors) { + var ret []VerificationError + return ret + } + return o.VerificationErrors +} + +// GetVerificationErrorsOk returns a tuple with the VerificationErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblem) GetVerificationErrorsOk() ([]VerificationError, bool) { + if o == nil || common.IsNil(o.VerificationErrors) { + return nil, false + } + return o.VerificationErrors, true +} + +// HasVerificationErrors returns a boolean if a field has been set. +func (o *CapabilityProblem) HasVerificationErrors() bool { + if o != nil && !common.IsNil(o.VerificationErrors) { + return true + } + + return false +} + +// SetVerificationErrors gets a reference to the given []VerificationError and assigns it to the VerificationErrors field. +func (o *CapabilityProblem) SetVerificationErrors(v []VerificationError) { + o.VerificationErrors = v +} + +func (o CapabilityProblem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapabilityProblem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Entity) { + toSerialize["entity"] = o.Entity + } + if !common.IsNil(o.VerificationErrors) { + toSerialize["verificationErrors"] = o.VerificationErrors + } + return toSerialize, nil +} + +type NullableCapabilityProblem struct { + value *CapabilityProblem + isSet bool +} + +func (v NullableCapabilityProblem) Get() *CapabilityProblem { + return v.value +} + +func (v *NullableCapabilityProblem) Set(val *CapabilityProblem) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilityProblem) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilityProblem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilityProblem(val *CapabilityProblem) *NullableCapabilityProblem { + return &NullableCapabilityProblem{value: val, isSet: true} +} + +func (v NullableCapabilityProblem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilityProblem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_capability_problem_entity.go b/src/configurationWebhook/model_capability_problem_entity.go new file mode 100644 index 000000000..2dfb039d5 --- /dev/null +++ b/src/configurationWebhook/model_capability_problem_entity.go @@ -0,0 +1,246 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CapabilityProblemEntity type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CapabilityProblemEntity{} + +// CapabilityProblemEntity struct for CapabilityProblemEntity +type CapabilityProblemEntity struct { + // List of document IDs to which the verification errors related to the capabilities correspond to. + Documents []string `json:"documents,omitempty"` + // The ID of the entity. + Id *string `json:"id,omitempty"` + Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` + // Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. + Type *string `json:"type,omitempty"` +} + +// NewCapabilityProblemEntity instantiates a new CapabilityProblemEntity 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 NewCapabilityProblemEntity() *CapabilityProblemEntity { + this := CapabilityProblemEntity{} + return &this +} + +// NewCapabilityProblemEntityWithDefaults instantiates a new CapabilityProblemEntity 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 NewCapabilityProblemEntityWithDefaults() *CapabilityProblemEntity { + this := CapabilityProblemEntity{} + return &this +} + +// GetDocuments returns the Documents field value if set, zero value otherwise. +func (o *CapabilityProblemEntity) GetDocuments() []string { + if o == nil || common.IsNil(o.Documents) { + var ret []string + return ret + } + return o.Documents +} + +// GetDocumentsOk returns a tuple with the Documents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntity) GetDocumentsOk() ([]string, bool) { + if o == nil || common.IsNil(o.Documents) { + return nil, false + } + return o.Documents, true +} + +// HasDocuments returns a boolean if a field has been set. +func (o *CapabilityProblemEntity) HasDocuments() bool { + if o != nil && !common.IsNil(o.Documents) { + return true + } + + return false +} + +// SetDocuments gets a reference to the given []string and assigns it to the Documents field. +func (o *CapabilityProblemEntity) SetDocuments(v []string) { + o.Documents = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CapabilityProblemEntity) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntity) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CapabilityProblemEntity) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CapabilityProblemEntity) SetId(v string) { + o.Id = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CapabilityProblemEntity) GetOwner() CapabilityProblemEntityRecursive { + if o == nil || common.IsNil(o.Owner) { + var ret CapabilityProblemEntityRecursive + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntity) GetOwnerOk() (*CapabilityProblemEntityRecursive, bool) { + if o == nil || common.IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CapabilityProblemEntity) HasOwner() bool { + if o != nil && !common.IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given CapabilityProblemEntityRecursive and assigns it to the Owner field. +func (o *CapabilityProblemEntity) SetOwner(v CapabilityProblemEntityRecursive) { + o.Owner = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CapabilityProblemEntity) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntity) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CapabilityProblemEntity) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CapabilityProblemEntity) SetType(v string) { + o.Type = &v +} + +func (o CapabilityProblemEntity) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapabilityProblemEntity) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Documents) { + toSerialize["documents"] = o.Documents + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCapabilityProblemEntity struct { + value *CapabilityProblemEntity + isSet bool +} + +func (v NullableCapabilityProblemEntity) Get() *CapabilityProblemEntity { + return v.value +} + +func (v *NullableCapabilityProblemEntity) Set(val *CapabilityProblemEntity) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilityProblemEntity) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilityProblemEntity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilityProblemEntity(val *CapabilityProblemEntity) *NullableCapabilityProblemEntity { + return &NullableCapabilityProblemEntity{value: val, isSet: true} +} + +func (v NullableCapabilityProblemEntity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilityProblemEntity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CapabilityProblemEntity) isValidType() bool { + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_capability_problem_entity_recursive.go b/src/configurationWebhook/model_capability_problem_entity_recursive.go new file mode 100644 index 000000000..66d853649 --- /dev/null +++ b/src/configurationWebhook/model_capability_problem_entity_recursive.go @@ -0,0 +1,210 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CapabilityProblemEntityRecursive type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CapabilityProblemEntityRecursive{} + +// CapabilityProblemEntityRecursive struct for CapabilityProblemEntityRecursive +type CapabilityProblemEntityRecursive struct { + // List of document IDs to which the verification errors related to the capabilities correspond to. + Documents []string `json:"documents,omitempty"` + // The ID of the entity. + Id *string `json:"id,omitempty"` + // Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. + Type *string `json:"type,omitempty"` +} + +// NewCapabilityProblemEntityRecursive instantiates a new CapabilityProblemEntityRecursive 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 NewCapabilityProblemEntityRecursive() *CapabilityProblemEntityRecursive { + this := CapabilityProblemEntityRecursive{} + return &this +} + +// NewCapabilityProblemEntityRecursiveWithDefaults instantiates a new CapabilityProblemEntityRecursive 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 NewCapabilityProblemEntityRecursiveWithDefaults() *CapabilityProblemEntityRecursive { + this := CapabilityProblemEntityRecursive{} + return &this +} + +// GetDocuments returns the Documents field value if set, zero value otherwise. +func (o *CapabilityProblemEntityRecursive) GetDocuments() []string { + if o == nil || common.IsNil(o.Documents) { + var ret []string + return ret + } + return o.Documents +} + +// GetDocumentsOk returns a tuple with the Documents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntityRecursive) GetDocumentsOk() ([]string, bool) { + if o == nil || common.IsNil(o.Documents) { + return nil, false + } + return o.Documents, true +} + +// HasDocuments returns a boolean if a field has been set. +func (o *CapabilityProblemEntityRecursive) HasDocuments() bool { + if o != nil && !common.IsNil(o.Documents) { + return true + } + + return false +} + +// SetDocuments gets a reference to the given []string and assigns it to the Documents field. +func (o *CapabilityProblemEntityRecursive) SetDocuments(v []string) { + o.Documents = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CapabilityProblemEntityRecursive) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntityRecursive) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CapabilityProblemEntityRecursive) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CapabilityProblemEntityRecursive) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CapabilityProblemEntityRecursive) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilityProblemEntityRecursive) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CapabilityProblemEntityRecursive) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CapabilityProblemEntityRecursive) SetType(v string) { + o.Type = &v +} + +func (o CapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapabilityProblemEntityRecursive) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Documents) { + toSerialize["documents"] = o.Documents + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCapabilityProblemEntityRecursive struct { + value *CapabilityProblemEntityRecursive + isSet bool +} + +func (v NullableCapabilityProblemEntityRecursive) Get() *CapabilityProblemEntityRecursive { + return v.value +} + +func (v *NullableCapabilityProblemEntityRecursive) Set(val *CapabilityProblemEntityRecursive) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilityProblemEntityRecursive) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilityProblemEntityRecursive) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilityProblemEntityRecursive(val *CapabilityProblemEntityRecursive) *NullableCapabilityProblemEntityRecursive { + return &NullableCapabilityProblemEntityRecursive{value: val, isSet: true} +} + +func (v NullableCapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilityProblemEntityRecursive) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CapabilityProblemEntityRecursive) isValidType() bool { + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_capability_settings.go b/src/configurationWebhook/model_capability_settings.go new file mode 100644 index 000000000..0690b7702 --- /dev/null +++ b/src/configurationWebhook/model_capability_settings.go @@ -0,0 +1,283 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CapabilitySettings type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CapabilitySettings{} + +// CapabilitySettings struct for CapabilitySettings +type CapabilitySettings struct { + // + AmountPerIndustry *map[string]Amount `json:"amountPerIndustry,omitempty"` + // + AuthorizedCardUsers *bool `json:"authorizedCardUsers,omitempty"` + // + FundingSource []string `json:"fundingSource,omitempty"` + // + Interval *string `json:"interval,omitempty"` + MaxAmount *Amount `json:"maxAmount,omitempty"` +} + +// NewCapabilitySettings instantiates a new CapabilitySettings 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 NewCapabilitySettings() *CapabilitySettings { + this := CapabilitySettings{} + return &this +} + +// NewCapabilitySettingsWithDefaults instantiates a new CapabilitySettings 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 NewCapabilitySettingsWithDefaults() *CapabilitySettings { + this := CapabilitySettings{} + return &this +} + +// GetAmountPerIndustry returns the AmountPerIndustry field value if set, zero value otherwise. +func (o *CapabilitySettings) GetAmountPerIndustry() map[string]Amount { + if o == nil || common.IsNil(o.AmountPerIndustry) { + var ret map[string]Amount + return ret + } + return *o.AmountPerIndustry +} + +// GetAmountPerIndustryOk returns a tuple with the AmountPerIndustry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetAmountPerIndustryOk() (*map[string]Amount, bool) { + if o == nil || common.IsNil(o.AmountPerIndustry) { + return nil, false + } + return o.AmountPerIndustry, true +} + +// HasAmountPerIndustry returns a boolean if a field has been set. +func (o *CapabilitySettings) HasAmountPerIndustry() bool { + if o != nil && !common.IsNil(o.AmountPerIndustry) { + return true + } + + return false +} + +// SetAmountPerIndustry gets a reference to the given map[string]Amount and assigns it to the AmountPerIndustry field. +func (o *CapabilitySettings) SetAmountPerIndustry(v map[string]Amount) { + o.AmountPerIndustry = &v +} + +// GetAuthorizedCardUsers returns the AuthorizedCardUsers field value if set, zero value otherwise. +func (o *CapabilitySettings) GetAuthorizedCardUsers() bool { + if o == nil || common.IsNil(o.AuthorizedCardUsers) { + var ret bool + return ret + } + return *o.AuthorizedCardUsers +} + +// GetAuthorizedCardUsersOk returns a tuple with the AuthorizedCardUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetAuthorizedCardUsersOk() (*bool, bool) { + if o == nil || common.IsNil(o.AuthorizedCardUsers) { + return nil, false + } + return o.AuthorizedCardUsers, true +} + +// HasAuthorizedCardUsers returns a boolean if a field has been set. +func (o *CapabilitySettings) HasAuthorizedCardUsers() bool { + if o != nil && !common.IsNil(o.AuthorizedCardUsers) { + return true + } + + return false +} + +// SetAuthorizedCardUsers gets a reference to the given bool and assigns it to the AuthorizedCardUsers field. +func (o *CapabilitySettings) SetAuthorizedCardUsers(v bool) { + o.AuthorizedCardUsers = &v +} + +// GetFundingSource returns the FundingSource field value if set, zero value otherwise. +func (o *CapabilitySettings) GetFundingSource() []string { + if o == nil || common.IsNil(o.FundingSource) { + var ret []string + return ret + } + return o.FundingSource +} + +// GetFundingSourceOk returns a tuple with the FundingSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetFundingSourceOk() ([]string, bool) { + if o == nil || common.IsNil(o.FundingSource) { + return nil, false + } + return o.FundingSource, true +} + +// HasFundingSource returns a boolean if a field has been set. +func (o *CapabilitySettings) HasFundingSource() bool { + if o != nil && !common.IsNil(o.FundingSource) { + return true + } + + return false +} + +// SetFundingSource gets a reference to the given []string and assigns it to the FundingSource field. +func (o *CapabilitySettings) SetFundingSource(v []string) { + o.FundingSource = v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *CapabilitySettings) GetInterval() string { + if o == nil || common.IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetIntervalOk() (*string, bool) { + if o == nil || common.IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *CapabilitySettings) HasInterval() bool { + if o != nil && !common.IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *CapabilitySettings) SetInterval(v string) { + o.Interval = &v +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise. +func (o *CapabilitySettings) GetMaxAmount() Amount { + if o == nil || common.IsNil(o.MaxAmount) { + var ret Amount + return ret + } + return *o.MaxAmount +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapabilitySettings) GetMaxAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.MaxAmount) { + return nil, false + } + return o.MaxAmount, true +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *CapabilitySettings) HasMaxAmount() bool { + if o != nil && !common.IsNil(o.MaxAmount) { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given Amount and assigns it to the MaxAmount field. +func (o *CapabilitySettings) SetMaxAmount(v Amount) { + o.MaxAmount = &v +} + +func (o CapabilitySettings) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapabilitySettings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AmountPerIndustry) { + toSerialize["amountPerIndustry"] = o.AmountPerIndustry + } + if !common.IsNil(o.AuthorizedCardUsers) { + toSerialize["authorizedCardUsers"] = o.AuthorizedCardUsers + } + if !common.IsNil(o.FundingSource) { + toSerialize["fundingSource"] = o.FundingSource + } + if !common.IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !common.IsNil(o.MaxAmount) { + toSerialize["maxAmount"] = o.MaxAmount + } + return toSerialize, nil +} + +type NullableCapabilitySettings struct { + value *CapabilitySettings + isSet bool +} + +func (v NullableCapabilitySettings) Get() *CapabilitySettings { + return v.value +} + +func (v *NullableCapabilitySettings) Set(val *CapabilitySettings) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilitySettings) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilitySettings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilitySettings(val *CapabilitySettings) *NullableCapabilitySettings { + return &NullableCapabilitySettings{value: val, isSet: true} +} + +func (v NullableCapabilitySettings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilitySettings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CapabilitySettings) isValidInterval() bool { + var allowedEnumValues = []string{ "daily", "monthly", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetInterval() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_card.go b/src/configurationWebhook/model_card.go new file mode 100644 index 000000000..def262168 --- /dev/null +++ b/src/configurationWebhook/model_card.go @@ -0,0 +1,531 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Card type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Card{} + +// Card struct for Card +type Card struct { + Authentication *Authentication `json:"authentication,omitempty"` + // The bank identification number (BIN) of the card number. + Bin *string `json:"bin,omitempty"` + // The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + Brand string `json:"brand"` + // The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. + BrandVariant string `json:"brandVariant"` + // The name of the cardholder. Maximum length: 26 characters. + CardholderName string `json:"cardholderName"` + Configuration *CardConfiguration `json:"configuration,omitempty"` + // The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + Cvc *string `json:"cvc,omitempty"` + DeliveryContact *Contact `json:"deliveryContact,omitempty"` + Expiration *Expiry `json:"expiration,omitempty"` + // The form factor of the card. Possible values: **virtual**, **physical**. + FormFactor string `json:"formFactor"` + // Last last four digits of the card number. + LastFour *string `json:"lastFour,omitempty"` + // The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + Number string `json:"number"` + // Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + ThreeDSecure *string `json:"threeDSecure,omitempty"` +} + +// NewCard instantiates a new Card 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 NewCard(brand string, brandVariant string, cardholderName string, formFactor string, number string) *Card { + this := Card{} + this.Brand = brand + this.BrandVariant = brandVariant + this.CardholderName = cardholderName + this.FormFactor = formFactor + this.Number = number + return &this +} + +// NewCardWithDefaults instantiates a new Card 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 NewCardWithDefaults() *Card { + this := Card{} + return &this +} + +// GetAuthentication returns the Authentication field value if set, zero value otherwise. +func (o *Card) GetAuthentication() Authentication { + if o == nil || common.IsNil(o.Authentication) { + var ret Authentication + return ret + } + return *o.Authentication +} + +// GetAuthenticationOk returns a tuple with the Authentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetAuthenticationOk() (*Authentication, bool) { + if o == nil || common.IsNil(o.Authentication) { + return nil, false + } + return o.Authentication, true +} + +// HasAuthentication returns a boolean if a field has been set. +func (o *Card) HasAuthentication() bool { + if o != nil && !common.IsNil(o.Authentication) { + return true + } + + return false +} + +// SetAuthentication gets a reference to the given Authentication and assigns it to the Authentication field. +func (o *Card) SetAuthentication(v Authentication) { + o.Authentication = &v +} + +// GetBin returns the Bin field value if set, zero value otherwise. +func (o *Card) GetBin() string { + if o == nil || common.IsNil(o.Bin) { + var ret string + return ret + } + return *o.Bin +} + +// GetBinOk returns a tuple with the Bin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetBinOk() (*string, bool) { + if o == nil || common.IsNil(o.Bin) { + return nil, false + } + return o.Bin, true +} + +// HasBin returns a boolean if a field has been set. +func (o *Card) HasBin() bool { + if o != nil && !common.IsNil(o.Bin) { + return true + } + + return false +} + +// SetBin gets a reference to the given string and assigns it to the Bin field. +func (o *Card) SetBin(v string) { + o.Bin = &v +} + +// GetBrand returns the Brand field value +func (o *Card) GetBrand() string { + if o == nil { + var ret string + return ret + } + + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value +// and a boolean to check if the value has been set. +func (o *Card) GetBrandOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Brand, true +} + +// SetBrand sets field value +func (o *Card) SetBrand(v string) { + o.Brand = v +} + +// GetBrandVariant returns the BrandVariant field value +func (o *Card) GetBrandVariant() string { + if o == nil { + var ret string + return ret + } + + return o.BrandVariant +} + +// GetBrandVariantOk returns a tuple with the BrandVariant field value +// and a boolean to check if the value has been set. +func (o *Card) GetBrandVariantOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandVariant, true +} + +// SetBrandVariant sets field value +func (o *Card) SetBrandVariant(v string) { + o.BrandVariant = v +} + +// GetCardholderName returns the CardholderName field value +func (o *Card) GetCardholderName() string { + if o == nil { + var ret string + return ret + } + + return o.CardholderName +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value +// and a boolean to check if the value has been set. +func (o *Card) GetCardholderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CardholderName, true +} + +// SetCardholderName sets field value +func (o *Card) SetCardholderName(v string) { + o.CardholderName = v +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *Card) GetConfiguration() CardConfiguration { + if o == nil || common.IsNil(o.Configuration) { + var ret CardConfiguration + return ret + } + return *o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetConfigurationOk() (*CardConfiguration, bool) { + if o == nil || common.IsNil(o.Configuration) { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *Card) HasConfiguration() bool { + if o != nil && !common.IsNil(o.Configuration) { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given CardConfiguration and assigns it to the Configuration field. +func (o *Card) SetConfiguration(v CardConfiguration) { + o.Configuration = &v +} + +// GetCvc returns the Cvc field value if set, zero value otherwise. +func (o *Card) GetCvc() string { + if o == nil || common.IsNil(o.Cvc) { + var ret string + return ret + } + return *o.Cvc +} + +// GetCvcOk returns a tuple with the Cvc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetCvcOk() (*string, bool) { + if o == nil || common.IsNil(o.Cvc) { + return nil, false + } + return o.Cvc, true +} + +// HasCvc returns a boolean if a field has been set. +func (o *Card) HasCvc() bool { + if o != nil && !common.IsNil(o.Cvc) { + return true + } + + return false +} + +// SetCvc gets a reference to the given string and assigns it to the Cvc field. +func (o *Card) SetCvc(v string) { + o.Cvc = &v +} + +// GetDeliveryContact returns the DeliveryContact field value if set, zero value otherwise. +func (o *Card) GetDeliveryContact() Contact { + if o == nil || common.IsNil(o.DeliveryContact) { + var ret Contact + return ret + } + return *o.DeliveryContact +} + +// GetDeliveryContactOk returns a tuple with the DeliveryContact field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetDeliveryContactOk() (*Contact, bool) { + if o == nil || common.IsNil(o.DeliveryContact) { + return nil, false + } + return o.DeliveryContact, true +} + +// HasDeliveryContact returns a boolean if a field has been set. +func (o *Card) HasDeliveryContact() bool { + if o != nil && !common.IsNil(o.DeliveryContact) { + return true + } + + return false +} + +// SetDeliveryContact gets a reference to the given Contact and assigns it to the DeliveryContact field. +func (o *Card) SetDeliveryContact(v Contact) { + o.DeliveryContact = &v +} + +// GetExpiration returns the Expiration field value if set, zero value otherwise. +func (o *Card) GetExpiration() Expiry { + if o == nil || common.IsNil(o.Expiration) { + var ret Expiry + return ret + } + return *o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetExpirationOk() (*Expiry, bool) { + if o == nil || common.IsNil(o.Expiration) { + return nil, false + } + return o.Expiration, true +} + +// HasExpiration returns a boolean if a field has been set. +func (o *Card) HasExpiration() bool { + if o != nil && !common.IsNil(o.Expiration) { + return true + } + + return false +} + +// SetExpiration gets a reference to the given Expiry and assigns it to the Expiration field. +func (o *Card) SetExpiration(v Expiry) { + o.Expiration = &v +} + +// GetFormFactor returns the FormFactor field value +func (o *Card) GetFormFactor() string { + if o == nil { + var ret string + return ret + } + + return o.FormFactor +} + +// GetFormFactorOk returns a tuple with the FormFactor field value +// and a boolean to check if the value has been set. +func (o *Card) GetFormFactorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FormFactor, true +} + +// SetFormFactor sets field value +func (o *Card) SetFormFactor(v string) { + o.FormFactor = v +} + +// GetLastFour returns the LastFour field value if set, zero value otherwise. +func (o *Card) GetLastFour() string { + if o == nil || common.IsNil(o.LastFour) { + var ret string + return ret + } + return *o.LastFour +} + +// GetLastFourOk returns a tuple with the LastFour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetLastFourOk() (*string, bool) { + if o == nil || common.IsNil(o.LastFour) { + return nil, false + } + return o.LastFour, true +} + +// HasLastFour returns a boolean if a field has been set. +func (o *Card) HasLastFour() bool { + if o != nil && !common.IsNil(o.LastFour) { + return true + } + + return false +} + +// SetLastFour gets a reference to the given string and assigns it to the LastFour field. +func (o *Card) SetLastFour(v string) { + o.LastFour = &v +} + +// GetNumber returns the Number field value +func (o *Card) GetNumber() string { + if o == nil { + var ret string + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Card) GetNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Card) SetNumber(v string) { + o.Number = v +} + +// GetThreeDSecure returns the ThreeDSecure field value if set, zero value otherwise. +func (o *Card) GetThreeDSecure() string { + if o == nil || common.IsNil(o.ThreeDSecure) { + var ret string + return ret + } + return *o.ThreeDSecure +} + +// GetThreeDSecureOk returns a tuple with the ThreeDSecure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetThreeDSecureOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSecure) { + return nil, false + } + return o.ThreeDSecure, true +} + +// HasThreeDSecure returns a boolean if a field has been set. +func (o *Card) HasThreeDSecure() bool { + if o != nil && !common.IsNil(o.ThreeDSecure) { + return true + } + + return false +} + +// SetThreeDSecure gets a reference to the given string and assigns it to the ThreeDSecure field. +func (o *Card) SetThreeDSecure(v string) { + o.ThreeDSecure = &v +} + +func (o Card) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Card) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Authentication) { + toSerialize["authentication"] = o.Authentication + } + if !common.IsNil(o.Bin) { + toSerialize["bin"] = o.Bin + } + toSerialize["brand"] = o.Brand + toSerialize["brandVariant"] = o.BrandVariant + toSerialize["cardholderName"] = o.CardholderName + if !common.IsNil(o.Configuration) { + toSerialize["configuration"] = o.Configuration + } + if !common.IsNil(o.Cvc) { + toSerialize["cvc"] = o.Cvc + } + if !common.IsNil(o.DeliveryContact) { + toSerialize["deliveryContact"] = o.DeliveryContact + } + if !common.IsNil(o.Expiration) { + toSerialize["expiration"] = o.Expiration + } + toSerialize["formFactor"] = o.FormFactor + if !common.IsNil(o.LastFour) { + toSerialize["lastFour"] = o.LastFour + } + toSerialize["number"] = o.Number + if !common.IsNil(o.ThreeDSecure) { + toSerialize["threeDSecure"] = o.ThreeDSecure + } + return toSerialize, nil +} + +type NullableCard struct { + value *Card + isSet bool +} + +func (v NullableCard) Get() *Card { + return v.value +} + +func (v *NullableCard) Set(val *Card) { + v.value = val + v.isSet = true +} + +func (v NullableCard) IsSet() bool { + return v.isSet +} + +func (v *NullableCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCard(val *Card) *NullableCard { + return &NullableCard{value: val, isSet: true} +} + +func (v NullableCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Card) isValidFormFactor() bool { + var allowedEnumValues = []string{ "physical", "unknown", "virtual" } + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_card_configuration.go b/src/configurationWebhook/model_card_configuration.go new file mode 100644 index 000000000..44f453243 --- /dev/null +++ b/src/configurationWebhook/model_card_configuration.go @@ -0,0 +1,598 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardConfiguration type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardConfiguration{} + +// CardConfiguration struct for CardConfiguration +type CardConfiguration struct { + // Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + Activation *string `json:"activation,omitempty"` + // Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + ActivationUrl *string `json:"activationUrl,omitempty"` + BulkAddress *BulkAddress `json:"bulkAddress,omitempty"` + // The ID of the card image. This is the image that will be printed on the full front of the card. + CardImageId *string `json:"cardImageId,omitempty"` + // Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + Carrier *string `json:"carrier,omitempty"` + // The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + CarrierImageId *string `json:"carrierImageId,omitempty"` + // The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + ConfigurationProfileId string `json:"configurationProfileId"` + // The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + Currency *string `json:"currency,omitempty"` + // Overrides the envelope design ID defined in the `configurationProfileId`. + Envelope *string `json:"envelope,omitempty"` + // Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + Insert *string `json:"insert,omitempty"` + // The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code of the card. For example, **en**. + Language *string `json:"language,omitempty"` + // The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + LogoImageId *string `json:"logoImageId,omitempty"` + // Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + PinMailer *string `json:"pinMailer,omitempty"` + // Overrides the logistics company defined in the `configurationProfileId`. + ShipmentMethod *string `json:"shipmentMethod,omitempty"` +} + +// NewCardConfiguration instantiates a new CardConfiguration 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 NewCardConfiguration(configurationProfileId string) *CardConfiguration { + this := CardConfiguration{} + this.ConfigurationProfileId = configurationProfileId + return &this +} + +// NewCardConfigurationWithDefaults instantiates a new CardConfiguration 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 NewCardConfigurationWithDefaults() *CardConfiguration { + this := CardConfiguration{} + return &this +} + +// GetActivation returns the Activation field value if set, zero value otherwise. +func (o *CardConfiguration) GetActivation() string { + if o == nil || common.IsNil(o.Activation) { + var ret string + return ret + } + return *o.Activation +} + +// GetActivationOk returns a tuple with the Activation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetActivationOk() (*string, bool) { + if o == nil || common.IsNil(o.Activation) { + return nil, false + } + return o.Activation, true +} + +// HasActivation returns a boolean if a field has been set. +func (o *CardConfiguration) HasActivation() bool { + if o != nil && !common.IsNil(o.Activation) { + return true + } + + return false +} + +// SetActivation gets a reference to the given string and assigns it to the Activation field. +func (o *CardConfiguration) SetActivation(v string) { + o.Activation = &v +} + +// GetActivationUrl returns the ActivationUrl field value if set, zero value otherwise. +func (o *CardConfiguration) GetActivationUrl() string { + if o == nil || common.IsNil(o.ActivationUrl) { + var ret string + return ret + } + return *o.ActivationUrl +} + +// GetActivationUrlOk returns a tuple with the ActivationUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetActivationUrlOk() (*string, bool) { + if o == nil || common.IsNil(o.ActivationUrl) { + return nil, false + } + return o.ActivationUrl, true +} + +// HasActivationUrl returns a boolean if a field has been set. +func (o *CardConfiguration) HasActivationUrl() bool { + if o != nil && !common.IsNil(o.ActivationUrl) { + return true + } + + return false +} + +// SetActivationUrl gets a reference to the given string and assigns it to the ActivationUrl field. +func (o *CardConfiguration) SetActivationUrl(v string) { + o.ActivationUrl = &v +} + +// GetBulkAddress returns the BulkAddress field value if set, zero value otherwise. +func (o *CardConfiguration) GetBulkAddress() BulkAddress { + if o == nil || common.IsNil(o.BulkAddress) { + var ret BulkAddress + return ret + } + return *o.BulkAddress +} + +// GetBulkAddressOk returns a tuple with the BulkAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetBulkAddressOk() (*BulkAddress, bool) { + if o == nil || common.IsNil(o.BulkAddress) { + return nil, false + } + return o.BulkAddress, true +} + +// HasBulkAddress returns a boolean if a field has been set. +func (o *CardConfiguration) HasBulkAddress() bool { + if o != nil && !common.IsNil(o.BulkAddress) { + return true + } + + return false +} + +// SetBulkAddress gets a reference to the given BulkAddress and assigns it to the BulkAddress field. +func (o *CardConfiguration) SetBulkAddress(v BulkAddress) { + o.BulkAddress = &v +} + +// GetCardImageId returns the CardImageId field value if set, zero value otherwise. +func (o *CardConfiguration) GetCardImageId() string { + if o == nil || common.IsNil(o.CardImageId) { + var ret string + return ret + } + return *o.CardImageId +} + +// GetCardImageIdOk returns a tuple with the CardImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetCardImageIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CardImageId) { + return nil, false + } + return o.CardImageId, true +} + +// HasCardImageId returns a boolean if a field has been set. +func (o *CardConfiguration) HasCardImageId() bool { + if o != nil && !common.IsNil(o.CardImageId) { + return true + } + + return false +} + +// SetCardImageId gets a reference to the given string and assigns it to the CardImageId field. +func (o *CardConfiguration) SetCardImageId(v string) { + o.CardImageId = &v +} + +// GetCarrier returns the Carrier field value if set, zero value otherwise. +func (o *CardConfiguration) GetCarrier() string { + if o == nil || common.IsNil(o.Carrier) { + var ret string + return ret + } + return *o.Carrier +} + +// GetCarrierOk returns a tuple with the Carrier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetCarrierOk() (*string, bool) { + if o == nil || common.IsNil(o.Carrier) { + return nil, false + } + return o.Carrier, true +} + +// HasCarrier returns a boolean if a field has been set. +func (o *CardConfiguration) HasCarrier() bool { + if o != nil && !common.IsNil(o.Carrier) { + return true + } + + return false +} + +// SetCarrier gets a reference to the given string and assigns it to the Carrier field. +func (o *CardConfiguration) SetCarrier(v string) { + o.Carrier = &v +} + +// GetCarrierImageId returns the CarrierImageId field value if set, zero value otherwise. +func (o *CardConfiguration) GetCarrierImageId() string { + if o == nil || common.IsNil(o.CarrierImageId) { + var ret string + return ret + } + return *o.CarrierImageId +} + +// GetCarrierImageIdOk returns a tuple with the CarrierImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetCarrierImageIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CarrierImageId) { + return nil, false + } + return o.CarrierImageId, true +} + +// HasCarrierImageId returns a boolean if a field has been set. +func (o *CardConfiguration) HasCarrierImageId() bool { + if o != nil && !common.IsNil(o.CarrierImageId) { + return true + } + + return false +} + +// SetCarrierImageId gets a reference to the given string and assigns it to the CarrierImageId field. +func (o *CardConfiguration) SetCarrierImageId(v string) { + o.CarrierImageId = &v +} + +// GetConfigurationProfileId returns the ConfigurationProfileId field value +func (o *CardConfiguration) GetConfigurationProfileId() string { + if o == nil { + var ret string + return ret + } + + return o.ConfigurationProfileId +} + +// GetConfigurationProfileIdOk returns a tuple with the ConfigurationProfileId field value +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetConfigurationProfileIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConfigurationProfileId, true +} + +// SetConfigurationProfileId sets field value +func (o *CardConfiguration) SetConfigurationProfileId(v string) { + o.ConfigurationProfileId = v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *CardConfiguration) GetCurrency() string { + if o == nil || common.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetCurrencyOk() (*string, bool) { + if o == nil || common.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *CardConfiguration) HasCurrency() bool { + if o != nil && !common.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *CardConfiguration) SetCurrency(v string) { + o.Currency = &v +} + +// GetEnvelope returns the Envelope field value if set, zero value otherwise. +func (o *CardConfiguration) GetEnvelope() string { + if o == nil || common.IsNil(o.Envelope) { + var ret string + return ret + } + return *o.Envelope +} + +// GetEnvelopeOk returns a tuple with the Envelope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetEnvelopeOk() (*string, bool) { + if o == nil || common.IsNil(o.Envelope) { + return nil, false + } + return o.Envelope, true +} + +// HasEnvelope returns a boolean if a field has been set. +func (o *CardConfiguration) HasEnvelope() bool { + if o != nil && !common.IsNil(o.Envelope) { + return true + } + + return false +} + +// SetEnvelope gets a reference to the given string and assigns it to the Envelope field. +func (o *CardConfiguration) SetEnvelope(v string) { + o.Envelope = &v +} + +// GetInsert returns the Insert field value if set, zero value otherwise. +func (o *CardConfiguration) GetInsert() string { + if o == nil || common.IsNil(o.Insert) { + var ret string + return ret + } + return *o.Insert +} + +// GetInsertOk returns a tuple with the Insert field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetInsertOk() (*string, bool) { + if o == nil || common.IsNil(o.Insert) { + return nil, false + } + return o.Insert, true +} + +// HasInsert returns a boolean if a field has been set. +func (o *CardConfiguration) HasInsert() bool { + if o != nil && !common.IsNil(o.Insert) { + return true + } + + return false +} + +// SetInsert gets a reference to the given string and assigns it to the Insert field. +func (o *CardConfiguration) SetInsert(v string) { + o.Insert = &v +} + +// GetLanguage returns the Language field value if set, zero value otherwise. +func (o *CardConfiguration) GetLanguage() string { + if o == nil || common.IsNil(o.Language) { + var ret string + return ret + } + return *o.Language +} + +// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetLanguageOk() (*string, bool) { + if o == nil || common.IsNil(o.Language) { + return nil, false + } + return o.Language, true +} + +// HasLanguage returns a boolean if a field has been set. +func (o *CardConfiguration) HasLanguage() bool { + if o != nil && !common.IsNil(o.Language) { + return true + } + + return false +} + +// SetLanguage gets a reference to the given string and assigns it to the Language field. +func (o *CardConfiguration) SetLanguage(v string) { + o.Language = &v +} + +// GetLogoImageId returns the LogoImageId field value if set, zero value otherwise. +func (o *CardConfiguration) GetLogoImageId() string { + if o == nil || common.IsNil(o.LogoImageId) { + var ret string + return ret + } + return *o.LogoImageId +} + +// GetLogoImageIdOk returns a tuple with the LogoImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetLogoImageIdOk() (*string, bool) { + if o == nil || common.IsNil(o.LogoImageId) { + return nil, false + } + return o.LogoImageId, true +} + +// HasLogoImageId returns a boolean if a field has been set. +func (o *CardConfiguration) HasLogoImageId() bool { + if o != nil && !common.IsNil(o.LogoImageId) { + return true + } + + return false +} + +// SetLogoImageId gets a reference to the given string and assigns it to the LogoImageId field. +func (o *CardConfiguration) SetLogoImageId(v string) { + o.LogoImageId = &v +} + +// GetPinMailer returns the PinMailer field value if set, zero value otherwise. +func (o *CardConfiguration) GetPinMailer() string { + if o == nil || common.IsNil(o.PinMailer) { + var ret string + return ret + } + return *o.PinMailer +} + +// GetPinMailerOk returns a tuple with the PinMailer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetPinMailerOk() (*string, bool) { + if o == nil || common.IsNil(o.PinMailer) { + return nil, false + } + return o.PinMailer, true +} + +// HasPinMailer returns a boolean if a field has been set. +func (o *CardConfiguration) HasPinMailer() bool { + if o != nil && !common.IsNil(o.PinMailer) { + return true + } + + return false +} + +// SetPinMailer gets a reference to the given string and assigns it to the PinMailer field. +func (o *CardConfiguration) SetPinMailer(v string) { + o.PinMailer = &v +} + +// GetShipmentMethod returns the ShipmentMethod field value if set, zero value otherwise. +func (o *CardConfiguration) GetShipmentMethod() string { + if o == nil || common.IsNil(o.ShipmentMethod) { + var ret string + return ret + } + return *o.ShipmentMethod +} + +// GetShipmentMethodOk returns a tuple with the ShipmentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardConfiguration) GetShipmentMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.ShipmentMethod) { + return nil, false + } + return o.ShipmentMethod, true +} + +// HasShipmentMethod returns a boolean if a field has been set. +func (o *CardConfiguration) HasShipmentMethod() bool { + if o != nil && !common.IsNil(o.ShipmentMethod) { + return true + } + + return false +} + +// SetShipmentMethod gets a reference to the given string and assigns it to the ShipmentMethod field. +func (o *CardConfiguration) SetShipmentMethod(v string) { + o.ShipmentMethod = &v +} + +func (o CardConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Activation) { + toSerialize["activation"] = o.Activation + } + if !common.IsNil(o.ActivationUrl) { + toSerialize["activationUrl"] = o.ActivationUrl + } + if !common.IsNil(o.BulkAddress) { + toSerialize["bulkAddress"] = o.BulkAddress + } + if !common.IsNil(o.CardImageId) { + toSerialize["cardImageId"] = o.CardImageId + } + if !common.IsNil(o.Carrier) { + toSerialize["carrier"] = o.Carrier + } + if !common.IsNil(o.CarrierImageId) { + toSerialize["carrierImageId"] = o.CarrierImageId + } + toSerialize["configurationProfileId"] = o.ConfigurationProfileId + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Envelope) { + toSerialize["envelope"] = o.Envelope + } + if !common.IsNil(o.Insert) { + toSerialize["insert"] = o.Insert + } + if !common.IsNil(o.Language) { + toSerialize["language"] = o.Language + } + if !common.IsNil(o.LogoImageId) { + toSerialize["logoImageId"] = o.LogoImageId + } + if !common.IsNil(o.PinMailer) { + toSerialize["pinMailer"] = o.PinMailer + } + if !common.IsNil(o.ShipmentMethod) { + toSerialize["shipmentMethod"] = o.ShipmentMethod + } + return toSerialize, nil +} + +type NullableCardConfiguration struct { + value *CardConfiguration + isSet bool +} + +func (v NullableCardConfiguration) Get() *CardConfiguration { + return v.value +} + +func (v *NullableCardConfiguration) Set(val *CardConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableCardConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableCardConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardConfiguration(val *CardConfiguration) *NullableCardConfiguration { + return &NullableCardConfiguration{value: val, isSet: true} +} + +func (v NullableCardConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_card_order_item.go b/src/configurationWebhook/model_card_order_item.go new file mode 100644 index 000000000..ddf2e609d --- /dev/null +++ b/src/configurationWebhook/model_card_order_item.go @@ -0,0 +1,385 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the CardOrderItem type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrderItem{} + +// CardOrderItem struct for CardOrderItem +type CardOrderItem struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + Card *CardOrderItemDeliveryStatus `json:"card,omitempty"` + // The unique identifier of the card order item. + CardOrderItemId *string `json:"cardOrderItemId,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` + // The unique identifier of the payment instrument related to the card order item. + PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` + Pin *CardOrderItemDeliveryStatus `json:"pin,omitempty"` + // Shipping method used to deliver the card or the PIN. + ShippingMethod *string `json:"shippingMethod,omitempty"` +} + +// NewCardOrderItem instantiates a new CardOrderItem 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 NewCardOrderItem() *CardOrderItem { + this := CardOrderItem{} + return &this +} + +// NewCardOrderItemWithDefaults instantiates a new CardOrderItem 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 NewCardOrderItemWithDefaults() *CardOrderItem { + this := CardOrderItem{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *CardOrderItem) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *CardOrderItem) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *CardOrderItem) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCard returns the Card field value if set, zero value otherwise. +func (o *CardOrderItem) GetCard() CardOrderItemDeliveryStatus { + if o == nil || common.IsNil(o.Card) { + var ret CardOrderItemDeliveryStatus + return ret + } + return *o.Card +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCardOk() (*CardOrderItemDeliveryStatus, bool) { + if o == nil || common.IsNil(o.Card) { + return nil, false + } + return o.Card, true +} + +// HasCard returns a boolean if a field has been set. +func (o *CardOrderItem) HasCard() bool { + if o != nil && !common.IsNil(o.Card) { + return true + } + + return false +} + +// SetCard gets a reference to the given CardOrderItemDeliveryStatus and assigns it to the Card field. +func (o *CardOrderItem) SetCard(v CardOrderItemDeliveryStatus) { + o.Card = &v +} + +// GetCardOrderItemId returns the CardOrderItemId field value if set, zero value otherwise. +func (o *CardOrderItem) GetCardOrderItemId() string { + if o == nil || common.IsNil(o.CardOrderItemId) { + var ret string + return ret + } + return *o.CardOrderItemId +} + +// GetCardOrderItemIdOk returns a tuple with the CardOrderItemId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCardOrderItemIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CardOrderItemId) { + return nil, false + } + return o.CardOrderItemId, true +} + +// HasCardOrderItemId returns a boolean if a field has been set. +func (o *CardOrderItem) HasCardOrderItemId() bool { + if o != nil && !common.IsNil(o.CardOrderItemId) { + return true + } + + return false +} + +// SetCardOrderItemId gets a reference to the given string and assigns it to the CardOrderItemId field. +func (o *CardOrderItem) SetCardOrderItemId(v string) { + o.CardOrderItemId = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *CardOrderItem) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *CardOrderItem) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *CardOrderItem) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CardOrderItem) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CardOrderItem) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CardOrderItem) SetId(v string) { + o.Id = &v +} + +// GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. +func (o *CardOrderItem) GetPaymentInstrumentId() string { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + var ret string + return ret + } + return *o.PaymentInstrumentId +} + +// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetPaymentInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + return nil, false + } + return o.PaymentInstrumentId, true +} + +// HasPaymentInstrumentId returns a boolean if a field has been set. +func (o *CardOrderItem) HasPaymentInstrumentId() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentId) { + return true + } + + return false +} + +// SetPaymentInstrumentId gets a reference to the given string and assigns it to the PaymentInstrumentId field. +func (o *CardOrderItem) SetPaymentInstrumentId(v string) { + o.PaymentInstrumentId = &v +} + +// GetPin returns the Pin field value if set, zero value otherwise. +func (o *CardOrderItem) GetPin() CardOrderItemDeliveryStatus { + if o == nil || common.IsNil(o.Pin) { + var ret CardOrderItemDeliveryStatus + return ret + } + return *o.Pin +} + +// GetPinOk returns a tuple with the Pin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetPinOk() (*CardOrderItemDeliveryStatus, bool) { + if o == nil || common.IsNil(o.Pin) { + return nil, false + } + return o.Pin, true +} + +// HasPin returns a boolean if a field has been set. +func (o *CardOrderItem) HasPin() bool { + if o != nil && !common.IsNil(o.Pin) { + return true + } + + return false +} + +// SetPin gets a reference to the given CardOrderItemDeliveryStatus and assigns it to the Pin field. +func (o *CardOrderItem) SetPin(v CardOrderItemDeliveryStatus) { + o.Pin = &v +} + +// GetShippingMethod returns the ShippingMethod field value if set, zero value otherwise. +func (o *CardOrderItem) GetShippingMethod() string { + if o == nil || common.IsNil(o.ShippingMethod) { + var ret string + return ret + } + return *o.ShippingMethod +} + +// GetShippingMethodOk returns a tuple with the ShippingMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetShippingMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.ShippingMethod) { + return nil, false + } + return o.ShippingMethod, true +} + +// HasShippingMethod returns a boolean if a field has been set. +func (o *CardOrderItem) HasShippingMethod() bool { + if o != nil && !common.IsNil(o.ShippingMethod) { + return true + } + + return false +} + +// SetShippingMethod gets a reference to the given string and assigns it to the ShippingMethod field. +func (o *CardOrderItem) SetShippingMethod(v string) { + o.ShippingMethod = &v +} + +func (o CardOrderItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrderItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.Card) { + toSerialize["card"] = o.Card + } + if !common.IsNil(o.CardOrderItemId) { + toSerialize["cardOrderItemId"] = o.CardOrderItemId + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.PaymentInstrumentId) { + toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId + } + if !common.IsNil(o.Pin) { + toSerialize["pin"] = o.Pin + } + if !common.IsNil(o.ShippingMethod) { + toSerialize["shippingMethod"] = o.ShippingMethod + } + return toSerialize, nil +} + +type NullableCardOrderItem struct { + value *CardOrderItem + isSet bool +} + +func (v NullableCardOrderItem) Get() *CardOrderItem { + return v.value +} + +func (v *NullableCardOrderItem) Set(val *CardOrderItem) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrderItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrderItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrderItem(val *CardOrderItem) *NullableCardOrderItem { + return &NullableCardOrderItem{value: val, isSet: true} +} + +func (v NullableCardOrderItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrderItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_card_order_item_delivery_status.go b/src/configurationWebhook/model_card_order_item_delivery_status.go new file mode 100644 index 000000000..0eeaa052f --- /dev/null +++ b/src/configurationWebhook/model_card_order_item_delivery_status.go @@ -0,0 +1,210 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardOrderItemDeliveryStatus type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrderItemDeliveryStatus{} + +// CardOrderItemDeliveryStatus struct for CardOrderItemDeliveryStatus +type CardOrderItemDeliveryStatus struct { + // Error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Status of the delivery. + Status *string `json:"status,omitempty"` + // Tracking number of the delivery. + TrackingNumber *string `json:"trackingNumber,omitempty"` +} + +// NewCardOrderItemDeliveryStatus instantiates a new CardOrderItemDeliveryStatus 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 NewCardOrderItemDeliveryStatus() *CardOrderItemDeliveryStatus { + this := CardOrderItemDeliveryStatus{} + return &this +} + +// NewCardOrderItemDeliveryStatusWithDefaults instantiates a new CardOrderItemDeliveryStatus 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 NewCardOrderItemDeliveryStatusWithDefaults() *CardOrderItemDeliveryStatus { + this := CardOrderItemDeliveryStatus{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetErrorMessage() string { + if o == nil || common.IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetErrorMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasErrorMessage() bool { + if o != nil && !common.IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *CardOrderItemDeliveryStatus) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CardOrderItemDeliveryStatus) SetStatus(v string) { + o.Status = &v +} + +// GetTrackingNumber returns the TrackingNumber field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetTrackingNumber() string { + if o == nil || common.IsNil(o.TrackingNumber) { + var ret string + return ret + } + return *o.TrackingNumber +} + +// GetTrackingNumberOk returns a tuple with the TrackingNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetTrackingNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TrackingNumber) { + return nil, false + } + return o.TrackingNumber, true +} + +// HasTrackingNumber returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasTrackingNumber() bool { + if o != nil && !common.IsNil(o.TrackingNumber) { + return true + } + + return false +} + +// SetTrackingNumber gets a reference to the given string and assigns it to the TrackingNumber field. +func (o *CardOrderItemDeliveryStatus) SetTrackingNumber(v string) { + o.TrackingNumber = &v +} + +func (o CardOrderItemDeliveryStatus) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrderItemDeliveryStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.TrackingNumber) { + toSerialize["trackingNumber"] = o.TrackingNumber + } + return toSerialize, nil +} + +type NullableCardOrderItemDeliveryStatus struct { + value *CardOrderItemDeliveryStatus + isSet bool +} + +func (v NullableCardOrderItemDeliveryStatus) Get() *CardOrderItemDeliveryStatus { + return v.value +} + +func (v *NullableCardOrderItemDeliveryStatus) Set(val *CardOrderItemDeliveryStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrderItemDeliveryStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrderItemDeliveryStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrderItemDeliveryStatus(val *CardOrderItemDeliveryStatus) *NullableCardOrderItemDeliveryStatus { + return &NullableCardOrderItemDeliveryStatus{value: val, isSet: true} +} + +func (v NullableCardOrderItemDeliveryStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrderItemDeliveryStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CardOrderItemDeliveryStatus) isValidStatus() bool { + var allowedEnumValues = []string{ "created", "delivered", "notApplicable", "processing", "produced", "rejected", "shipped", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_card_order_notification_request.go b/src/configurationWebhook/model_card_order_notification_request.go new file mode 100644 index 000000000..1f19c8525 --- /dev/null +++ b/src/configurationWebhook/model_card_order_notification_request.go @@ -0,0 +1,182 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardOrderNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrderNotificationRequest{} + +// CardOrderNotificationRequest struct for CardOrderNotificationRequest +type CardOrderNotificationRequest struct { + Data CardOrderItem `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewCardOrderNotificationRequest instantiates a new CardOrderNotificationRequest 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 NewCardOrderNotificationRequest(data CardOrderItem, environment string, type_ string) *CardOrderNotificationRequest { + this := CardOrderNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewCardOrderNotificationRequestWithDefaults instantiates a new CardOrderNotificationRequest 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 NewCardOrderNotificationRequestWithDefaults() *CardOrderNotificationRequest { + this := CardOrderNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *CardOrderNotificationRequest) GetData() CardOrderItem { + if o == nil { + var ret CardOrderItem + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CardOrderNotificationRequest) GetDataOk() (*CardOrderItem, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *CardOrderNotificationRequest) SetData(v CardOrderItem) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *CardOrderNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *CardOrderNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *CardOrderNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *CardOrderNotificationRequest) 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 *CardOrderNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CardOrderNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o CardOrderNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrderNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableCardOrderNotificationRequest struct { + value *CardOrderNotificationRequest + isSet bool +} + +func (v NullableCardOrderNotificationRequest) Get() *CardOrderNotificationRequest { + return v.value +} + +func (v *NullableCardOrderNotificationRequest) Set(val *CardOrderNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrderNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrderNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrderNotificationRequest(val *CardOrderNotificationRequest) *NullableCardOrderNotificationRequest { + return &NullableCardOrderNotificationRequest{value: val, isSet: true} +} + +func (v NullableCardOrderNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrderNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CardOrderNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.cardorder.created", "balancePlatform.cardorder.updated" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_contact.go b/src/configurationWebhook/model_contact.go new file mode 100644 index 000000000..384eea8b0 --- /dev/null +++ b/src/configurationWebhook/model_contact.go @@ -0,0 +1,345 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Contact type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Contact{} + +// Contact struct for Contact +type Contact struct { + Address *Address `json:"address,omitempty"` + // The e-mail address of the contact. + Email *string `json:"email,omitempty"` + // The phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + FullPhoneNumber *string `json:"fullPhoneNumber,omitempty"` + Name *Name `json:"name,omitempty"` + PersonalData *PersonalData `json:"personalData,omitempty"` + PhoneNumber *PhoneNumber `json:"phoneNumber,omitempty"` + // The URL of the website of the contact. + WebAddress *string `json:"webAddress,omitempty"` +} + +// NewContact instantiates a new Contact 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 NewContact() *Contact { + this := Contact{} + return &this +} + +// NewContactWithDefaults instantiates a new Contact 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 NewContactWithDefaults() *Contact { + this := Contact{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Contact) GetAddress() Address { + if o == nil || common.IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetAddressOk() (*Address, bool) { + if o == nil || common.IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Contact) HasAddress() bool { + if o != nil && !common.IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *Contact) SetAddress(v Address) { + o.Address = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *Contact) GetEmail() string { + if o == nil || common.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetEmailOk() (*string, bool) { + if o == nil || common.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *Contact) HasEmail() bool { + if o != nil && !common.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *Contact) SetEmail(v string) { + o.Email = &v +} + +// GetFullPhoneNumber returns the FullPhoneNumber field value if set, zero value otherwise. +func (o *Contact) GetFullPhoneNumber() string { + if o == nil || common.IsNil(o.FullPhoneNumber) { + var ret string + return ret + } + return *o.FullPhoneNumber +} + +// GetFullPhoneNumberOk returns a tuple with the FullPhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetFullPhoneNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.FullPhoneNumber) { + return nil, false + } + return o.FullPhoneNumber, true +} + +// HasFullPhoneNumber returns a boolean if a field has been set. +func (o *Contact) HasFullPhoneNumber() bool { + if o != nil && !common.IsNil(o.FullPhoneNumber) { + return true + } + + return false +} + +// SetFullPhoneNumber gets a reference to the given string and assigns it to the FullPhoneNumber field. +func (o *Contact) SetFullPhoneNumber(v string) { + o.FullPhoneNumber = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Contact) GetName() Name { + if o == nil || common.IsNil(o.Name) { + var ret Name + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetNameOk() (*Name, bool) { + if o == nil || common.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Contact) HasName() bool { + if o != nil && !common.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given Name and assigns it to the Name field. +func (o *Contact) SetName(v Name) { + o.Name = &v +} + +// GetPersonalData returns the PersonalData field value if set, zero value otherwise. +func (o *Contact) GetPersonalData() PersonalData { + if o == nil || common.IsNil(o.PersonalData) { + var ret PersonalData + return ret + } + return *o.PersonalData +} + +// GetPersonalDataOk returns a tuple with the PersonalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetPersonalDataOk() (*PersonalData, bool) { + if o == nil || common.IsNil(o.PersonalData) { + return nil, false + } + return o.PersonalData, true +} + +// HasPersonalData returns a boolean if a field has been set. +func (o *Contact) HasPersonalData() bool { + if o != nil && !common.IsNil(o.PersonalData) { + return true + } + + return false +} + +// SetPersonalData gets a reference to the given PersonalData and assigns it to the PersonalData field. +func (o *Contact) SetPersonalData(v PersonalData) { + o.PersonalData = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *Contact) GetPhoneNumber() PhoneNumber { + if o == nil || common.IsNil(o.PhoneNumber) { + var ret PhoneNumber + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetPhoneNumberOk() (*PhoneNumber, bool) { + if o == nil || common.IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *Contact) HasPhoneNumber() bool { + if o != nil && !common.IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given PhoneNumber and assigns it to the PhoneNumber field. +func (o *Contact) SetPhoneNumber(v PhoneNumber) { + o.PhoneNumber = &v +} + +// GetWebAddress returns the WebAddress field value if set, zero value otherwise. +func (o *Contact) GetWebAddress() string { + if o == nil || common.IsNil(o.WebAddress) { + var ret string + return ret + } + return *o.WebAddress +} + +// GetWebAddressOk returns a tuple with the WebAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Contact) GetWebAddressOk() (*string, bool) { + if o == nil || common.IsNil(o.WebAddress) { + return nil, false + } + return o.WebAddress, true +} + +// HasWebAddress returns a boolean if a field has been set. +func (o *Contact) HasWebAddress() bool { + if o != nil && !common.IsNil(o.WebAddress) { + return true + } + + return false +} + +// SetWebAddress gets a reference to the given string and assigns it to the WebAddress field. +func (o *Contact) SetWebAddress(v string) { + o.WebAddress = &v +} + +func (o Contact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Contact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !common.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !common.IsNil(o.FullPhoneNumber) { + toSerialize["fullPhoneNumber"] = o.FullPhoneNumber + } + if !common.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !common.IsNil(o.PersonalData) { + toSerialize["personalData"] = o.PersonalData + } + if !common.IsNil(o.PhoneNumber) { + toSerialize["phoneNumber"] = o.PhoneNumber + } + if !common.IsNil(o.WebAddress) { + toSerialize["webAddress"] = o.WebAddress + } + return toSerialize, nil +} + +type NullableContact struct { + value *Contact + isSet bool +} + +func (v NullableContact) Get() *Contact { + return v.value +} + +func (v *NullableContact) Set(val *Contact) { + v.value = val + v.isSet = true +} + +func (v NullableContact) IsSet() bool { + return v.isSet +} + +func (v *NullableContact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContact(val *Contact) *NullableContact { + return &NullableContact{value: val, isSet: true} +} + +func (v NullableContact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_contact_details.go b/src/configurationWebhook/model_contact_details.go new file mode 100644 index 000000000..6abcb5f13 --- /dev/null +++ b/src/configurationWebhook/model_contact_details.go @@ -0,0 +1,209 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ContactDetails type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ContactDetails{} + +// ContactDetails struct for ContactDetails +type ContactDetails struct { + Address Address `json:"address"` + // The email address of the account holder. + Email string `json:"email"` + Phone Phone `json:"phone"` + // The URL of the account holder's website. + WebAddress *string `json:"webAddress,omitempty"` +} + +// NewContactDetails instantiates a new ContactDetails 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 NewContactDetails(address Address, email string, phone Phone) *ContactDetails { + this := ContactDetails{} + this.Address = address + this.Email = email + this.Phone = phone + return &this +} + +// NewContactDetailsWithDefaults instantiates a new ContactDetails 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 NewContactDetailsWithDefaults() *ContactDetails { + this := ContactDetails{} + return &this +} + +// GetAddress returns the Address field value +func (o *ContactDetails) GetAddress() Address { + if o == nil { + var ret Address + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *ContactDetails) GetAddressOk() (*Address, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *ContactDetails) SetAddress(v Address) { + o.Address = v +} + +// GetEmail returns the Email field value +func (o *ContactDetails) GetEmail() string { + if o == nil { + var ret string + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *ContactDetails) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value +func (o *ContactDetails) SetEmail(v string) { + o.Email = v +} + +// GetPhone returns the Phone field value +func (o *ContactDetails) GetPhone() Phone { + if o == nil { + var ret Phone + return ret + } + + return o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value +// and a boolean to check if the value has been set. +func (o *ContactDetails) GetPhoneOk() (*Phone, bool) { + if o == nil { + return nil, false + } + return &o.Phone, true +} + +// SetPhone sets field value +func (o *ContactDetails) SetPhone(v Phone) { + o.Phone = v +} + +// GetWebAddress returns the WebAddress field value if set, zero value otherwise. +func (o *ContactDetails) GetWebAddress() string { + if o == nil || common.IsNil(o.WebAddress) { + var ret string + return ret + } + return *o.WebAddress +} + +// GetWebAddressOk returns a tuple with the WebAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContactDetails) GetWebAddressOk() (*string, bool) { + if o == nil || common.IsNil(o.WebAddress) { + return nil, false + } + return o.WebAddress, true +} + +// HasWebAddress returns a boolean if a field has been set. +func (o *ContactDetails) HasWebAddress() bool { + if o != nil && !common.IsNil(o.WebAddress) { + return true + } + + return false +} + +// SetWebAddress gets a reference to the given string and assigns it to the WebAddress field. +func (o *ContactDetails) SetWebAddress(v string) { + o.WebAddress = &v +} + +func (o ContactDetails) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContactDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["email"] = o.Email + toSerialize["phone"] = o.Phone + if !common.IsNil(o.WebAddress) { + toSerialize["webAddress"] = o.WebAddress + } + return toSerialize, nil +} + +type NullableContactDetails struct { + value *ContactDetails + isSet bool +} + +func (v NullableContactDetails) Get() *ContactDetails { + return v.value +} + +func (v *NullableContactDetails) Set(val *ContactDetails) { + v.value = val + v.isSet = true +} + +func (v NullableContactDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableContactDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactDetails(val *ContactDetails) *NullableContactDetails { + return &NullableContactDetails{value: val, isSet: true} +} + +func (v NullableContactDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_expiry.go b/src/configurationWebhook/model_expiry.go new file mode 100644 index 000000000..df5a2326b --- /dev/null +++ b/src/configurationWebhook/model_expiry.go @@ -0,0 +1,164 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Expiry type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Expiry{} + +// Expiry struct for Expiry +type Expiry struct { + // The month in which the card will expire. + Month *string `json:"month,omitempty"` + // The year in which the card will expire. + Year *string `json:"year,omitempty"` +} + +// NewExpiry instantiates a new Expiry 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 NewExpiry() *Expiry { + this := Expiry{} + return &this +} + +// NewExpiryWithDefaults instantiates a new Expiry 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 NewExpiryWithDefaults() *Expiry { + this := Expiry{} + return &this +} + +// GetMonth returns the Month field value if set, zero value otherwise. +func (o *Expiry) GetMonth() string { + if o == nil || common.IsNil(o.Month) { + var ret string + return ret + } + return *o.Month +} + +// GetMonthOk returns a tuple with the Month field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Expiry) GetMonthOk() (*string, bool) { + if o == nil || common.IsNil(o.Month) { + return nil, false + } + return o.Month, true +} + +// HasMonth returns a boolean if a field has been set. +func (o *Expiry) HasMonth() bool { + if o != nil && !common.IsNil(o.Month) { + return true + } + + return false +} + +// SetMonth gets a reference to the given string and assigns it to the Month field. +func (o *Expiry) SetMonth(v string) { + o.Month = &v +} + +// GetYear returns the Year field value if set, zero value otherwise. +func (o *Expiry) GetYear() string { + if o == nil || common.IsNil(o.Year) { + var ret string + return ret + } + return *o.Year +} + +// GetYearOk returns a tuple with the Year field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Expiry) GetYearOk() (*string, bool) { + if o == nil || common.IsNil(o.Year) { + return nil, false + } + return o.Year, true +} + +// HasYear returns a boolean if a field has been set. +func (o *Expiry) HasYear() bool { + if o != nil && !common.IsNil(o.Year) { + return true + } + + return false +} + +// SetYear gets a reference to the given string and assigns it to the Year field. +func (o *Expiry) SetYear(v string) { + o.Year = &v +} + +func (o Expiry) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Expiry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Month) { + toSerialize["month"] = o.Month + } + if !common.IsNil(o.Year) { + toSerialize["year"] = o.Year + } + return toSerialize, nil +} + +type NullableExpiry struct { + value *Expiry + isSet bool +} + +func (v NullableExpiry) Get() *Expiry { + return v.value +} + +func (v *NullableExpiry) Set(val *Expiry) { + v.value = val + v.isSet = true +} + +func (v NullableExpiry) IsSet() bool { + return v.isSet +} + +func (v *NullableExpiry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExpiry(val *Expiry) *NullableExpiry { + return &NullableExpiry{value: val, isSet: true} +} + +func (v NullableExpiry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExpiry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_iban_account_identification.go b/src/configurationWebhook/model_iban_account_identification.go new file mode 100644 index 000000000..6a977dcd0 --- /dev/null +++ b/src/configurationWebhook/model_iban_account_identification.go @@ -0,0 +1,157 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &IbanAccountIdentification{} + +// IbanAccountIdentification struct for IbanAccountIdentification +type IbanAccountIdentification struct { + // The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + Iban string `json:"iban"` + // **iban** + Type string `json:"type"` +} + +// NewIbanAccountIdentification instantiates a new IbanAccountIdentification 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 NewIbanAccountIdentification(iban string, type_ string) *IbanAccountIdentification { + this := IbanAccountIdentification{} + this.Iban = iban + this.Type = type_ + return &this +} + +// NewIbanAccountIdentificationWithDefaults instantiates a new IbanAccountIdentification 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 NewIbanAccountIdentificationWithDefaults() *IbanAccountIdentification { + this := IbanAccountIdentification{} + var type_ string = "iban" + this.Type = type_ + return &this +} + +// GetIban returns the Iban field value +func (o *IbanAccountIdentification) GetIban() string { + if o == nil { + var ret string + return ret + } + + return o.Iban +} + +// GetIbanOk returns a tuple with the Iban field value +// and a boolean to check if the value has been set. +func (o *IbanAccountIdentification) GetIbanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iban, true +} + +// SetIban sets field value +func (o *IbanAccountIdentification) SetIban(v string) { + o.Iban = v +} + +// GetType returns the Type field value +func (o *IbanAccountIdentification) 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 *IbanAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *IbanAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IbanAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["iban"] = o.Iban + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableIbanAccountIdentification struct { + value *IbanAccountIdentification + isSet bool +} + +func (v NullableIbanAccountIdentification) Get() *IbanAccountIdentification { + return v.value +} + +func (v *NullableIbanAccountIdentification) Set(val *IbanAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableIbanAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableIbanAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIbanAccountIdentification(val *IbanAccountIdentification) *NullableIbanAccountIdentification { + return &NullableIbanAccountIdentification{value: val, isSet: true} +} + +func (v NullableIbanAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *IbanAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_name.go b/src/configurationWebhook/model_name.go new file mode 100644 index 000000000..4240a8fff --- /dev/null +++ b/src/configurationWebhook/model_name.go @@ -0,0 +1,146 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Name type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Name{} + +// Name struct for Name +type Name struct { + // The first name. + FirstName string `json:"firstName"` + // The last name. + LastName string `json:"lastName"` +} + +// NewName instantiates a new Name 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 NewName(firstName string, lastName string) *Name { + this := Name{} + this.FirstName = firstName + this.LastName = lastName + return &this +} + +// NewNameWithDefaults instantiates a new Name 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 NewNameWithDefaults() *Name { + this := Name{} + return &this +} + +// GetFirstName returns the FirstName field value +func (o *Name) GetFirstName() string { + if o == nil { + var ret string + return ret + } + + return o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value +// and a boolean to check if the value has been set. +func (o *Name) GetFirstNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstName, true +} + +// SetFirstName sets field value +func (o *Name) SetFirstName(v string) { + o.FirstName = v +} + +// GetLastName returns the LastName field value +func (o *Name) GetLastName() string { + if o == nil { + var ret string + return ret + } + + return o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value +// and a boolean to check if the value has been set. +func (o *Name) GetLastNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastName, true +} + +// SetLastName sets field value +func (o *Name) SetLastName(v string) { + o.LastName = v +} + +func (o Name) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Name) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["firstName"] = o.FirstName + toSerialize["lastName"] = o.LastName + return toSerialize, nil +} + +type NullableName struct { + value *Name + isSet bool +} + +func (v NullableName) Get() *Name { + return v.value +} + +func (v *NullableName) Set(val *Name) { + v.value = val + v.isSet = true +} + +func (v NullableName) IsSet() bool { + return v.isSet +} + +func (v *NullableName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableName(val *Name) *NullableName { + return &NullableName{value: val, isSet: true} +} + +func (v NullableName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_payment_instrument.go b/src/configurationWebhook/model_payment_instrument.go new file mode 100644 index 000000000..544b3fbde --- /dev/null +++ b/src/configurationWebhook/model_payment_instrument.go @@ -0,0 +1,440 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrument{} + +// PaymentInstrument struct for PaymentInstrument +type PaymentInstrument struct { + // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *PaymentInstrumentBankAccount `json:"bankAccount,omitempty"` + Card *Card `json:"card,omitempty"` + // Your description for the payment instrument, maximum 300 characters. + Description *string `json:"description,omitempty"` + // The unique identifier of the payment instrument. + Id string `json:"id"` + // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + IssuingCountryCode string `json:"issuingCountryCode"` + // The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + PaymentInstrumentGroupId *string `json:"paymentInstrumentGroupId,omitempty"` + // Your reference for the payment instrument, maximum 150 characters. + Reference *string `json:"reference,omitempty"` + // The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **Active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** + Status *string `json:"status,omitempty"` + // Type of payment instrument. Possible value: **card**, **bankAccount**. + Type string `json:"type"` +} + +// NewPaymentInstrument instantiates a new PaymentInstrument 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 NewPaymentInstrument(balanceAccountId string, id string, issuingCountryCode string, type_ string) *PaymentInstrument { + this := PaymentInstrument{} + this.BalanceAccountId = balanceAccountId + this.Id = id + this.IssuingCountryCode = issuingCountryCode + this.Type = type_ + return &this +} + +// NewPaymentInstrumentWithDefaults instantiates a new PaymentInstrument 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 NewPaymentInstrumentWithDefaults() *PaymentInstrument { + this := PaymentInstrument{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value +func (o *PaymentInstrument) GetBalanceAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetBalanceAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalanceAccountId, true +} + +// SetBalanceAccountId sets field value +func (o *PaymentInstrument) SetBalanceAccountId(v string) { + o.BalanceAccountId = v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *PaymentInstrument) GetBankAccount() PaymentInstrumentBankAccount { + if o == nil || common.IsNil(o.BankAccount) { + var ret PaymentInstrumentBankAccount + return ret + } + return *o.BankAccount +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetBankAccountOk() (*PaymentInstrumentBankAccount, bool) { + if o == nil || common.IsNil(o.BankAccount) { + return nil, false + } + return o.BankAccount, true +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *PaymentInstrument) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given PaymentInstrumentBankAccount and assigns it to the BankAccount field. +func (o *PaymentInstrument) SetBankAccount(v PaymentInstrumentBankAccount) { + o.BankAccount = &v +} + +// GetCard returns the Card field value if set, zero value otherwise. +func (o *PaymentInstrument) GetCard() Card { + if o == nil || common.IsNil(o.Card) { + var ret Card + return ret + } + return *o.Card +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetCardOk() (*Card, bool) { + if o == nil || common.IsNil(o.Card) { + return nil, false + } + return o.Card, true +} + +// HasCard returns a boolean if a field has been set. +func (o *PaymentInstrument) HasCard() bool { + if o != nil && !common.IsNil(o.Card) { + return true + } + + return false +} + +// SetCard gets a reference to the given Card and assigns it to the Card field. +func (o *PaymentInstrument) SetCard(v Card) { + o.Card = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentInstrument) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentInstrument) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PaymentInstrument) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value +func (o *PaymentInstrument) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentInstrument) SetId(v string) { + o.Id = v +} + +// GetIssuingCountryCode returns the IssuingCountryCode field value +func (o *PaymentInstrument) GetIssuingCountryCode() string { + if o == nil { + var ret string + return ret + } + + return o.IssuingCountryCode +} + +// GetIssuingCountryCodeOk returns a tuple with the IssuingCountryCode field value +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetIssuingCountryCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IssuingCountryCode, true +} + +// SetIssuingCountryCode sets field value +func (o *PaymentInstrument) SetIssuingCountryCode(v string) { + o.IssuingCountryCode = v +} + +// GetPaymentInstrumentGroupId returns the PaymentInstrumentGroupId field value if set, zero value otherwise. +func (o *PaymentInstrument) GetPaymentInstrumentGroupId() string { + if o == nil || common.IsNil(o.PaymentInstrumentGroupId) { + var ret string + return ret + } + return *o.PaymentInstrumentGroupId +} + +// GetPaymentInstrumentGroupIdOk returns a tuple with the PaymentInstrumentGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetPaymentInstrumentGroupIdOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentGroupId) { + return nil, false + } + return o.PaymentInstrumentGroupId, true +} + +// HasPaymentInstrumentGroupId returns a boolean if a field has been set. +func (o *PaymentInstrument) HasPaymentInstrumentGroupId() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentGroupId) { + return true + } + + return false +} + +// SetPaymentInstrumentGroupId gets a reference to the given string and assigns it to the PaymentInstrumentGroupId field. +func (o *PaymentInstrument) SetPaymentInstrumentGroupId(v string) { + o.PaymentInstrumentGroupId = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *PaymentInstrument) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *PaymentInstrument) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *PaymentInstrument) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PaymentInstrument) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PaymentInstrument) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *PaymentInstrument) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value +func (o *PaymentInstrument) 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 *PaymentInstrument) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentInstrument) SetType(v string) { + o.Type = v +} + +func (o PaymentInstrument) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrument) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["balanceAccountId"] = o.BalanceAccountId + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.Card) { + toSerialize["card"] = o.Card + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + toSerialize["issuingCountryCode"] = o.IssuingCountryCode + if !common.IsNil(o.PaymentInstrumentGroupId) { + toSerialize["paymentInstrumentGroupId"] = o.PaymentInstrumentGroupId + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePaymentInstrument struct { + value *PaymentInstrument + isSet bool +} + +func (v NullablePaymentInstrument) Get() *PaymentInstrument { + return v.value +} + +func (v *NullablePaymentInstrument) Set(val *PaymentInstrument) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrument) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrument) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrument(val *PaymentInstrument) *NullablePaymentInstrument { + return &NullablePaymentInstrument{value: val, isSet: true} +} + +func (v NullablePaymentInstrument) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PaymentInstrument) isValidStatus() bool { + var allowedEnumValues = []string{ "Active", "Closed", "Inactive", "Lost", "Requested", "Stolen", "Suspended", "blocked", "discarded" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *PaymentInstrument) isValidType() bool { + var allowedEnumValues = []string{ "bankAccount", "card" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_payment_instrument_bank_account.go b/src/configurationWebhook/model_payment_instrument_bank_account.go new file mode 100644 index 000000000..5e458c0fa --- /dev/null +++ b/src/configurationWebhook/model_payment_instrument_bank_account.go @@ -0,0 +1,147 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "fmt" +) + +// PaymentInstrumentBankAccount - Contains the business account details. Returned when you create a payment instrument with `type` **bankAccount**. +type PaymentInstrumentBankAccount struct { + IbanAccountIdentification *IbanAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification +} + +// IbanAccountIdentificationAsPaymentInstrumentBankAccount is a convenience function that returns IbanAccountIdentification wrapped in PaymentInstrumentBankAccount +func IbanAccountIdentificationAsPaymentInstrumentBankAccount(v *IbanAccountIdentification) PaymentInstrumentBankAccount { + return PaymentInstrumentBankAccount{ + IbanAccountIdentification: v, + } +} + +// USLocalAccountIdentificationAsPaymentInstrumentBankAccount is a convenience function that returns USLocalAccountIdentification wrapped in PaymentInstrumentBankAccount +func USLocalAccountIdentificationAsPaymentInstrumentBankAccount(v *USLocalAccountIdentification) PaymentInstrumentBankAccount { + return PaymentInstrumentBankAccount{ + USLocalAccountIdentification: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PaymentInstrumentBankAccount) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IbanAccountIdentification + err = json.Unmarshal(data, &dst.IbanAccountIdentification) + if err == nil { + jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) + if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct + dst.IbanAccountIdentification = nil + } else { + match++ + } + } else { + dst.IbanAccountIdentification = nil + } + + // try to unmarshal data into USLocalAccountIdentification + err = json.Unmarshal(data, &dst.USLocalAccountIdentification) + if err == nil { + jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) + if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct + dst.USLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.USLocalAccountIdentification = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IbanAccountIdentification = nil + dst.USLocalAccountIdentification = nil + + return fmt.Errorf("data matches more than one schema in oneOf(PaymentInstrumentBankAccount)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(PaymentInstrumentBankAccount)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PaymentInstrumentBankAccount) MarshalJSON() ([]byte, error) { + if src.IbanAccountIdentification != nil { + return json.Marshal(&src.IbanAccountIdentification) + } + + if src.USLocalAccountIdentification != nil { + return json.Marshal(&src.USLocalAccountIdentification) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PaymentInstrumentBankAccount) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.IbanAccountIdentification != nil { + return obj.IbanAccountIdentification + } + + if obj.USLocalAccountIdentification != nil { + return obj.USLocalAccountIdentification + } + + // all schemas are nil + return nil +} + +type NullablePaymentInstrumentBankAccount struct { + value *PaymentInstrumentBankAccount + isSet bool +} + +func (v NullablePaymentInstrumentBankAccount) Get() *PaymentInstrumentBankAccount { + return v.value +} + +func (v *NullablePaymentInstrumentBankAccount) Set(val *PaymentInstrumentBankAccount) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentBankAccount(val *PaymentInstrumentBankAccount) *NullablePaymentInstrumentBankAccount { + return &NullablePaymentInstrumentBankAccount{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/configurationWebhook/model_payment_instrument_notification_data.go b/src/configurationWebhook/model_payment_instrument_notification_data.go new file mode 100644 index 000000000..c42cea826 --- /dev/null +++ b/src/configurationWebhook/model_payment_instrument_notification_data.go @@ -0,0 +1,163 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentInstrumentNotificationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrumentNotificationData{} + +// PaymentInstrumentNotificationData struct for PaymentInstrumentNotificationData +type PaymentInstrumentNotificationData struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` +} + +// NewPaymentInstrumentNotificationData instantiates a new PaymentInstrumentNotificationData 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 NewPaymentInstrumentNotificationData() *PaymentInstrumentNotificationData { + this := PaymentInstrumentNotificationData{} + return &this +} + +// NewPaymentInstrumentNotificationDataWithDefaults instantiates a new PaymentInstrumentNotificationData 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 NewPaymentInstrumentNotificationDataWithDefaults() *PaymentInstrumentNotificationData { + this := PaymentInstrumentNotificationData{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *PaymentInstrumentNotificationData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentNotificationData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *PaymentInstrumentNotificationData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *PaymentInstrumentNotificationData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetPaymentInstrument returns the PaymentInstrument field value if set, zero value otherwise. +func (o *PaymentInstrumentNotificationData) GetPaymentInstrument() PaymentInstrument { + if o == nil || common.IsNil(o.PaymentInstrument) { + var ret PaymentInstrument + return ret + } + return *o.PaymentInstrument +} + +// GetPaymentInstrumentOk returns a tuple with the PaymentInstrument field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentNotificationData) GetPaymentInstrumentOk() (*PaymentInstrument, bool) { + if o == nil || common.IsNil(o.PaymentInstrument) { + return nil, false + } + return o.PaymentInstrument, true +} + +// HasPaymentInstrument returns a boolean if a field has been set. +func (o *PaymentInstrumentNotificationData) HasPaymentInstrument() bool { + if o != nil && !common.IsNil(o.PaymentInstrument) { + return true + } + + return false +} + +// SetPaymentInstrument gets a reference to the given PaymentInstrument and assigns it to the PaymentInstrument field. +func (o *PaymentInstrumentNotificationData) SetPaymentInstrument(v PaymentInstrument) { + o.PaymentInstrument = &v +} + +func (o PaymentInstrumentNotificationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrumentNotificationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.PaymentInstrument) { + toSerialize["paymentInstrument"] = o.PaymentInstrument + } + return toSerialize, nil +} + +type NullablePaymentInstrumentNotificationData struct { + value *PaymentInstrumentNotificationData + isSet bool +} + +func (v NullablePaymentInstrumentNotificationData) Get() *PaymentInstrumentNotificationData { + return v.value +} + +func (v *NullablePaymentInstrumentNotificationData) Set(val *PaymentInstrumentNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentNotificationData(val *PaymentInstrumentNotificationData) *NullablePaymentInstrumentNotificationData { + return &NullablePaymentInstrumentNotificationData{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_payment_instrument_reference.go b/src/configurationWebhook/model_payment_instrument_reference.go new file mode 100644 index 000000000..418115075 --- /dev/null +++ b/src/configurationWebhook/model_payment_instrument_reference.go @@ -0,0 +1,118 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentInstrumentReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrumentReference{} + +// PaymentInstrumentReference struct for PaymentInstrumentReference +type PaymentInstrumentReference struct { + // The unique identifier of the payment instrument. + Id string `json:"id"` +} + +// NewPaymentInstrumentReference instantiates a new PaymentInstrumentReference 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 NewPaymentInstrumentReference(id string) *PaymentInstrumentReference { + this := PaymentInstrumentReference{} + this.Id = id + return &this +} + +// NewPaymentInstrumentReferenceWithDefaults instantiates a new PaymentInstrumentReference 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 NewPaymentInstrumentReferenceWithDefaults() *PaymentInstrumentReference { + this := PaymentInstrumentReference{} + return &this +} + +// GetId returns the Id field value +func (o *PaymentInstrumentReference) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentReference) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentInstrumentReference) SetId(v string) { + o.Id = v +} + +func (o PaymentInstrumentReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrumentReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +type NullablePaymentInstrumentReference struct { + value *PaymentInstrumentReference + isSet bool +} + +func (v NullablePaymentInstrumentReference) Get() *PaymentInstrumentReference { + return v.value +} + +func (v *NullablePaymentInstrumentReference) Set(val *PaymentInstrumentReference) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentReference) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentReference(val *PaymentInstrumentReference) *NullablePaymentInstrumentReference { + return &NullablePaymentInstrumentReference{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_payment_notification_request.go b/src/configurationWebhook/model_payment_notification_request.go new file mode 100644 index 000000000..7cd93adce --- /dev/null +++ b/src/configurationWebhook/model_payment_notification_request.go @@ -0,0 +1,182 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentNotificationRequest{} + +// PaymentNotificationRequest struct for PaymentNotificationRequest +type PaymentNotificationRequest struct { + Data PaymentInstrumentNotificationData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewPaymentNotificationRequest instantiates a new PaymentNotificationRequest 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 NewPaymentNotificationRequest(data PaymentInstrumentNotificationData, environment string, type_ string) *PaymentNotificationRequest { + this := PaymentNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewPaymentNotificationRequestWithDefaults instantiates a new PaymentNotificationRequest 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 NewPaymentNotificationRequestWithDefaults() *PaymentNotificationRequest { + this := PaymentNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *PaymentNotificationRequest) GetData() PaymentInstrumentNotificationData { + if o == nil { + var ret PaymentInstrumentNotificationData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PaymentNotificationRequest) GetDataOk() (*PaymentInstrumentNotificationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *PaymentNotificationRequest) SetData(v PaymentInstrumentNotificationData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *PaymentNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *PaymentNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *PaymentNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *PaymentNotificationRequest) 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 *PaymentNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o PaymentNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePaymentNotificationRequest struct { + value *PaymentNotificationRequest + isSet bool +} + +func (v NullablePaymentNotificationRequest) Get() *PaymentNotificationRequest { + return v.value +} + +func (v *NullablePaymentNotificationRequest) Set(val *PaymentNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentNotificationRequest(val *PaymentNotificationRequest) *NullablePaymentNotificationRequest { + return &NullablePaymentNotificationRequest{value: val, isSet: true} +} + +func (v NullablePaymentNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PaymentNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.paymentInstrument.created", "balancePlatform.paymentInstrument.updated" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_personal_data.go b/src/configurationWebhook/model_personal_data.go new file mode 100644 index 000000000..4bfa7df83 --- /dev/null +++ b/src/configurationWebhook/model_personal_data.go @@ -0,0 +1,201 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PersonalData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PersonalData{} + +// PersonalData struct for PersonalData +type PersonalData struct { + // The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31). + DateOfBirth *string `json:"dateOfBirth,omitempty"` + // An ID number of the person. + IdNumber *string `json:"idNumber,omitempty"` + // The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). + Nationality *string `json:"nationality,omitempty"` +} + +// NewPersonalData instantiates a new PersonalData 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 NewPersonalData() *PersonalData { + this := PersonalData{} + return &this +} + +// NewPersonalDataWithDefaults instantiates a new PersonalData 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 NewPersonalDataWithDefaults() *PersonalData { + this := PersonalData{} + return &this +} + +// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. +func (o *PersonalData) GetDateOfBirth() string { + if o == nil || common.IsNil(o.DateOfBirth) { + var ret string + return ret + } + return *o.DateOfBirth +} + +// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PersonalData) GetDateOfBirthOk() (*string, bool) { + if o == nil || common.IsNil(o.DateOfBirth) { + return nil, false + } + return o.DateOfBirth, true +} + +// HasDateOfBirth returns a boolean if a field has been set. +func (o *PersonalData) HasDateOfBirth() bool { + if o != nil && !common.IsNil(o.DateOfBirth) { + return true + } + + return false +} + +// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. +func (o *PersonalData) SetDateOfBirth(v string) { + o.DateOfBirth = &v +} + +// GetIdNumber returns the IdNumber field value if set, zero value otherwise. +func (o *PersonalData) GetIdNumber() string { + if o == nil || common.IsNil(o.IdNumber) { + var ret string + return ret + } + return *o.IdNumber +} + +// GetIdNumberOk returns a tuple with the IdNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PersonalData) GetIdNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.IdNumber) { + return nil, false + } + return o.IdNumber, true +} + +// HasIdNumber returns a boolean if a field has been set. +func (o *PersonalData) HasIdNumber() bool { + if o != nil && !common.IsNil(o.IdNumber) { + return true + } + + return false +} + +// SetIdNumber gets a reference to the given string and assigns it to the IdNumber field. +func (o *PersonalData) SetIdNumber(v string) { + o.IdNumber = &v +} + +// GetNationality returns the Nationality field value if set, zero value otherwise. +func (o *PersonalData) GetNationality() string { + if o == nil || common.IsNil(o.Nationality) { + var ret string + return ret + } + return *o.Nationality +} + +// GetNationalityOk returns a tuple with the Nationality field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PersonalData) GetNationalityOk() (*string, bool) { + if o == nil || common.IsNil(o.Nationality) { + return nil, false + } + return o.Nationality, true +} + +// HasNationality returns a boolean if a field has been set. +func (o *PersonalData) HasNationality() bool { + if o != nil && !common.IsNil(o.Nationality) { + return true + } + + return false +} + +// SetNationality gets a reference to the given string and assigns it to the Nationality field. +func (o *PersonalData) SetNationality(v string) { + o.Nationality = &v +} + +func (o PersonalData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PersonalData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.DateOfBirth) { + toSerialize["dateOfBirth"] = o.DateOfBirth + } + if !common.IsNil(o.IdNumber) { + toSerialize["idNumber"] = o.IdNumber + } + if !common.IsNil(o.Nationality) { + toSerialize["nationality"] = o.Nationality + } + return toSerialize, nil +} + +type NullablePersonalData struct { + value *PersonalData + isSet bool +} + +func (v NullablePersonalData) Get() *PersonalData { + return v.value +} + +func (v *NullablePersonalData) Set(val *PersonalData) { + v.value = val + v.isSet = true +} + +func (v NullablePersonalData) IsSet() bool { + return v.isSet +} + +func (v *NullablePersonalData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePersonalData(val *PersonalData) *NullablePersonalData { + return &NullablePersonalData{value: val, isSet: true} +} + +func (v NullablePersonalData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePersonalData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_phone.go b/src/configurationWebhook/model_phone.go new file mode 100644 index 000000000..dd757d457 --- /dev/null +++ b/src/configurationWebhook/model_phone.go @@ -0,0 +1,155 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Phone type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Phone{} + +// Phone struct for Phone +type Phone struct { + // The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + Number string `json:"number"` + // Type of phone number. Possible values: **Landline**, **Mobile**. + Type string `json:"type"` +} + +// NewPhone instantiates a new Phone 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 NewPhone(number string, type_ string) *Phone { + this := Phone{} + this.Number = number + this.Type = type_ + return &this +} + +// NewPhoneWithDefaults instantiates a new Phone 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 NewPhoneWithDefaults() *Phone { + this := Phone{} + return &this +} + +// GetNumber returns the Number field value +func (o *Phone) GetNumber() string { + if o == nil { + var ret string + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Phone) GetNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Phone) SetNumber(v string) { + o.Number = v +} + +// GetType returns the Type field value +func (o *Phone) 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 *Phone) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Phone) SetType(v string) { + o.Type = v +} + +func (o Phone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Phone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePhone struct { + value *Phone + isSet bool +} + +func (v NullablePhone) Get() *Phone { + return v.value +} + +func (v *NullablePhone) Set(val *Phone) { + v.value = val + v.isSet = true +} + +func (v NullablePhone) IsSet() bool { + return v.isSet +} + +func (v *NullablePhone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhone(val *Phone) *NullablePhone { + return &NullablePhone{value: val, isSet: true} +} + +func (v NullablePhone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Phone) isValidType() bool { + var allowedEnumValues = []string{ "Landline", "Mobile" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_phone_number.go b/src/configurationWebhook/model_phone_number.go new file mode 100644 index 000000000..b4dce7b70 --- /dev/null +++ b/src/configurationWebhook/model_phone_number.go @@ -0,0 +1,210 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PhoneNumber type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PhoneNumber{} + +// PhoneNumber struct for PhoneNumber +type PhoneNumber struct { + // The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. + PhoneCountryCode *string `json:"phoneCountryCode,omitempty"` + // The phone number. The inclusion of the phone number country code is not necessary. + PhoneNumber *string `json:"phoneNumber,omitempty"` + // The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + PhoneType *string `json:"phoneType,omitempty"` +} + +// NewPhoneNumber instantiates a new PhoneNumber 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 NewPhoneNumber() *PhoneNumber { + this := PhoneNumber{} + return &this +} + +// NewPhoneNumberWithDefaults instantiates a new PhoneNumber 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 NewPhoneNumberWithDefaults() *PhoneNumber { + this := PhoneNumber{} + return &this +} + +// GetPhoneCountryCode returns the PhoneCountryCode field value if set, zero value otherwise. +func (o *PhoneNumber) GetPhoneCountryCode() string { + if o == nil || common.IsNil(o.PhoneCountryCode) { + var ret string + return ret + } + return *o.PhoneCountryCode +} + +// GetPhoneCountryCodeOk returns a tuple with the PhoneCountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PhoneNumber) GetPhoneCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PhoneCountryCode) { + return nil, false + } + return o.PhoneCountryCode, true +} + +// HasPhoneCountryCode returns a boolean if a field has been set. +func (o *PhoneNumber) HasPhoneCountryCode() bool { + if o != nil && !common.IsNil(o.PhoneCountryCode) { + return true + } + + return false +} + +// SetPhoneCountryCode gets a reference to the given string and assigns it to the PhoneCountryCode field. +func (o *PhoneNumber) SetPhoneCountryCode(v string) { + o.PhoneCountryCode = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *PhoneNumber) GetPhoneNumber() string { + if o == nil || common.IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PhoneNumber) GetPhoneNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *PhoneNumber) HasPhoneNumber() bool { + if o != nil && !common.IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *PhoneNumber) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetPhoneType returns the PhoneType field value if set, zero value otherwise. +func (o *PhoneNumber) GetPhoneType() string { + if o == nil || common.IsNil(o.PhoneType) { + var ret string + return ret + } + return *o.PhoneType +} + +// GetPhoneTypeOk returns a tuple with the PhoneType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PhoneNumber) GetPhoneTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PhoneType) { + return nil, false + } + return o.PhoneType, true +} + +// HasPhoneType returns a boolean if a field has been set. +func (o *PhoneNumber) HasPhoneType() bool { + if o != nil && !common.IsNil(o.PhoneType) { + return true + } + + return false +} + +// SetPhoneType gets a reference to the given string and assigns it to the PhoneType field. +func (o *PhoneNumber) SetPhoneType(v string) { + o.PhoneType = &v +} + +func (o PhoneNumber) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PhoneNumber) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.PhoneCountryCode) { + toSerialize["phoneCountryCode"] = o.PhoneCountryCode + } + if !common.IsNil(o.PhoneNumber) { + toSerialize["phoneNumber"] = o.PhoneNumber + } + if !common.IsNil(o.PhoneType) { + toSerialize["phoneType"] = o.PhoneType + } + return toSerialize, nil +} + +type NullablePhoneNumber struct { + value *PhoneNumber + isSet bool +} + +func (v NullablePhoneNumber) Get() *PhoneNumber { + return v.value +} + +func (v *NullablePhoneNumber) Set(val *PhoneNumber) { + v.value = val + v.isSet = true +} + +func (v NullablePhoneNumber) IsSet() bool { + return v.isSet +} + +func (v *NullablePhoneNumber) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhoneNumber(val *PhoneNumber) *NullablePhoneNumber { + return &NullablePhoneNumber{value: val, isSet: true} +} + +func (v NullablePhoneNumber) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PhoneNumber) isValidPhoneType() bool { + var allowedEnumValues = []string{ "Fax", "Landline", "Mobile", "SIP" } + for _, allowed := range allowedEnumValues { + if o.GetPhoneType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_platform_payment_configuration.go b/src/configurationWebhook/model_platform_payment_configuration.go new file mode 100644 index 000000000..28bcdcfeb --- /dev/null +++ b/src/configurationWebhook/model_platform_payment_configuration.go @@ -0,0 +1,164 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PlatformPaymentConfiguration type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PlatformPaymentConfiguration{} + +// PlatformPaymentConfiguration struct for PlatformPaymentConfiguration +type PlatformPaymentConfiguration struct { + // Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + SalesDayClosingTime *string `json:"salesDayClosingTime,omitempty"` + // Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/settle-funds/pass-through-settlement). Default value: **null**. + SettlementDelayDays *int32 `json:"settlementDelayDays,omitempty"` +} + +// NewPlatformPaymentConfiguration instantiates a new PlatformPaymentConfiguration 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 NewPlatformPaymentConfiguration() *PlatformPaymentConfiguration { + this := PlatformPaymentConfiguration{} + return &this +} + +// NewPlatformPaymentConfigurationWithDefaults instantiates a new PlatformPaymentConfiguration 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 NewPlatformPaymentConfigurationWithDefaults() *PlatformPaymentConfiguration { + this := PlatformPaymentConfiguration{} + return &this +} + +// GetSalesDayClosingTime returns the SalesDayClosingTime field value if set, zero value otherwise. +func (o *PlatformPaymentConfiguration) GetSalesDayClosingTime() string { + if o == nil || common.IsNil(o.SalesDayClosingTime) { + var ret string + return ret + } + return *o.SalesDayClosingTime +} + +// GetSalesDayClosingTimeOk returns a tuple with the SalesDayClosingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPaymentConfiguration) GetSalesDayClosingTimeOk() (*string, bool) { + if o == nil || common.IsNil(o.SalesDayClosingTime) { + return nil, false + } + return o.SalesDayClosingTime, true +} + +// HasSalesDayClosingTime returns a boolean if a field has been set. +func (o *PlatformPaymentConfiguration) HasSalesDayClosingTime() bool { + if o != nil && !common.IsNil(o.SalesDayClosingTime) { + return true + } + + return false +} + +// SetSalesDayClosingTime gets a reference to the given string and assigns it to the SalesDayClosingTime field. +func (o *PlatformPaymentConfiguration) SetSalesDayClosingTime(v string) { + o.SalesDayClosingTime = &v +} + +// GetSettlementDelayDays returns the SettlementDelayDays field value if set, zero value otherwise. +func (o *PlatformPaymentConfiguration) GetSettlementDelayDays() int32 { + if o == nil || common.IsNil(o.SettlementDelayDays) { + var ret int32 + return ret + } + return *o.SettlementDelayDays +} + +// GetSettlementDelayDaysOk returns a tuple with the SettlementDelayDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPaymentConfiguration) GetSettlementDelayDaysOk() (*int32, bool) { + if o == nil || common.IsNil(o.SettlementDelayDays) { + return nil, false + } + return o.SettlementDelayDays, true +} + +// HasSettlementDelayDays returns a boolean if a field has been set. +func (o *PlatformPaymentConfiguration) HasSettlementDelayDays() bool { + if o != nil && !common.IsNil(o.SettlementDelayDays) { + return true + } + + return false +} + +// SetSettlementDelayDays gets a reference to the given int32 and assigns it to the SettlementDelayDays field. +func (o *PlatformPaymentConfiguration) SetSettlementDelayDays(v int32) { + o.SettlementDelayDays = &v +} + +func (o PlatformPaymentConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlatformPaymentConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.SalesDayClosingTime) { + toSerialize["salesDayClosingTime"] = o.SalesDayClosingTime + } + if !common.IsNil(o.SettlementDelayDays) { + toSerialize["settlementDelayDays"] = o.SettlementDelayDays + } + return toSerialize, nil +} + +type NullablePlatformPaymentConfiguration struct { + value *PlatformPaymentConfiguration + isSet bool +} + +func (v NullablePlatformPaymentConfiguration) Get() *PlatformPaymentConfiguration { + return v.value +} + +func (v *NullablePlatformPaymentConfiguration) Set(val *PlatformPaymentConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullablePlatformPaymentConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatformPaymentConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatformPaymentConfiguration(val *PlatformPaymentConfiguration) *NullablePlatformPaymentConfiguration { + return &NullablePlatformPaymentConfiguration{value: val, isSet: true} +} + +func (v NullablePlatformPaymentConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatformPaymentConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_remediating_action.go b/src/configurationWebhook/model_remediating_action.go new file mode 100644 index 000000000..df2d1ca88 --- /dev/null +++ b/src/configurationWebhook/model_remediating_action.go @@ -0,0 +1,164 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the RemediatingAction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &RemediatingAction{} + +// RemediatingAction struct for RemediatingAction +type RemediatingAction struct { + // The remediating action code. + Code *string `json:"code,omitempty"` + // A description of how you can resolve the verification error. + Message *string `json:"message,omitempty"` +} + +// NewRemediatingAction instantiates a new RemediatingAction 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 NewRemediatingAction() *RemediatingAction { + this := RemediatingAction{} + return &this +} + +// NewRemediatingActionWithDefaults instantiates a new RemediatingAction 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 NewRemediatingActionWithDefaults() *RemediatingAction { + this := RemediatingAction{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *RemediatingAction) GetCode() string { + if o == nil || common.IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RemediatingAction) GetCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *RemediatingAction) HasCode() bool { + if o != nil && !common.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *RemediatingAction) SetCode(v string) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *RemediatingAction) GetMessage() string { + if o == nil || common.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RemediatingAction) GetMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *RemediatingAction) HasMessage() bool { + if o != nil && !common.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *RemediatingAction) SetMessage(v string) { + o.Message = &v +} + +func (o RemediatingAction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RemediatingAction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !common.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableRemediatingAction struct { + value *RemediatingAction + isSet bool +} + +func (v NullableRemediatingAction) Get() *RemediatingAction { + return v.value +} + +func (v *NullableRemediatingAction) Set(val *RemediatingAction) { + v.value = val + v.isSet = true +} + +func (v NullableRemediatingAction) IsSet() bool { + return v.isSet +} + +func (v *NullableRemediatingAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemediatingAction(val *RemediatingAction) *NullableRemediatingAction { + return &NullableRemediatingAction{value: val, isSet: true} +} + +func (v NullableRemediatingAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemediatingAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_resource.go b/src/configurationWebhook/model_resource.go new file mode 100644 index 000000000..a68140167 --- /dev/null +++ b/src/configurationWebhook/model_resource.go @@ -0,0 +1,202 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` +} + +// NewResource instantiates a new Resource 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 NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *Resource) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *Resource) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *Resource) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Resource) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Resource) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Resource) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Resource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Resource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Resource) SetId(v string) { + o.Id = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_sweep_configuration_notification_data.go b/src/configurationWebhook/model_sweep_configuration_notification_data.go new file mode 100644 index 000000000..05d4f340b --- /dev/null +++ b/src/configurationWebhook/model_sweep_configuration_notification_data.go @@ -0,0 +1,200 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the SweepConfigurationNotificationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SweepConfigurationNotificationData{} + +// SweepConfigurationNotificationData struct for SweepConfigurationNotificationData +type SweepConfigurationNotificationData struct { + // The unique identifier of the balance account for which the sweep was configured. + AccountId *string `json:"accountId,omitempty"` + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + Sweep *SweepConfigurationV2 `json:"sweep,omitempty"` +} + +// NewSweepConfigurationNotificationData instantiates a new SweepConfigurationNotificationData 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 NewSweepConfigurationNotificationData() *SweepConfigurationNotificationData { + this := SweepConfigurationNotificationData{} + return &this +} + +// NewSweepConfigurationNotificationDataWithDefaults instantiates a new SweepConfigurationNotificationData 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 NewSweepConfigurationNotificationDataWithDefaults() *SweepConfigurationNotificationData { + this := SweepConfigurationNotificationData{} + return &this +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *SweepConfigurationNotificationData) GetAccountId() string { + if o == nil || common.IsNil(o.AccountId) { + var ret string + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationNotificationData) GetAccountIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *SweepConfigurationNotificationData) HasAccountId() bool { + if o != nil && !common.IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given string and assigns it to the AccountId field. +func (o *SweepConfigurationNotificationData) SetAccountId(v string) { + o.AccountId = &v +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *SweepConfigurationNotificationData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationNotificationData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *SweepConfigurationNotificationData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *SweepConfigurationNotificationData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetSweep returns the Sweep field value if set, zero value otherwise. +func (o *SweepConfigurationNotificationData) GetSweep() SweepConfigurationV2 { + if o == nil || common.IsNil(o.Sweep) { + var ret SweepConfigurationV2 + return ret + } + return *o.Sweep +} + +// GetSweepOk returns a tuple with the Sweep field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationNotificationData) GetSweepOk() (*SweepConfigurationV2, bool) { + if o == nil || common.IsNil(o.Sweep) { + return nil, false + } + return o.Sweep, true +} + +// HasSweep returns a boolean if a field has been set. +func (o *SweepConfigurationNotificationData) HasSweep() bool { + if o != nil && !common.IsNil(o.Sweep) { + return true + } + + return false +} + +// SetSweep gets a reference to the given SweepConfigurationV2 and assigns it to the Sweep field. +func (o *SweepConfigurationNotificationData) SetSweep(v SweepConfigurationV2) { + o.Sweep = &v +} + +func (o SweepConfigurationNotificationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SweepConfigurationNotificationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.Sweep) { + toSerialize["sweep"] = o.Sweep + } + return toSerialize, nil +} + +type NullableSweepConfigurationNotificationData struct { + value *SweepConfigurationNotificationData + isSet bool +} + +func (v NullableSweepConfigurationNotificationData) Get() *SweepConfigurationNotificationData { + return v.value +} + +func (v *NullableSweepConfigurationNotificationData) Set(val *SweepConfigurationNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableSweepConfigurationNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableSweepConfigurationNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSweepConfigurationNotificationData(val *SweepConfigurationNotificationData) *NullableSweepConfigurationNotificationData { + return &NullableSweepConfigurationNotificationData{value: val, isSet: true} +} + +func (v NullableSweepConfigurationNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSweepConfigurationNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_sweep_configuration_notification_request.go b/src/configurationWebhook/model_sweep_configuration_notification_request.go new file mode 100644 index 000000000..4f78a9e6e --- /dev/null +++ b/src/configurationWebhook/model_sweep_configuration_notification_request.go @@ -0,0 +1,182 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the SweepConfigurationNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SweepConfigurationNotificationRequest{} + +// SweepConfigurationNotificationRequest struct for SweepConfigurationNotificationRequest +type SweepConfigurationNotificationRequest struct { + Data SweepConfigurationNotificationData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewSweepConfigurationNotificationRequest instantiates a new SweepConfigurationNotificationRequest 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 NewSweepConfigurationNotificationRequest(data SweepConfigurationNotificationData, environment string, type_ string) *SweepConfigurationNotificationRequest { + this := SweepConfigurationNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewSweepConfigurationNotificationRequestWithDefaults instantiates a new SweepConfigurationNotificationRequest 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 NewSweepConfigurationNotificationRequestWithDefaults() *SweepConfigurationNotificationRequest { + this := SweepConfigurationNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *SweepConfigurationNotificationRequest) GetData() SweepConfigurationNotificationData { + if o == nil { + var ret SweepConfigurationNotificationData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationNotificationRequest) GetDataOk() (*SweepConfigurationNotificationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *SweepConfigurationNotificationRequest) SetData(v SweepConfigurationNotificationData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *SweepConfigurationNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *SweepConfigurationNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *SweepConfigurationNotificationRequest) 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 *SweepConfigurationNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SweepConfigurationNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o SweepConfigurationNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SweepConfigurationNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableSweepConfigurationNotificationRequest struct { + value *SweepConfigurationNotificationRequest + isSet bool +} + +func (v NullableSweepConfigurationNotificationRequest) Get() *SweepConfigurationNotificationRequest { + return v.value +} + +func (v *NullableSweepConfigurationNotificationRequest) Set(val *SweepConfigurationNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSweepConfigurationNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSweepConfigurationNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSweepConfigurationNotificationRequest(val *SweepConfigurationNotificationRequest) *NullableSweepConfigurationNotificationRequest { + return &NullableSweepConfigurationNotificationRequest{value: val, isSet: true} +} + +func (v NullableSweepConfigurationNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSweepConfigurationNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SweepConfigurationNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.balanceAccountSweep.created", "balancePlatform.balanceAccountSweep.updated", "balancePlatform.balanceAccountSweep.deleted" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_sweep_configuration_v2.go b/src/configurationWebhook/model_sweep_configuration_v2.go new file mode 100644 index 000000000..46160b1d0 --- /dev/null +++ b/src/configurationWebhook/model_sweep_configuration_v2.go @@ -0,0 +1,487 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the SweepConfigurationV2 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SweepConfigurationV2{} + +// SweepConfigurationV2 struct for SweepConfigurationV2 +type SweepConfigurationV2 struct { + Counterparty SweepCounterparty `json:"counterparty"` + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + Currency string `json:"currency"` + // The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + Description *string `json:"description,omitempty"` + // The unique identifier of the sweep. + Id string `json:"id"` + // The reason for disabling the sweep. + Reason *string `json:"reason,omitempty"` + Schedule SweepSchedule `json:"schedule"` + // The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + Status *string `json:"status,omitempty"` + SweepAmount *Amount `json:"sweepAmount,omitempty"` + TargetAmount *Amount `json:"targetAmount,omitempty"` + TriggerAmount *Amount `json:"triggerAmount,omitempty"` + // The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + Type *string `json:"type,omitempty"` +} + +// NewSweepConfigurationV2 instantiates a new SweepConfigurationV2 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 NewSweepConfigurationV2(counterparty SweepCounterparty, currency string, id string, schedule SweepSchedule) *SweepConfigurationV2 { + this := SweepConfigurationV2{} + this.Counterparty = counterparty + this.Currency = currency + this.Id = id + this.Schedule = schedule + var type_ string = "push" + this.Type = &type_ + return &this +} + +// NewSweepConfigurationV2WithDefaults instantiates a new SweepConfigurationV2 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 NewSweepConfigurationV2WithDefaults() *SweepConfigurationV2 { + this := SweepConfigurationV2{} + var type_ string = "push" + this.Type = &type_ + return &this +} + +// GetCounterparty returns the Counterparty field value +func (o *SweepConfigurationV2) GetCounterparty() SweepCounterparty { + if o == nil { + var ret SweepCounterparty + return ret + } + + return o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetCounterpartyOk() (*SweepCounterparty, bool) { + if o == nil { + return nil, false + } + return &o.Counterparty, true +} + +// SetCounterparty sets field value +func (o *SweepConfigurationV2) SetCounterparty(v SweepCounterparty) { + o.Counterparty = v +} + +// GetCurrency returns the Currency field value +func (o *SweepConfigurationV2) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *SweepConfigurationV2) SetCurrency(v string) { + o.Currency = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SweepConfigurationV2) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value +func (o *SweepConfigurationV2) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SweepConfigurationV2) SetId(v string) { + o.Id = v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *SweepConfigurationV2) SetReason(v string) { + o.Reason = &v +} + +// GetSchedule returns the Schedule field value +func (o *SweepConfigurationV2) GetSchedule() SweepSchedule { + if o == nil { + var ret SweepSchedule + return ret + } + + return o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetScheduleOk() (*SweepSchedule, bool) { + if o == nil { + return nil, false + } + return &o.Schedule, true +} + +// SetSchedule sets field value +func (o *SweepConfigurationV2) SetSchedule(v SweepSchedule) { + o.Schedule = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SweepConfigurationV2) SetStatus(v string) { + o.Status = &v +} + +// GetSweepAmount returns the SweepAmount field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetSweepAmount() Amount { + if o == nil || common.IsNil(o.SweepAmount) { + var ret Amount + return ret + } + return *o.SweepAmount +} + +// GetSweepAmountOk returns a tuple with the SweepAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetSweepAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.SweepAmount) { + return nil, false + } + return o.SweepAmount, true +} + +// HasSweepAmount returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasSweepAmount() bool { + if o != nil && !common.IsNil(o.SweepAmount) { + return true + } + + return false +} + +// SetSweepAmount gets a reference to the given Amount and assigns it to the SweepAmount field. +func (o *SweepConfigurationV2) SetSweepAmount(v Amount) { + o.SweepAmount = &v +} + +// GetTargetAmount returns the TargetAmount field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetTargetAmount() Amount { + if o == nil || common.IsNil(o.TargetAmount) { + var ret Amount + return ret + } + return *o.TargetAmount +} + +// GetTargetAmountOk returns a tuple with the TargetAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetTargetAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TargetAmount) { + return nil, false + } + return o.TargetAmount, true +} + +// HasTargetAmount returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasTargetAmount() bool { + if o != nil && !common.IsNil(o.TargetAmount) { + return true + } + + return false +} + +// SetTargetAmount gets a reference to the given Amount and assigns it to the TargetAmount field. +func (o *SweepConfigurationV2) SetTargetAmount(v Amount) { + o.TargetAmount = &v +} + +// GetTriggerAmount returns the TriggerAmount field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetTriggerAmount() Amount { + if o == nil || common.IsNil(o.TriggerAmount) { + var ret Amount + return ret + } + return *o.TriggerAmount +} + +// GetTriggerAmountOk returns a tuple with the TriggerAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetTriggerAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.TriggerAmount) { + return nil, false + } + return o.TriggerAmount, true +} + +// HasTriggerAmount returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasTriggerAmount() bool { + if o != nil && !common.IsNil(o.TriggerAmount) { + return true + } + + return false +} + +// SetTriggerAmount gets a reference to the given Amount and assigns it to the TriggerAmount field. +func (o *SweepConfigurationV2) SetTriggerAmount(v Amount) { + o.TriggerAmount = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SweepConfigurationV2) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepConfigurationV2) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SweepConfigurationV2) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SweepConfigurationV2) SetType(v string) { + o.Type = &v +} + +func (o SweepConfigurationV2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SweepConfigurationV2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["counterparty"] = o.Counterparty + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["id"] = o.Id + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + toSerialize["schedule"] = o.Schedule + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.SweepAmount) { + toSerialize["sweepAmount"] = o.SweepAmount + } + if !common.IsNil(o.TargetAmount) { + toSerialize["targetAmount"] = o.TargetAmount + } + if !common.IsNil(o.TriggerAmount) { + toSerialize["triggerAmount"] = o.TriggerAmount + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableSweepConfigurationV2 struct { + value *SweepConfigurationV2 + isSet bool +} + +func (v NullableSweepConfigurationV2) Get() *SweepConfigurationV2 { + return v.value +} + +func (v *NullableSweepConfigurationV2) Set(val *SweepConfigurationV2) { + v.value = val + v.isSet = true +} + +func (v NullableSweepConfigurationV2) IsSet() bool { + return v.isSet +} + +func (v *NullableSweepConfigurationV2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSweepConfigurationV2(val *SweepConfigurationV2) *NullableSweepConfigurationV2 { + return &NullableSweepConfigurationV2{value: val, isSet: true} +} + +func (v NullableSweepConfigurationV2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SweepConfigurationV2) isValidReason() bool { + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *SweepConfigurationV2) isValidStatus() bool { + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *SweepConfigurationV2) isValidType() bool { + var allowedEnumValues = []string{ "pull", "push" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_sweep_counterparty.go b/src/configurationWebhook/model_sweep_counterparty.go new file mode 100644 index 000000000..b7114a649 --- /dev/null +++ b/src/configurationWebhook/model_sweep_counterparty.go @@ -0,0 +1,201 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the SweepCounterparty type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SweepCounterparty{} + +// SweepCounterparty struct for SweepCounterparty +type SweepCounterparty struct { + // The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + // The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. + MerchantAccount *string `json:"merchantAccount,omitempty"` + // The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. + TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` +} + +// NewSweepCounterparty instantiates a new SweepCounterparty 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 NewSweepCounterparty() *SweepCounterparty { + this := SweepCounterparty{} + return &this +} + +// NewSweepCounterpartyWithDefaults instantiates a new SweepCounterparty 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 NewSweepCounterpartyWithDefaults() *SweepCounterparty { + this := SweepCounterparty{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *SweepCounterparty) GetBalanceAccountId() string { + if o == nil || common.IsNil(o.BalanceAccountId) { + var ret string + return ret + } + return *o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepCounterparty) GetBalanceAccountIdOk() (*string, bool) { + if o == nil || common.IsNil(o.BalanceAccountId) { + return nil, false + } + return o.BalanceAccountId, true +} + +// HasBalanceAccountId returns a boolean if a field has been set. +func (o *SweepCounterparty) HasBalanceAccountId() bool { + if o != nil && !common.IsNil(o.BalanceAccountId) { + return true + } + + return false +} + +// SetBalanceAccountId gets a reference to the given string and assigns it to the BalanceAccountId field. +func (o *SweepCounterparty) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetMerchantAccount returns the MerchantAccount field value if set, zero value otherwise. +func (o *SweepCounterparty) GetMerchantAccount() string { + if o == nil || common.IsNil(o.MerchantAccount) { + var ret string + return ret + } + return *o.MerchantAccount +} + +// GetMerchantAccountOk returns a tuple with the MerchantAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepCounterparty) GetMerchantAccountOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantAccount) { + return nil, false + } + return o.MerchantAccount, true +} + +// HasMerchantAccount returns a boolean if a field has been set. +func (o *SweepCounterparty) HasMerchantAccount() bool { + if o != nil && !common.IsNil(o.MerchantAccount) { + return true + } + + return false +} + +// SetMerchantAccount gets a reference to the given string and assigns it to the MerchantAccount field. +func (o *SweepCounterparty) SetMerchantAccount(v string) { + o.MerchantAccount = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *SweepCounterparty) GetTransferInstrumentId() string { + if o == nil || common.IsNil(o.TransferInstrumentId) { + var ret string + return ret + } + return *o.TransferInstrumentId +} + +// GetTransferInstrumentIdOk returns a tuple with the TransferInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepCounterparty) GetTransferInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransferInstrumentId) { + return nil, false + } + return o.TransferInstrumentId, true +} + +// HasTransferInstrumentId returns a boolean if a field has been set. +func (o *SweepCounterparty) HasTransferInstrumentId() bool { + if o != nil && !common.IsNil(o.TransferInstrumentId) { + return true + } + + return false +} + +// SetTransferInstrumentId gets a reference to the given string and assigns it to the TransferInstrumentId field. +func (o *SweepCounterparty) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o SweepCounterparty) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SweepCounterparty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + if !common.IsNil(o.MerchantAccount) { + toSerialize["merchantAccount"] = o.MerchantAccount + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableSweepCounterparty struct { + value *SweepCounterparty + isSet bool +} + +func (v NullableSweepCounterparty) Get() *SweepCounterparty { + return v.value +} + +func (v *NullableSweepCounterparty) Set(val *SweepCounterparty) { + v.value = val + v.isSet = true +} + +func (v NullableSweepCounterparty) IsSet() bool { + return v.isSet +} + +func (v *NullableSweepCounterparty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSweepCounterparty(val *SweepCounterparty) *NullableSweepCounterparty { + return &NullableSweepCounterparty{value: val, isSet: true} +} + +func (v NullableSweepCounterparty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSweepCounterparty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_sweep_schedule.go b/src/configurationWebhook/model_sweep_schedule.go new file mode 100644 index 000000000..62494505e --- /dev/null +++ b/src/configurationWebhook/model_sweep_schedule.go @@ -0,0 +1,164 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the SweepSchedule type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SweepSchedule{} + +// SweepSchedule struct for SweepSchedule +type SweepSchedule struct { + // A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. + CronExpression *string `json:"cronExpression,omitempty"` + // The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + Type string `json:"type"` +} + +// NewSweepSchedule instantiates a new SweepSchedule 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 NewSweepSchedule(type_ string) *SweepSchedule { + this := SweepSchedule{} + this.Type = type_ + return &this +} + +// NewSweepScheduleWithDefaults instantiates a new SweepSchedule 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 NewSweepScheduleWithDefaults() *SweepSchedule { + this := SweepSchedule{} + return &this +} + +// GetCronExpression returns the CronExpression field value if set, zero value otherwise. +func (o *SweepSchedule) GetCronExpression() string { + if o == nil || common.IsNil(o.CronExpression) { + var ret string + return ret + } + return *o.CronExpression +} + +// GetCronExpressionOk returns a tuple with the CronExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SweepSchedule) GetCronExpressionOk() (*string, bool) { + if o == nil || common.IsNil(o.CronExpression) { + return nil, false + } + return o.CronExpression, true +} + +// HasCronExpression returns a boolean if a field has been set. +func (o *SweepSchedule) HasCronExpression() bool { + if o != nil && !common.IsNil(o.CronExpression) { + return true + } + + return false +} + +// SetCronExpression gets a reference to the given string and assigns it to the CronExpression field. +func (o *SweepSchedule) SetCronExpression(v string) { + o.CronExpression = &v +} + +// GetType returns the Type field value +func (o *SweepSchedule) 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 *SweepSchedule) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SweepSchedule) SetType(v string) { + o.Type = v +} + +func (o SweepSchedule) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SweepSchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CronExpression) { + toSerialize["cronExpression"] = o.CronExpression + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableSweepSchedule struct { + value *SweepSchedule + isSet bool +} + +func (v NullableSweepSchedule) Get() *SweepSchedule { + return v.value +} + +func (v *NullableSweepSchedule) Set(val *SweepSchedule) { + v.value = val + v.isSet = true +} + +func (v NullableSweepSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSweepSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSweepSchedule(val *SweepSchedule) *NullableSweepSchedule { + return &NullableSweepSchedule{value: val, isSet: true} +} + +func (v NullableSweepSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSweepSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SweepSchedule) isValidType() bool { + var allowedEnumValues = []string{ "daily", "weekly", "monthly", "balance", "cron" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_us_local_account_identification.go b/src/configurationWebhook/model_us_local_account_identification.go new file mode 100644 index 000000000..f6a1591d1 --- /dev/null +++ b/src/configurationWebhook/model_us_local_account_identification.go @@ -0,0 +1,235 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &USLocalAccountIdentification{} + +// USLocalAccountIdentification struct for USLocalAccountIdentification +type USLocalAccountIdentification struct { + // The bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + AccountType *string `json:"accountType,omitempty"` + // The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + RoutingNumber string `json:"routingNumber"` + // **usLocal** + Type string `json:"type"` +} + +// NewUSLocalAccountIdentification instantiates a new USLocalAccountIdentification 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 NewUSLocalAccountIdentification(accountNumber string, routingNumber string, type_ string) *USLocalAccountIdentification { + this := USLocalAccountIdentification{} + this.AccountNumber = accountNumber + var accountType string = "checking" + this.AccountType = &accountType + this.RoutingNumber = routingNumber + this.Type = type_ + return &this +} + +// NewUSLocalAccountIdentificationWithDefaults instantiates a new USLocalAccountIdentification 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 NewUSLocalAccountIdentificationWithDefaults() *USLocalAccountIdentification { + this := USLocalAccountIdentification{} + var accountType string = "checking" + this.AccountType = &accountType + var type_ string = "usLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *USLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *USLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *USLocalAccountIdentification) GetAccountType() string { + if o == nil || common.IsNil(o.AccountType) { + var ret string + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *USLocalAccountIdentification) HasAccountType() bool { + if o != nil && !common.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given string and assigns it to the AccountType field. +func (o *USLocalAccountIdentification) SetAccountType(v string) { + o.AccountType = &v +} + +// GetRoutingNumber returns the RoutingNumber field value +func (o *USLocalAccountIdentification) GetRoutingNumber() string { + if o == nil { + var ret string + return ret + } + + return o.RoutingNumber +} + +// GetRoutingNumberOk returns a tuple with the RoutingNumber field value +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetRoutingNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoutingNumber, true +} + +// SetRoutingNumber sets field value +func (o *USLocalAccountIdentification) SetRoutingNumber(v string) { + o.RoutingNumber = v +} + +// GetType returns the Type field value +func (o *USLocalAccountIdentification) 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 *USLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *USLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o USLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + if !common.IsNil(o.AccountType) { + toSerialize["accountType"] = o.AccountType + } + toSerialize["routingNumber"] = o.RoutingNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableUSLocalAccountIdentification struct { + value *USLocalAccountIdentification + isSet bool +} + +func (v NullableUSLocalAccountIdentification) Get() *USLocalAccountIdentification { + return v.value +} + +func (v *NullableUSLocalAccountIdentification) Set(val *USLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableUSLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableUSLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUSLocalAccountIdentification(val *USLocalAccountIdentification) *NullableUSLocalAccountIdentification { + return &NullableUSLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableUSLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *USLocalAccountIdentification) isValidAccountType() bool { + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false +} +func (o *USLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_verification_deadline.go b/src/configurationWebhook/model_verification_deadline.go new file mode 100644 index 000000000..f9aea4c2f --- /dev/null +++ b/src/configurationWebhook/model_verification_deadline.go @@ -0,0 +1,184 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the VerificationDeadline type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &VerificationDeadline{} + +// VerificationDeadline struct for VerificationDeadline +type VerificationDeadline struct { + // The names of the capabilities to be disallowed. + Capabilities []string `json:"capabilities"` + // The unique identifiers of the bank account(s) that the deadline applies to + EntityIds []string `json:"entityIds,omitempty"` + // The date that verification is due by before capabilities are disallowed. + ExpiresAt time.Time `json:"expiresAt"` +} + +// NewVerificationDeadline instantiates a new VerificationDeadline 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 NewVerificationDeadline(capabilities []string, expiresAt time.Time) *VerificationDeadline { + this := VerificationDeadline{} + this.Capabilities = capabilities + this.ExpiresAt = expiresAt + return &this +} + +// NewVerificationDeadlineWithDefaults instantiates a new VerificationDeadline 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 NewVerificationDeadlineWithDefaults() *VerificationDeadline { + this := VerificationDeadline{} + return &this +} + +// GetCapabilities returns the Capabilities field value +func (o *VerificationDeadline) GetCapabilities() []string { + if o == nil { + var ret []string + return ret + } + + return o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value +// and a boolean to check if the value has been set. +func (o *VerificationDeadline) GetCapabilitiesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Capabilities, true +} + +// SetCapabilities sets field value +func (o *VerificationDeadline) SetCapabilities(v []string) { + o.Capabilities = v +} + +// GetEntityIds returns the EntityIds field value if set, zero value otherwise. +func (o *VerificationDeadline) GetEntityIds() []string { + if o == nil || common.IsNil(o.EntityIds) { + var ret []string + return ret + } + return o.EntityIds +} + +// GetEntityIdsOk returns a tuple with the EntityIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationDeadline) GetEntityIdsOk() ([]string, bool) { + if o == nil || common.IsNil(o.EntityIds) { + return nil, false + } + return o.EntityIds, true +} + +// HasEntityIds returns a boolean if a field has been set. +func (o *VerificationDeadline) HasEntityIds() bool { + if o != nil && !common.IsNil(o.EntityIds) { + return true + } + + return false +} + +// SetEntityIds gets a reference to the given []string and assigns it to the EntityIds field. +func (o *VerificationDeadline) SetEntityIds(v []string) { + o.EntityIds = v +} + +// GetExpiresAt returns the ExpiresAt field value +func (o *VerificationDeadline) GetExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value +// and a boolean to check if the value has been set. +func (o *VerificationDeadline) GetExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ExpiresAt, true +} + +// SetExpiresAt sets field value +func (o *VerificationDeadline) SetExpiresAt(v time.Time) { + o.ExpiresAt = v +} + +func (o VerificationDeadline) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerificationDeadline) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["capabilities"] = o.Capabilities + if !common.IsNil(o.EntityIds) { + toSerialize["entityIds"] = o.EntityIds + } + toSerialize["expiresAt"] = o.ExpiresAt + return toSerialize, nil +} + +type NullableVerificationDeadline struct { + value *VerificationDeadline + isSet bool +} + +func (v NullableVerificationDeadline) Get() *VerificationDeadline { + return v.value +} + +func (v *NullableVerificationDeadline) Set(val *VerificationDeadline) { + v.value = val + v.isSet = true +} + +func (v NullableVerificationDeadline) IsSet() bool { + return v.isSet +} + +func (v *NullableVerificationDeadline) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerificationDeadline(val *VerificationDeadline) *NullableVerificationDeadline { + return &NullableVerificationDeadline{value: val, isSet: true} +} + +func (v NullableVerificationDeadline) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerificationDeadline) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/configurationWebhook/model_verification_error.go b/src/configurationWebhook/model_verification_error.go new file mode 100644 index 000000000..3218754e5 --- /dev/null +++ b/src/configurationWebhook/model_verification_error.go @@ -0,0 +1,321 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the VerificationError type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &VerificationError{} + +// VerificationError struct for VerificationError +type VerificationError struct { + // Contains the capabilities that the verification error applies to. + Capabilities []string `json:"capabilities,omitempty"` + // The verification error code. + Code *string `json:"code,omitempty"` + // A description of the error. + Message *string `json:"message,omitempty"` + // Contains the actions that you can take to resolve the verification error. + RemediatingActions []RemediatingAction `json:"remediatingActions,omitempty"` + // Contains more granular information about the verification error. + SubErrors []VerificationErrorRecursive `json:"subErrors,omitempty"` + // The type of error. Possible values: **invalidInput**, **dataMissing**. + Type *string `json:"type,omitempty"` +} + +// NewVerificationError instantiates a new VerificationError 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 NewVerificationError() *VerificationError { + this := VerificationError{} + return &this +} + +// NewVerificationErrorWithDefaults instantiates a new VerificationError 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 NewVerificationErrorWithDefaults() *VerificationError { + this := VerificationError{} + return &this +} + +// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +func (o *VerificationError) GetCapabilities() []string { + if o == nil || common.IsNil(o.Capabilities) { + var ret []string + return ret + } + return o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetCapabilitiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Capabilities) { + return nil, false + } + return o.Capabilities, true +} + +// HasCapabilities returns a boolean if a field has been set. +func (o *VerificationError) HasCapabilities() bool { + if o != nil && !common.IsNil(o.Capabilities) { + return true + } + + return false +} + +// SetCapabilities gets a reference to the given []string and assigns it to the Capabilities field. +func (o *VerificationError) SetCapabilities(v []string) { + o.Capabilities = v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *VerificationError) GetCode() string { + if o == nil || common.IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *VerificationError) HasCode() bool { + if o != nil && !common.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *VerificationError) SetCode(v string) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *VerificationError) GetMessage() string { + if o == nil || common.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *VerificationError) HasMessage() bool { + if o != nil && !common.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *VerificationError) SetMessage(v string) { + o.Message = &v +} + +// GetRemediatingActions returns the RemediatingActions field value if set, zero value otherwise. +func (o *VerificationError) GetRemediatingActions() []RemediatingAction { + if o == nil || common.IsNil(o.RemediatingActions) { + var ret []RemediatingAction + return ret + } + return o.RemediatingActions +} + +// GetRemediatingActionsOk returns a tuple with the RemediatingActions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetRemediatingActionsOk() ([]RemediatingAction, bool) { + if o == nil || common.IsNil(o.RemediatingActions) { + return nil, false + } + return o.RemediatingActions, true +} + +// HasRemediatingActions returns a boolean if a field has been set. +func (o *VerificationError) HasRemediatingActions() bool { + if o != nil && !common.IsNil(o.RemediatingActions) { + return true + } + + return false +} + +// SetRemediatingActions gets a reference to the given []RemediatingAction and assigns it to the RemediatingActions field. +func (o *VerificationError) SetRemediatingActions(v []RemediatingAction) { + o.RemediatingActions = v +} + +// GetSubErrors returns the SubErrors field value if set, zero value otherwise. +func (o *VerificationError) GetSubErrors() []VerificationErrorRecursive { + if o == nil || common.IsNil(o.SubErrors) { + var ret []VerificationErrorRecursive + return ret + } + return o.SubErrors +} + +// GetSubErrorsOk returns a tuple with the SubErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetSubErrorsOk() ([]VerificationErrorRecursive, bool) { + if o == nil || common.IsNil(o.SubErrors) { + return nil, false + } + return o.SubErrors, true +} + +// HasSubErrors returns a boolean if a field has been set. +func (o *VerificationError) HasSubErrors() bool { + if o != nil && !common.IsNil(o.SubErrors) { + return true + } + + return false +} + +// SetSubErrors gets a reference to the given []VerificationErrorRecursive and assigns it to the SubErrors field. +func (o *VerificationError) SetSubErrors(v []VerificationErrorRecursive) { + o.SubErrors = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VerificationError) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationError) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VerificationError) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VerificationError) SetType(v string) { + o.Type = &v +} + +func (o VerificationError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerificationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } + if !common.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !common.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !common.IsNil(o.RemediatingActions) { + toSerialize["remediatingActions"] = o.RemediatingActions + } + if !common.IsNil(o.SubErrors) { + toSerialize["subErrors"] = o.SubErrors + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableVerificationError struct { + value *VerificationError + isSet bool +} + +func (v NullableVerificationError) Get() *VerificationError { + return v.value +} + +func (v *NullableVerificationError) Set(val *VerificationError) { + v.value = val + v.isSet = true +} + +func (v NullableVerificationError) IsSet() bool { + return v.isSet +} + +func (v *NullableVerificationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerificationError(val *VerificationError) *NullableVerificationError { + return &NullableVerificationError{value: val, isSet: true} +} + +func (v NullableVerificationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerificationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *VerificationError) isValidType() bool { + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/configurationWebhook/model_verification_error_recursive.go b/src/configurationWebhook/model_verification_error_recursive.go new file mode 100644 index 000000000..9e16b99fe --- /dev/null +++ b/src/configurationWebhook/model_verification_error_recursive.go @@ -0,0 +1,284 @@ +/* +Configuration webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package configurationwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the VerificationErrorRecursive type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &VerificationErrorRecursive{} + +// VerificationErrorRecursive struct for VerificationErrorRecursive +type VerificationErrorRecursive struct { + // Contains the capabilities that the verification error applies to. + Capabilities []string `json:"capabilities,omitempty"` + // The verification error code. + Code *string `json:"code,omitempty"` + // A description of the error. + Message *string `json:"message,omitempty"` + // The type of error. Possible values: **invalidInput**, **dataMissing**. + Type *string `json:"type,omitempty"` + // Contains the actions that you can take to resolve the verification error. + RemediatingActions []RemediatingAction `json:"remediatingActions,omitempty"` +} + +// NewVerificationErrorRecursive instantiates a new VerificationErrorRecursive 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 NewVerificationErrorRecursive() *VerificationErrorRecursive { + this := VerificationErrorRecursive{} + return &this +} + +// NewVerificationErrorRecursiveWithDefaults instantiates a new VerificationErrorRecursive 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 NewVerificationErrorRecursiveWithDefaults() *VerificationErrorRecursive { + this := VerificationErrorRecursive{} + return &this +} + +// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +func (o *VerificationErrorRecursive) GetCapabilities() []string { + if o == nil || common.IsNil(o.Capabilities) { + var ret []string + return ret + } + return o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationErrorRecursive) GetCapabilitiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Capabilities) { + return nil, false + } + return o.Capabilities, true +} + +// HasCapabilities returns a boolean if a field has been set. +func (o *VerificationErrorRecursive) HasCapabilities() bool { + if o != nil && !common.IsNil(o.Capabilities) { + return true + } + + return false +} + +// SetCapabilities gets a reference to the given []string and assigns it to the Capabilities field. +func (o *VerificationErrorRecursive) SetCapabilities(v []string) { + o.Capabilities = v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *VerificationErrorRecursive) GetCode() string { + if o == nil || common.IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationErrorRecursive) GetCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *VerificationErrorRecursive) HasCode() bool { + if o != nil && !common.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *VerificationErrorRecursive) SetCode(v string) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *VerificationErrorRecursive) GetMessage() string { + if o == nil || common.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationErrorRecursive) GetMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *VerificationErrorRecursive) HasMessage() bool { + if o != nil && !common.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *VerificationErrorRecursive) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VerificationErrorRecursive) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationErrorRecursive) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VerificationErrorRecursive) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VerificationErrorRecursive) SetType(v string) { + o.Type = &v +} + +// GetRemediatingActions returns the RemediatingActions field value if set, zero value otherwise. +func (o *VerificationErrorRecursive) GetRemediatingActions() []RemediatingAction { + if o == nil || common.IsNil(o.RemediatingActions) { + var ret []RemediatingAction + return ret + } + return o.RemediatingActions +} + +// GetRemediatingActionsOk returns a tuple with the RemediatingActions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VerificationErrorRecursive) GetRemediatingActionsOk() ([]RemediatingAction, bool) { + if o == nil || common.IsNil(o.RemediatingActions) { + return nil, false + } + return o.RemediatingActions, true +} + +// HasRemediatingActions returns a boolean if a field has been set. +func (o *VerificationErrorRecursive) HasRemediatingActions() bool { + if o != nil && !common.IsNil(o.RemediatingActions) { + return true + } + + return false +} + +// SetRemediatingActions gets a reference to the given []RemediatingAction and assigns it to the RemediatingActions field. +func (o *VerificationErrorRecursive) SetRemediatingActions(v []RemediatingAction) { + o.RemediatingActions = v +} + +func (o VerificationErrorRecursive) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerificationErrorRecursive) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } + if !common.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !common.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !common.IsNil(o.RemediatingActions) { + toSerialize["remediatingActions"] = o.RemediatingActions + } + return toSerialize, nil +} + +type NullableVerificationErrorRecursive struct { + value *VerificationErrorRecursive + isSet bool +} + +func (v NullableVerificationErrorRecursive) Get() *VerificationErrorRecursive { + return v.value +} + +func (v *NullableVerificationErrorRecursive) Set(val *VerificationErrorRecursive) { + v.value = val + v.isSet = true +} + +func (v NullableVerificationErrorRecursive) IsSet() bool { + return v.isSet +} + +func (v *NullableVerificationErrorRecursive) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerificationErrorRecursive(val *VerificationErrorRecursive) *NullableVerificationErrorRecursive { + return &NullableVerificationErrorRecursive{value: val, isSet: true} +} + +func (v NullableVerificationErrorRecursive) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerificationErrorRecursive) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *VerificationErrorRecursive) isValidType() bool { + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/dataprotection/api_general.go b/src/dataprotection/api_general.go index 2d80f17f9..e9d66cf33 100644 --- a/src/dataprotection/api_general.go +++ b/src/dataprotection/api_general.go @@ -10,10 +10,10 @@ package dataprotection import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiRequestSubjectErasureInput) SubjectErasureByPspReferenceReques return r } + /* Prepare a request for RequestSubjectErasure @return GeneralApiRequestSubjectErasureInput */ func (a *GeneralApi) RequestSubjectErasureInput() GeneralApiRequestSubjectErasureInput { - return GeneralApiRequestSubjectErasureInput{} + return GeneralApiRequestSubjectErasureInput{ + } } /* @@ -48,20 +50,22 @@ Sends the PSP reference containing the shopper data that should be deleted. @return SubjectErasureResponse, *http.Response, error */ func (a *GeneralApi) RequestSubjectErasure(ctx context.Context, r GeneralApiRequestSubjectErasureInput) (SubjectErasureResponse, *http.Response, error) { - res := &SubjectErasureResponse{} + res := &SubjectErasureResponse{} path := "/requestSubjectErasure" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.subjectErasureByPspReferenceRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.subjectErasureByPspReferenceRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/dataprotection/model_service_error.go b/src/dataprotection/model_service_error.go index cbfc0e958..5d0727d1b 100644 --- a/src/dataprotection/model_service_error.go +++ b/src/dataprotection/model_service_error.go @@ -10,8 +10,7 @@ package dataprotection import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/dataprotection/model_subject_erasure_by_psp_reference_request.go b/src/dataprotection/model_subject_erasure_by_psp_reference_request.go index 49f11f2fa..a80914657 100644 --- a/src/dataprotection/model_subject_erasure_by_psp_reference_request.go +++ b/src/dataprotection/model_subject_erasure_by_psp_reference_request.go @@ -10,8 +10,7 @@ package dataprotection import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubjectErasureByPspReferenceRequest type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *SubjectErasureByPspReferenceRequest) SetPspReference(v string) { } func (o SubjectErasureByPspReferenceRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableSubjectErasureByPspReferenceRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/dataprotection/model_subject_erasure_response.go b/src/dataprotection/model_subject_erasure_response.go index 113cfdc45..3ffe0659b 100644 --- a/src/dataprotection/model_subject_erasure_response.go +++ b/src/dataprotection/model_subject_erasure_response.go @@ -10,8 +10,7 @@ package dataprotection import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubjectErasureResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *SubjectErasureResponse) SetResult(v string) { } func (o SubjectErasureResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableSubjectErasureResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SubjectErasureResponse) isValidResult() bool { - var allowedEnumValues = []string{"ACTIVE_RECURRING_TOKEN_EXISTS", "ALREADY_PROCESSED", "PAYMENT_NOT_FOUND", "SUCCESS"} - for _, allowed := range allowedEnumValues { - if o.GetResult() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ACTIVE_RECURRING_TOKEN_EXISTS", "ALREADY_PROCESSED", "PAYMENT_NOT_FOUND", "SUCCESS" } + for _, allowed := range allowedEnumValues { + if o.GetResult() == allowed { + return true + } + } + return false } + diff --git a/src/disputes/api_general.go b/src/disputes/api_general.go index c687e30ff..37fa40260 100644 --- a/src/disputes/api_general.go +++ b/src/disputes/api_general.go @@ -10,10 +10,10 @@ package disputes import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiAcceptDisputeInput) AcceptDisputeRequest(acceptDisputeRequest return r } + /* Prepare a request for AcceptDispute @return GeneralApiAcceptDisputeInput */ func (a *GeneralApi) AcceptDisputeInput() GeneralApiAcceptDisputeInput { - return GeneralApiAcceptDisputeInput{} + return GeneralApiAcceptDisputeInput{ + } } /* @@ -48,24 +50,26 @@ Accepts a specific dispute. @return AcceptDisputeResponse, *http.Response, error */ func (a *GeneralApi) AcceptDispute(ctx context.Context, r GeneralApiAcceptDisputeInput) (AcceptDisputeResponse, *http.Response, error) { - res := &AcceptDisputeResponse{} + res := &AcceptDisputeResponse{} path := "/acceptDispute" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.acceptDisputeRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.acceptDisputeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.DefendDispute type GeneralApiDefendDisputeInput struct { defendDisputeRequest *DefendDisputeRequest @@ -76,13 +80,15 @@ func (r GeneralApiDefendDisputeInput) DefendDisputeRequest(defendDisputeRequest return r } + /* Prepare a request for DefendDispute @return GeneralApiDefendDisputeInput */ func (a *GeneralApi) DefendDisputeInput() GeneralApiDefendDisputeInput { - return GeneralApiDefendDisputeInput{} + return GeneralApiDefendDisputeInput{ + } } /* @@ -95,24 +101,26 @@ Defends a specific dispute. @return DefendDisputeResponse, *http.Response, error */ func (a *GeneralApi) DefendDispute(ctx context.Context, r GeneralApiDefendDisputeInput) (DefendDisputeResponse, *http.Response, error) { - res := &DefendDisputeResponse{} + res := &DefendDisputeResponse{} path := "/defendDispute" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.defendDisputeRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.defendDisputeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.DeleteDisputeDefenseDocument type GeneralApiDeleteDisputeDefenseDocumentInput struct { deleteDefenseDocumentRequest *DeleteDefenseDocumentRequest @@ -123,13 +131,15 @@ func (r GeneralApiDeleteDisputeDefenseDocumentInput) DeleteDefenseDocumentReques return r } + /* Prepare a request for DeleteDisputeDefenseDocument @return GeneralApiDeleteDisputeDefenseDocumentInput */ func (a *GeneralApi) DeleteDisputeDefenseDocumentInput() GeneralApiDeleteDisputeDefenseDocumentInput { - return GeneralApiDeleteDisputeDefenseDocumentInput{} + return GeneralApiDeleteDisputeDefenseDocumentInput{ + } } /* @@ -142,24 +152,26 @@ Deletes a specific dispute defense document that was supplied earlier. @return DeleteDefenseDocumentResponse, *http.Response, error */ func (a *GeneralApi) DeleteDisputeDefenseDocument(ctx context.Context, r GeneralApiDeleteDisputeDefenseDocumentInput) (DeleteDefenseDocumentResponse, *http.Response, error) { - res := &DeleteDefenseDocumentResponse{} + res := &DeleteDefenseDocumentResponse{} path := "/deleteDisputeDefenseDocument" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.deleteDefenseDocumentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.deleteDefenseDocumentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.RetrieveApplicableDefenseReasons type GeneralApiRetrieveApplicableDefenseReasonsInput struct { defenseReasonsRequest *DefenseReasonsRequest @@ -170,13 +182,15 @@ func (r GeneralApiRetrieveApplicableDefenseReasonsInput) DefenseReasonsRequest(d return r } + /* Prepare a request for RetrieveApplicableDefenseReasons @return GeneralApiRetrieveApplicableDefenseReasonsInput */ func (a *GeneralApi) RetrieveApplicableDefenseReasonsInput() GeneralApiRetrieveApplicableDefenseReasonsInput { - return GeneralApiRetrieveApplicableDefenseReasonsInput{} + return GeneralApiRetrieveApplicableDefenseReasonsInput{ + } } /* @@ -189,24 +203,26 @@ Returns a list of all applicable defense reasons to defend a specific dispute. @return DefenseReasonsResponse, *http.Response, error */ func (a *GeneralApi) RetrieveApplicableDefenseReasons(ctx context.Context, r GeneralApiRetrieveApplicableDefenseReasonsInput) (DefenseReasonsResponse, *http.Response, error) { - res := &DefenseReasonsResponse{} + res := &DefenseReasonsResponse{} path := "/retrieveApplicableDefenseReasons" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.defenseReasonsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.defenseReasonsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.SupplyDefenseDocument type GeneralApiSupplyDefenseDocumentInput struct { supplyDefenseDocumentRequest *SupplyDefenseDocumentRequest @@ -217,13 +233,15 @@ func (r GeneralApiSupplyDefenseDocumentInput) SupplyDefenseDocumentRequest(suppl return r } + /* Prepare a request for SupplyDefenseDocument @return GeneralApiSupplyDefenseDocumentInput */ func (a *GeneralApi) SupplyDefenseDocumentInput() GeneralApiSupplyDefenseDocumentInput { - return GeneralApiSupplyDefenseDocumentInput{} + return GeneralApiSupplyDefenseDocumentInput{ + } } /* @@ -236,20 +254,22 @@ Supplies a specific dispute defense document. @return SupplyDefenseDocumentResponse, *http.Response, error */ func (a *GeneralApi) SupplyDefenseDocument(ctx context.Context, r GeneralApiSupplyDefenseDocumentInput) (SupplyDefenseDocumentResponse, *http.Response, error) { - res := &SupplyDefenseDocumentResponse{} + res := &SupplyDefenseDocumentResponse{} path := "/supplyDefenseDocument" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.supplyDefenseDocumentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.supplyDefenseDocumentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/disputes/model_accept_dispute_request.go b/src/disputes/model_accept_dispute_request.go index 4b4f56cb9..34f3825fe 100644 --- a/src/disputes/model_accept_dispute_request.go +++ b/src/disputes/model_accept_dispute_request.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcceptDisputeRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *AcceptDisputeRequest) SetMerchantAccountCode(v string) { } func (o AcceptDisputeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAcceptDisputeRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_accept_dispute_response.go b/src/disputes/model_accept_dispute_response.go index 7ab497f8d..f5c856575 100644 --- a/src/disputes/model_accept_dispute_response.go +++ b/src/disputes/model_accept_dispute_response.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcceptDisputeResponse type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *AcceptDisputeResponse) SetDisputeServiceResult(v DisputeServiceResult) } func (o AcceptDisputeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableAcceptDisputeResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defend_dispute_request.go b/src/disputes/model_defend_dispute_request.go index 373281cf2..184041365 100644 --- a/src/disputes/model_defend_dispute_request.go +++ b/src/disputes/model_defend_dispute_request.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefendDisputeRequest type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *DefendDisputeRequest) SetMerchantAccountCode(v string) { } func (o DefendDisputeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableDefendDisputeRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defend_dispute_response.go b/src/disputes/model_defend_dispute_response.go index e2f0afac4..bbc7eabab 100644 --- a/src/disputes/model_defend_dispute_response.go +++ b/src/disputes/model_defend_dispute_response.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefendDisputeResponse type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *DefendDisputeResponse) SetDisputeServiceResult(v DisputeServiceResult) } func (o DefendDisputeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableDefendDisputeResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defense_document.go b/src/disputes/model_defense_document.go index 78aa87f55..a9e858bd7 100644 --- a/src/disputes/model_defense_document.go +++ b/src/disputes/model_defense_document.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefenseDocument type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *DefenseDocument) SetDefenseDocumentTypeCode(v string) { } func (o DefenseDocument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableDefenseDocument) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defense_document_type.go b/src/disputes/model_defense_document_type.go index ce0ac22d9..f56e33f7a 100644 --- a/src/disputes/model_defense_document_type.go +++ b/src/disputes/model_defense_document_type.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefenseDocumentType type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *DefenseDocumentType) SetRequirementLevel(v string) { } func (o DefenseDocumentType) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableDefenseDocumentType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defense_reason.go b/src/disputes/model_defense_reason.go index 8b9b9ccab..e05ee549d 100644 --- a/src/disputes/model_defense_reason.go +++ b/src/disputes/model_defense_reason.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefenseReason type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *DefenseReason) SetSatisfied(v bool) { } func (o DefenseReason) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableDefenseReason) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defense_reasons_request.go b/src/disputes/model_defense_reasons_request.go index 471f86162..0019dbecd 100644 --- a/src/disputes/model_defense_reasons_request.go +++ b/src/disputes/model_defense_reasons_request.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefenseReasonsRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *DefenseReasonsRequest) SetMerchantAccountCode(v string) { } func (o DefenseReasonsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableDefenseReasonsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_defense_reasons_response.go b/src/disputes/model_defense_reasons_response.go index f88033988..a2e494d59 100644 --- a/src/disputes/model_defense_reasons_response.go +++ b/src/disputes/model_defense_reasons_response.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DefenseReasonsResponse type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &DefenseReasonsResponse{} // DefenseReasonsResponse struct for DefenseReasonsResponse type DefenseReasonsResponse struct { // The defense reasons that can be used to defend the dispute. - DefenseReasons []DefenseReason `json:"defenseReasons,omitempty"` + DefenseReasons []DefenseReason `json:"defenseReasons,omitempty"` DisputeServiceResult DisputeServiceResult `json:"disputeServiceResult"` } @@ -99,7 +98,7 @@ func (o *DefenseReasonsResponse) SetDisputeServiceResult(v DisputeServiceResult) } func (o DefenseReasonsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableDefenseReasonsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_delete_defense_document_request.go b/src/disputes/model_delete_defense_document_request.go index 0b2557b9c..8e9f13736 100644 --- a/src/disputes/model_delete_defense_document_request.go +++ b/src/disputes/model_delete_defense_document_request.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeleteDefenseDocumentRequest type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *DeleteDefenseDocumentRequest) SetMerchantAccountCode(v string) { } func (o DeleteDefenseDocumentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableDeleteDefenseDocumentRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_delete_defense_document_response.go b/src/disputes/model_delete_defense_document_response.go index 1cfcd42d2..17c3dad28 100644 --- a/src/disputes/model_delete_defense_document_response.go +++ b/src/disputes/model_delete_defense_document_response.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeleteDefenseDocumentResponse type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *DeleteDefenseDocumentResponse) SetDisputeServiceResult(v DisputeService } func (o DeleteDefenseDocumentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableDeleteDefenseDocumentResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_dispute_service_result.go b/src/disputes/model_dispute_service_result.go index b1f7f07c0..4bfb48ef1 100644 --- a/src/disputes/model_dispute_service_result.go +++ b/src/disputes/model_dispute_service_result.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DisputeServiceResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *DisputeServiceResult) SetSuccess(v bool) { } func (o DisputeServiceResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableDisputeServiceResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_service_error.go b/src/disputes/model_service_error.go index 59e26dd72..6ac95e18d 100644 --- a/src/disputes/model_service_error.go +++ b/src/disputes/model_service_error.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_supply_defense_document_request.go b/src/disputes/model_supply_defense_document_request.go index 8e85438da..256673850 100644 --- a/src/disputes/model_supply_defense_document_request.go +++ b/src/disputes/model_supply_defense_document_request.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SupplyDefenseDocumentRequest type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *SupplyDefenseDocumentRequest) SetMerchantAccountCode(v string) { } func (o SupplyDefenseDocumentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableSupplyDefenseDocumentRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/disputes/model_supply_defense_document_response.go b/src/disputes/model_supply_defense_document_response.go index ab7449578..8da9d66af 100644 --- a/src/disputes/model_supply_defense_document_response.go +++ b/src/disputes/model_supply_defense_document_response.go @@ -10,8 +10,7 @@ package disputes import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SupplyDefenseDocumentResponse type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *SupplyDefenseDocumentResponse) SetDisputeServiceResult(v DisputeService } func (o SupplyDefenseDocumentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableSupplyDefenseDocumentResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/api_business_lines.go b/src/legalentity/api_business_lines.go index eb3c7f37b..7a936905e 100644 --- a/src/legalentity/api_business_lines.go +++ b/src/legalentity/api_business_lines.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // BusinessLinesApi service @@ -30,19 +29,21 @@ func (r BusinessLinesApiCreateBusinessLineInput) BusinessLineInfo(businessLineIn return r } + /* Prepare a request for CreateBusinessLine @return BusinessLinesApiCreateBusinessLineInput */ func (a *BusinessLinesApi) CreateBusinessLineInput() BusinessLinesApiCreateBusinessLineInput { - return BusinessLinesApiCreateBusinessLineInput{} + return BusinessLinesApiCreateBusinessLineInput{ + } } /* CreateBusinessLine Create a business line -Creates a business line. +Creates a business line. This resource contains information about your user's line of business, including their industry and their source of funds. Adyen uses this information to verify your users as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. @@ -55,29 +56,32 @@ This resource contains information about your user's line of business, including @return BusinessLine, *http.Response, error */ func (a *BusinessLinesApi) CreateBusinessLine(ctx context.Context, r BusinessLinesApiCreateBusinessLineInput) (BusinessLine, *http.Response, error) { - res := &BusinessLine{} + res := &BusinessLine{} path := "/businessLines" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.businessLineInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.businessLineInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by BusinessLinesApi.DeleteBusinessLine type BusinessLinesApiDeleteBusinessLineInput struct { id string } + /* Prepare a request for DeleteBusinessLine @param id The unique identifier of the business line to be deleted. @@ -101,30 +105,33 @@ Deletes a business line. @return *http.Response, error */ func (a *BusinessLinesApi) DeleteBusinessLine(ctx context.Context, r BusinessLinesApiDeleteBusinessLineInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return httpRes, err } + // All parameters accepted by BusinessLinesApi.GetBusinessLine type BusinessLinesApiGetBusinessLineInput struct { id string } + /* Prepare a request for GetBusinessLine @param id The unique identifier of the business line. @@ -146,28 +153,30 @@ Returns the detail of a business line. @return BusinessLine, *http.Response, error */ func (a *BusinessLinesApi) GetBusinessLine(ctx context.Context, r BusinessLinesApiGetBusinessLineInput) (BusinessLine, *http.Response, error) { - res := &BusinessLine{} + res := &BusinessLine{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by BusinessLinesApi.UpdateBusinessLine type BusinessLinesApiUpdateBusinessLineInput struct { - id string + id string businessLineInfoUpdate *BusinessLineInfoUpdate } @@ -176,6 +185,7 @@ func (r BusinessLinesApiUpdateBusinessLineInput) BusinessLineInfoUpdate(business return r } + /* Prepare a request for UpdateBusinessLine @param id The unique identifier of the business line. @@ -197,21 +207,23 @@ Updates a business line. @return BusinessLine, *http.Response, error */ func (a *BusinessLinesApi) UpdateBusinessLine(ctx context.Context, r BusinessLinesApiUpdateBusinessLineInput) (BusinessLine, *http.Response, error) { - res := &BusinessLine{} + res := &BusinessLine{} path := "/businessLines/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.businessLineInfoUpdate, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.businessLineInfoUpdate, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_documents.go b/src/legalentity/api_documents.go index 13158172f..cc3889428 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // DocumentsApi service @@ -25,6 +24,7 @@ type DocumentsApiDeleteDocumentInput struct { id string } + /* Prepare a request for DeleteDocument @param id The unique identifier of the document to be deleted. @@ -46,30 +46,33 @@ Deletes a document. @return *http.Response, error */ func (a *DocumentsApi) DeleteDocument(ctx context.Context, r DocumentsApiDeleteDocumentInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return httpRes, err } + // All parameters accepted by DocumentsApi.GetDocument type DocumentsApiGetDocumentInput struct { id string } + /* Prepare a request for GetDocument @param id The unique identifier of the document. @@ -91,30 +94,32 @@ Returns a document. @return Document, *http.Response, error */ func (a *DocumentsApi) GetDocument(ctx context.Context, r DocumentsApiGetDocumentInput) (Document, *http.Response, error) { - res := &Document{} + res := &Document{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by DocumentsApi.UpdateDocument type DocumentsApiUpdateDocumentInput struct { - id string + id string xRequestedVerificationCode *string - document *Document + document *Document } // Use the requested verification code 0_0001 to resolve any suberrors associated with the document. Requested verification codes can only be used in your test environment. @@ -128,6 +133,7 @@ func (r DocumentsApiUpdateDocumentInput) Document(document Document) DocumentsAp return r } + /* Prepare a request for UpdateDocument @param id The unique identifier of the document to be updated. @@ -151,32 +157,34 @@ Updates a document. @return Document, *http.Response, error */ func (a *DocumentsApi) UpdateDocument(ctx context.Context, r DocumentsApiUpdateDocumentInput) (Document, *http.Response, error) { - res := &Document{} + res := &Document{} path := "/documents/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.document, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.document, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) - return *res, httpRes, err + + return *res, httpRes, err } + // All parameters accepted by DocumentsApi.UploadDocumentForVerificationChecks type DocumentsApiUploadDocumentForVerificationChecksInput struct { xRequestedVerificationCode *string - document *Document + document *Document } // Use a suberror code as your requested verification code. You can include one code at a time in your request header. Requested verification codes can only be used in your test environment. @@ -190,13 +198,15 @@ func (r DocumentsApiUploadDocumentForVerificationChecksInput) Document(document return r } + /* Prepare a request for UploadDocumentForVerificationChecks @return DocumentsApiUploadDocumentForVerificationChecksInput */ func (a *DocumentsApi) UploadDocumentForVerificationChecksInput() DocumentsApiUploadDocumentForVerificationChecksInput { - return DocumentsApiUploadDocumentForVerificationChecksInput{} + return DocumentsApiUploadDocumentForVerificationChecksInput{ + } } /* @@ -215,23 +225,25 @@ Uploads a document for verification checks. @return Document, *http.Response, error */ func (a *DocumentsApi) UploadDocumentForVerificationChecks(ctx context.Context, r DocumentsApiUploadDocumentForVerificationChecksInput) (Document, *http.Response, error) { - res := &Document{} + res := &Document{} path := "/documents" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.document, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.document, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_hosted_onboarding.go b/src/legalentity/api_hosted_onboarding.go index 0961d835c..940279e69 100644 --- a/src/legalentity/api_hosted_onboarding.go +++ b/src/legalentity/api_hosted_onboarding.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // HostedOnboardingApi service @@ -22,7 +21,7 @@ type HostedOnboardingApi common.Service // All parameters accepted by HostedOnboardingApi.GetLinkToAdyenhostedOnboardingPage type HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageInput struct { - id string + id string onboardingLinkInfo *OnboardingLinkInfo } @@ -31,6 +30,7 @@ func (r HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageInput) OnboardingLi return r } + /* Prepare a request for GetLinkToAdyenhostedOnboardingPage @param id The unique identifier of the legal entity @@ -56,30 +56,33 @@ Returns a link to an Adyen-hosted onboarding page where you need to redirect you @return OnboardingLink, *http.Response, error */ func (a *HostedOnboardingApi) GetLinkToAdyenhostedOnboardingPage(ctx context.Context, r HostedOnboardingApiGetLinkToAdyenhostedOnboardingPageInput) (OnboardingLink, *http.Response, error) { - res := &OnboardingLink{} + res := &OnboardingLink{} path := "/legalEntities/{id}/onboardingLinks" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.onboardingLinkInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.onboardingLinkInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by HostedOnboardingApi.GetOnboardingLinkTheme type HostedOnboardingApiGetOnboardingLinkThemeInput struct { id string } + /* Prepare a request for GetOnboardingLinkTheme @param id The unique identifier of the theme @@ -103,36 +106,40 @@ Returns the details of the theme identified in the path.>If you are using hosted @return OnboardingTheme, *http.Response, error */ func (a *HostedOnboardingApi) GetOnboardingLinkTheme(ctx context.Context, r HostedOnboardingApiGetOnboardingLinkThemeInput) (OnboardingTheme, *http.Response, error) { - res := &OnboardingTheme{} + res := &OnboardingTheme{} path := "/themes/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by HostedOnboardingApi.ListHostedOnboardingPageThemes type HostedOnboardingApiListHostedOnboardingPageThemesInput struct { } + /* Prepare a request for ListHostedOnboardingPageThemes @return HostedOnboardingApiListHostedOnboardingPageThemesInput */ func (a *HostedOnboardingApi) ListHostedOnboardingPageThemesInput() HostedOnboardingApiListHostedOnboardingPageThemesInput { - return HostedOnboardingApiListHostedOnboardingPageThemesInput{} + return HostedOnboardingApiListHostedOnboardingPageThemesInput{ + } } /* @@ -149,20 +156,22 @@ Returns a list of hosted onboarding page themes. @return OnboardingThemes, *http.Response, error */ func (a *HostedOnboardingApi) ListHostedOnboardingPageThemes(ctx context.Context, r HostedOnboardingApiListHostedOnboardingPageThemesInput) (OnboardingThemes, *http.Response, error) { - res := &OnboardingThemes{} + res := &OnboardingThemes{} path := "/themes" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index df48c9006..775b5499d 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // LegalEntitiesApi service @@ -25,6 +24,7 @@ type LegalEntitiesApiCheckLegalEntitysVerificationErrorsInput struct { id string } + /* Prepare a request for CheckLegalEntitysVerificationErrors @param id The unique identifier of the legal entity. @@ -46,28 +46,78 @@ Returns the verification errors for a legal entity and its supporting entities. @return VerificationErrors, *http.Response, error */ func (a *LegalEntitiesApi) CheckLegalEntitysVerificationErrors(ctx context.Context, r LegalEntitiesApiCheckLegalEntitysVerificationErrorsInput) (VerificationErrors, *http.Response, error) { - res := &VerificationErrors{} + res := &VerificationErrors{} path := "/legalEntities/{id}/checkVerificationErrors" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err +} + + +// All parameters accepted by LegalEntitiesApi.ConfirmDataReview +type LegalEntitiesApiConfirmDataReviewInput struct { + id string +} + + +/* +Prepare a request for ConfirmDataReview +@param id The unique identifier of the legal entity. +@return LegalEntitiesApiConfirmDataReviewInput +*/ +func (a *LegalEntitiesApi) ConfirmDataReviewInput(id string) LegalEntitiesApiConfirmDataReviewInput { + return LegalEntitiesApiConfirmDataReviewInput{ + id: id, + } } +/* +ConfirmDataReview Confirm data review + +Confirms that your user has reviewed the data for the legal entity specified in the path. Call this endpoint to inform Adyen that your user reviewed and verified that the data is up-to-date. The endpoint returns the timestamp of when Adyen received the request. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r LegalEntitiesApiConfirmDataReviewInput - Request parameters, see ConfirmDataReviewInput +@return DataReviewConfirmationResponse, *http.Response, error +*/ +func (a *LegalEntitiesApi) ConfirmDataReview(ctx context.Context, r LegalEntitiesApiConfirmDataReviewInput) (DataReviewConfirmationResponse, *http.Response, error) { + res := &DataReviewConfirmationResponse{} + path := "/legalEntities/{id}/confirmDataReview" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err +} + + // All parameters accepted by LegalEntitiesApi.CreateLegalEntity type LegalEntitiesApiCreateLegalEntityInput struct { - xRequestedVerificationCode *string + xRequestedVerificationCode *string legalEntityInfoRequiredType *LegalEntityInfoRequiredType } @@ -82,21 +132,23 @@ func (r LegalEntitiesApiCreateLegalEntityInput) LegalEntityInfoRequiredType(lega return r } + /* Prepare a request for CreateLegalEntity @return LegalEntitiesApiCreateLegalEntityInput */ func (a *LegalEntitiesApi) CreateLegalEntityInput() LegalEntitiesApiCreateLegalEntityInput { - return LegalEntitiesApiCreateLegalEntityInput{} + return LegalEntitiesApiCreateLegalEntityInput{ + } } /* CreateLegalEntity Create a legal entity -Creates a legal entity. +Creates a legal entity. -This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. +This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. >If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. @@ -107,32 +159,35 @@ This resource contains information about the user that will be onboarded in your @return LegalEntity, *http.Response, error */ func (a *LegalEntitiesApi) CreateLegalEntity(ctx context.Context, r LegalEntitiesApiCreateLegalEntityInput) (LegalEntity, *http.Response, error) { - res := &LegalEntity{} + res := &LegalEntity{} path := "/legalEntities" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.legalEntityInfoRequiredType, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.legalEntityInfoRequiredType, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by LegalEntitiesApi.GetAllBusinessLinesUnderLegalEntity type LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityInput struct { id string } + /* Prepare a request for GetAllBusinessLinesUnderLegalEntity @param id The unique identifier of the legal entity. @@ -154,30 +209,33 @@ Returns the business lines owned by a legal entity. @return BusinessLines, *http.Response, error */ func (a *LegalEntitiesApi) GetAllBusinessLinesUnderLegalEntity(ctx context.Context, r LegalEntitiesApiGetAllBusinessLinesUnderLegalEntityInput) (BusinessLines, *http.Response, error) { - res := &BusinessLines{} + res := &BusinessLines{} path := "/legalEntities/{id}/businessLines" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by LegalEntitiesApi.GetLegalEntity type LegalEntitiesApiGetLegalEntityInput struct { id string } + /* Prepare a request for GetLegalEntity @param id The unique identifier of the legal entity. @@ -199,30 +257,32 @@ Returns a legal entity. @return LegalEntity, *http.Response, error */ func (a *LegalEntitiesApi) GetLegalEntity(ctx context.Context, r LegalEntitiesApiGetLegalEntityInput) (LegalEntity, *http.Response, error) { - res := &LegalEntity{} + res := &LegalEntity{} path := "/legalEntities/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by LegalEntitiesApi.UpdateLegalEntity type LegalEntitiesApiUpdateLegalEntityInput struct { - id string + id string xRequestedVerificationCode *string - legalEntityInfo *LegalEntityInfo + legalEntityInfo *LegalEntityInfo } // Use the requested verification code 0_0001 to resolve any suberrors associated with the legal entity. Requested verification codes can only be used in your test environment. @@ -236,6 +296,7 @@ func (r LegalEntitiesApiUpdateLegalEntityInput) LegalEntityInfo(legalEntityInfo return r } + /* Prepare a request for UpdateLegalEntity @param id The unique identifier of the legal entity. @@ -259,24 +320,26 @@ Updates a legal entity. @return LegalEntity, *http.Response, error */ func (a *LegalEntitiesApi) UpdateLegalEntity(ctx context.Context, r LegalEntitiesApiUpdateLegalEntityInput) (LegalEntity, *http.Response, error) { - res := &LegalEntity{} + res := &LegalEntity{} path := "/legalEntities/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.legalEntityInfo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.legalEntityInfo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index b82fcc2d1..2827d30f8 100644 --- a/src/legalentity/api_pci_questionnaires.go +++ b/src/legalentity/api_pci_questionnaires.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PCIQuestionnairesApi service @@ -22,7 +21,7 @@ type PCIQuestionnairesApi common.Service // All parameters accepted by PCIQuestionnairesApi.GeneratePciQuestionnaire type PCIQuestionnairesApiGeneratePciQuestionnaireInput struct { - id string + id string generatePciDescriptionRequest *GeneratePciDescriptionRequest } @@ -31,6 +30,7 @@ func (r PCIQuestionnairesApiGeneratePciQuestionnaireInput) GeneratePciDescriptio return r } + /* Prepare a request for GeneratePciQuestionnaire @param id The unique identifier of the legal entity to get PCI questionnaire information. @@ -52,31 +52,34 @@ Generates the required PCI questionnaires based on the user's [salesChannel](htt @return GeneratePciDescriptionResponse, *http.Response, error */ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaire(ctx context.Context, r PCIQuestionnairesApiGeneratePciQuestionnaireInput) (GeneratePciDescriptionResponse, *http.Response, error) { - res := &GeneratePciDescriptionResponse{} + res := &GeneratePciDescriptionResponse{} path := "/legalEntities/{id}/pciQuestionnaires/generatePciTemplates" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.generatePciDescriptionRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.generatePciDescriptionRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PCIQuestionnairesApi.GetPciQuestionnaire type PCIQuestionnairesApiGetPciQuestionnaireInput struct { - id string + id string pciid string } + /* Prepare a request for GetPciQuestionnaire @param id The legal entity ID of the individual who signed the PCI questionnaire.@param pciid The unique identifier of the signed PCI questionnaire. @@ -84,7 +87,7 @@ Prepare a request for GetPciQuestionnaire */ func (a *PCIQuestionnairesApi) GetPciQuestionnaireInput(id string, pciid string) PCIQuestionnairesApiGetPciQuestionnaireInput { return PCIQuestionnairesApiGetPciQuestionnaireInput{ - id: id, + id: id, pciid: pciid, } } @@ -99,31 +102,34 @@ Returns the signed PCI questionnaire. @return GetPciQuestionnaireResponse, *http.Response, error */ func (a *PCIQuestionnairesApi) GetPciQuestionnaire(ctx context.Context, r PCIQuestionnairesApiGetPciQuestionnaireInput) (GetPciQuestionnaireResponse, *http.Response, error) { - res := &GetPciQuestionnaireResponse{} + res := &GetPciQuestionnaireResponse{} path := "/legalEntities/{id}/pciQuestionnaires/{pciid}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - path = strings.Replace(path, "{"+"pciid"+"}", url.PathEscape(common.ParameterValueToString(r.pciid, "pciid")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + path = strings.Replace(path, "{"+"pciid"+"}", url.PathEscape(common.ParameterValueToString(r.pciid, "pciid")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PCIQuestionnairesApi.GetPciQuestionnaireDetails type PCIQuestionnairesApiGetPciQuestionnaireDetailsInput struct { id string } + /* Prepare a request for GetPciQuestionnaireDetails @param id The unique identifier of the legal entity to get PCI questionnaire information. @@ -145,28 +151,30 @@ Get a list of signed PCI questionnaires. @return GetPciQuestionnaireInfosResponse, *http.Response, error */ func (a *PCIQuestionnairesApi) GetPciQuestionnaireDetails(ctx context.Context, r PCIQuestionnairesApiGetPciQuestionnaireDetailsInput) (GetPciQuestionnaireInfosResponse, *http.Response, error) { - res := &GetPciQuestionnaireInfosResponse{} + res := &GetPciQuestionnaireInfosResponse{} path := "/legalEntities/{id}/pciQuestionnaires" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PCIQuestionnairesApi.SignPciQuestionnaire type PCIQuestionnairesApiSignPciQuestionnaireInput struct { - id string + id string pciSigningRequest *PciSigningRequest } @@ -175,6 +183,7 @@ func (r PCIQuestionnairesApiSignPciQuestionnaireInput) PciSigningRequest(pciSign return r } + /* Prepare a request for SignPciQuestionnaire @param id The legal entity ID of the individual who signed the PCI questionnaire. @@ -196,21 +205,23 @@ Signs the required PCI questionnaire. @return PciSigningResponse, *http.Response, error */ func (a *PCIQuestionnairesApi) SignPciQuestionnaire(ctx context.Context, r PCIQuestionnairesApiSignPciQuestionnaireInput) (PciSigningResponse, *http.Response, error) { - res := &PciSigningResponse{} + res := &PciSigningResponse{} path := "/legalEntities/{id}/pciQuestionnaires/signPciTemplates" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.pciSigningRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.pciSigningRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index 914359de3..904b54358 100644 --- a/src/legalentity/api_terms_of_service.go +++ b/src/legalentity/api_terms_of_service.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TermsOfServiceApi service @@ -22,8 +21,8 @@ type TermsOfServiceApi common.Service // All parameters accepted by TermsOfServiceApi.AcceptTermsOfService type TermsOfServiceApiAcceptTermsOfServiceInput struct { - id string - termsofservicedocumentid string + id string + termsofservicedocumentid string acceptTermsOfServiceRequest *AcceptTermsOfServiceRequest } @@ -32,6 +31,7 @@ func (r TermsOfServiceApiAcceptTermsOfServiceInput) AcceptTermsOfServiceRequest( return r } + /* Prepare a request for AcceptTermsOfService @param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner.@param termsofservicedocumentid The unique identifier of the Terms of Service document. @@ -39,7 +39,7 @@ Prepare a request for AcceptTermsOfService */ func (a *TermsOfServiceApi) AcceptTermsOfServiceInput(id string, termsofservicedocumentid string) TermsOfServiceApiAcceptTermsOfServiceInput { return TermsOfServiceApiAcceptTermsOfServiceInput{ - id: id, + id: id, termsofservicedocumentid: termsofservicedocumentid, } } @@ -54,29 +54,31 @@ Accepts Terms of Service. @return AcceptTermsOfServiceResponse, *http.Response, error */ func (a *TermsOfServiceApi) AcceptTermsOfService(ctx context.Context, r TermsOfServiceApiAcceptTermsOfServiceInput) (AcceptTermsOfServiceResponse, *http.Response, error) { - res := &AcceptTermsOfServiceResponse{} + res := &AcceptTermsOfServiceResponse{} path := "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - path = strings.Replace(path, "{"+"termsofservicedocumentid"+"}", url.PathEscape(common.ParameterValueToString(r.termsofservicedocumentid, "termsofservicedocumentid")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.acceptTermsOfServiceRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + path = strings.Replace(path, "{"+"termsofservicedocumentid"+"}", url.PathEscape(common.ParameterValueToString(r.termsofservicedocumentid, "termsofservicedocumentid")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.acceptTermsOfServiceRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by TermsOfServiceApi.GetTermsOfServiceDocument type TermsOfServiceApiGetTermsOfServiceDocumentInput struct { - id string + id string getTermsOfServiceDocumentRequest *GetTermsOfServiceDocumentRequest } @@ -85,6 +87,7 @@ func (r TermsOfServiceApiGetTermsOfServiceDocumentInput) GetTermsOfServiceDocume return r } + /* Prepare a request for GetTermsOfServiceDocument @param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @@ -106,30 +109,33 @@ Returns the Terms of Service document for a legal entity. @return GetTermsOfServiceDocumentResponse, *http.Response, error */ func (a *TermsOfServiceApi) GetTermsOfServiceDocument(ctx context.Context, r TermsOfServiceApiGetTermsOfServiceDocumentInput) (GetTermsOfServiceDocumentResponse, *http.Response, error) { - res := &GetTermsOfServiceDocumentResponse{} + res := &GetTermsOfServiceDocumentResponse{} path := "/legalEntities/{id}/termsOfService" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.getTermsOfServiceDocumentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.getTermsOfServiceDocumentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by TermsOfServiceApi.GetTermsOfServiceInformationForLegalEntity type TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput struct { id string } + /* Prepare a request for GetTermsOfServiceInformationForLegalEntity @param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @@ -151,30 +157,33 @@ Returns Terms of Service information for a legal entity. @return GetTermsOfServiceAcceptanceInfosResponse, *http.Response, error */ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntity(ctx context.Context, r TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput) (GetTermsOfServiceAcceptanceInfosResponse, *http.Response, error) { - res := &GetTermsOfServiceAcceptanceInfosResponse{} + res := &GetTermsOfServiceAcceptanceInfosResponse{} path := "/legalEntities/{id}/termsOfServiceAcceptanceInfos" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by TermsOfServiceApi.GetTermsOfServiceStatus type TermsOfServiceApiGetTermsOfServiceStatusInput struct { id string } + /* Prepare a request for GetTermsOfServiceStatus @param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @@ -196,21 +205,23 @@ Returns the required types of Terms of Service that need to be accepted by a leg @return CalculateTermsOfServiceStatusResponse, *http.Response, error */ func (a *TermsOfServiceApi) GetTermsOfServiceStatus(ctx context.Context, r TermsOfServiceApiGetTermsOfServiceStatusInput) (CalculateTermsOfServiceStatusResponse, *http.Response, error) { - res := &CalculateTermsOfServiceStatusResponse{} + res := &CalculateTermsOfServiceStatusResponse{} path := "/legalEntities/{id}/termsOfServiceStatus" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index 81376a6ab..134b44a6a 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -10,11 +10,10 @@ package legalentity import ( "context" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TransferInstrumentsApi service @@ -23,7 +22,7 @@ type TransferInstrumentsApi common.Service // All parameters accepted by TransferInstrumentsApi.CreateTransferInstrument type TransferInstrumentsApiCreateTransferInstrumentInput struct { xRequestedVerificationCode *string - transferInstrumentInfo *TransferInstrumentInfo + transferInstrumentInfo *TransferInstrumentInfo } // Use a suberror code as your requested verification code. You can include one code at a time in your request header. Requested verification codes can only be used in your test environment. @@ -37,19 +36,21 @@ func (r TransferInstrumentsApiCreateTransferInstrumentInput) TransferInstrumentI return r } + /* Prepare a request for CreateTransferInstrument @return TransferInstrumentsApiCreateTransferInstrumentInput */ func (a *TransferInstrumentsApi) CreateTransferInstrumentInput() TransferInstrumentsApiCreateTransferInstrumentInput { - return TransferInstrumentsApiCreateTransferInstrumentInput{} + return TransferInstrumentsApiCreateTransferInstrumentInput{ + } } /* CreateTransferInstrument Create a transfer instrument -Creates a transfer instrument. +Creates a transfer instrument. A transfer instrument is a bank account that a legal entity owns. Adyen performs verification checks on the transfer instrument as required by payment industry regulations. We inform you of the verification results through webhooks or API responses. @@ -60,32 +61,35 @@ When the transfer instrument passes the verification checks, you can start sendi @return TransferInstrument, *http.Response, error */ func (a *TransferInstrumentsApi) CreateTransferInstrument(ctx context.Context, r TransferInstrumentsApiCreateTransferInstrumentInput) (TransferInstrument, *http.Response, error) { - res := &TransferInstrument{} + res := &TransferInstrument{} path := "/transferInstruments" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transferInstrumentInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferInstrumentInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + - return *res, httpRes, err + return *res, httpRes, err } + // All parameters accepted by TransferInstrumentsApi.DeleteTransferInstrument type TransferInstrumentsApiDeleteTransferInstrumentInput struct { id string } + /* Prepare a request for DeleteTransferInstrument @param id The unique identifier of the transfer instrument to be deleted. @@ -107,30 +111,33 @@ Deletes a transfer instrument. @return *http.Response, error */ func (a *TransferInstrumentsApi) DeleteTransferInstrument(ctx context.Context, r TransferInstrumentsApiDeleteTransferInstrumentInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return httpRes, err } + // All parameters accepted by TransferInstrumentsApi.GetTransferInstrument type TransferInstrumentsApiGetTransferInstrumentInput struct { id string } + /* Prepare a request for GetTransferInstrument @param id The unique identifier of the transfer instrument. @@ -152,30 +159,32 @@ Returns the details of a transfer instrument. @return TransferInstrument, *http.Response, error */ func (a *TransferInstrumentsApi) GetTransferInstrument(ctx context.Context, r TransferInstrumentsApiGetTransferInstrumentInput) (TransferInstrument, *http.Response, error) { - res := &TransferInstrument{} + res := &TransferInstrument{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by TransferInstrumentsApi.UpdateTransferInstrument type TransferInstrumentsApiUpdateTransferInstrumentInput struct { - id string + id string xRequestedVerificationCode *string - transferInstrumentInfo *TransferInstrumentInfo + transferInstrumentInfo *TransferInstrumentInfo } // Use the requested verification code 0_0001 to resolve any suberrors associated with the transfer instrument. Requested verification codes can only be used in your test environment. @@ -189,6 +198,7 @@ func (r TransferInstrumentsApiUpdateTransferInstrumentInput) TransferInstrumentI return r } + /* Prepare a request for UpdateTransferInstrument @param id The unique identifier of the transfer instrument. @@ -210,24 +220,26 @@ Updates a transfer instrument. @return TransferInstrument, *http.Response, error */ func (a *TransferInstrumentsApi) UpdateTransferInstrument(ctx context.Context, r TransferInstrumentsApiUpdateTransferInstrumentInput) (TransferInstrument, *http.Response, error) { - res := &TransferInstrument{} + res := &TransferInstrument{} path := "/transferInstruments/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.xRequestedVerificationCode != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transferInstrumentInfo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.xRequestedVerificationCode != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "x-requested-verification-code", r.xRequestedVerificationCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferInstrumentInfo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/legalentity/client.go b/src/legalentity/client.go index 7a6da1508..737bb5fd7 100644 --- a/src/legalentity/client.go +++ b/src/legalentity/client.go @@ -39,7 +39,7 @@ func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} c.common.Client = client c.common.BasePath = func() string { - return client.Cfg.LegalEntityEndpoint + return client.Cfg.LegalEntityManagementEndpoint } // API Services diff --git a/src/legalentity/model_accept_terms_of_service_request.go b/src/legalentity/model_accept_terms_of_service_request.go index eb7584e99..317365ca2 100644 --- a/src/legalentity/model_accept_terms_of_service_request.go +++ b/src/legalentity/model_accept_terms_of_service_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcceptTermsOfServiceRequest type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *AcceptTermsOfServiceRequest) SetIpAddress(v string) { } func (o AcceptTermsOfServiceRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableAcceptTermsOfServiceRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 8f8245435..32c093c3f 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcceptTermsOfServiceResponse type satisfies the MappedNullable interface at compile time @@ -29,7 +28,7 @@ type AcceptTermsOfServiceResponse struct { Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` - // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } @@ -243,7 +242,7 @@ func (o *AcceptTermsOfServiceResponse) SetType(v string) { } func (o AcceptTermsOfServiceResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableAcceptTermsOfServiceResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcceptTermsOfServiceResponse) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_additional_bank_identification.go b/src/legalentity/model_additional_bank_identification.go index f7ed77205..5be8c5b6b 100644 --- a/src/legalentity/model_additional_bank_identification.go +++ b/src/legalentity/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_address.go b/src/legalentity/model_address.go index 2ed2a6684..b0c78f664 100644 --- a/src/legalentity/model_address.go +++ b/src/legalentity/model_address.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *Address) SetStreet2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_amount.go b/src/legalentity/model_amount.go index ab19d2045..8b7d19e83 100644 --- a/src/legalentity/model_amount.go +++ b/src/legalentity/model_amount.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_attachment.go b/src/legalentity/model_attachment.go index c89d227eb..c3f717a47 100644 --- a/src/legalentity/model_attachment.go +++ b/src/legalentity/model_attachment.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Attachment type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &Attachment{} type Attachment struct { // The document in Base64-encoded string format. Content string `json:"content"` - // The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. + // The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. // Deprecated ContentType *string `json:"contentType,omitempty"` // The name of the file including the file extension. @@ -210,7 +209,7 @@ func (o *Attachment) SetPageType(v string) { } func (o Attachment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableAttachment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_au_local_account_identification.go b/src/legalentity/model_au_local_account_identification.go index 494b64386..39ebac05f 100644 --- a/src/legalentity/model_au_local_account_identification.go +++ b/src/legalentity/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_bank_account_info.go b/src/legalentity/model_bank_account_info.go index 923d097dd..54f41fc99 100644 --- a/src/legalentity/model_bank_account_info.go +++ b/src/legalentity/model_bank_account_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccountInfo type satisfies the MappedNullable interface at compile time @@ -212,7 +211,7 @@ func (o *BankAccountInfo) SetTrustedSource(v bool) { } func (o BankAccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -274,3 +273,6 @@ func (v *NullableBankAccountInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_bank_account_info_account_identification.go b/src/legalentity/model_bank_account_info_account_identification.go index 6d0f54e95..0c7d285c5 100644 --- a/src/legalentity/model_bank_account_info_account_identification.go +++ b/src/legalentity/model_bank_account_info_account_identification.go @@ -10,26 +10,27 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // BankAccountInfoAccountIdentification - Identification of the bank account. type BankAccountInfoAccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HKLocalAccountIdentification *HKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification - NZLocalAccountIdentification *NZLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountInfoAccountIdentification @@ -137,6 +138,7 @@ func USLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *USLoc } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -147,7 +149,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -160,7 +162,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -173,7 +175,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -186,7 +188,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -199,7 +201,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct dst.HKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -212,7 +214,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -225,7 +227,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -238,7 +240,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -251,7 +253,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct dst.NZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -264,7 +266,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -277,7 +279,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -290,7 +292,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -303,7 +305,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -316,7 +318,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -329,7 +331,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -428,7 +430,7 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountInfoAccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -531,3 +533,5 @@ func (v *NullableBankAccountInfoAccountIdentification) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/legalentity/model_birth_data.go b/src/legalentity/model_birth_data.go index 9516dd21a..372b9e0ce 100644 --- a/src/legalentity/model_birth_data.go +++ b/src/legalentity/model_birth_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BirthData type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BirthData) SetDateOfBirth(v string) { } func (o BirthData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBirthData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_business_line.go b/src/legalentity/model_business_line.go index 4b51b4d24..b63c859ea 100644 --- a/src/legalentity/model_business_line.go +++ b/src/legalentity/model_business_line.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BusinessLine type satisfies the MappedNullable interface at compile time @@ -32,11 +31,11 @@ type BusinessLine struct { Problems []CapabilityProblem `json:"problems,omitempty"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** - Service string `json:"service"` + // The service for which you are creating the business line. Possible values: * **paymentProcessing** * **banking** + Service string `json:"service"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -353,7 +352,7 @@ func (o *BusinessLine) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLine) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -423,21 +422,23 @@ func (v *NullableBusinessLine) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BusinessLine) isValidCapability() bool { - var allowedEnumValues = []string{"receivePayments", "receiveFromPlatformPayments", "issueBankAccount"} - for _, allowed := range allowedEnumValues { - if o.GetCapability() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false } func (o *BusinessLine) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_line_info.go b/src/legalentity/model_business_line_info.go index ea55d149e..138996d9d 100644 --- a/src/legalentity/model_business_line_info.go +++ b/src/legalentity/model_business_line_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BusinessLineInfo type satisfies the MappedNullable interface at compile time @@ -28,11 +27,11 @@ type BusinessLineInfo struct { LegalEntityId string `json:"legalEntityId"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** - Service string `json:"service"` + // The service for which you are creating the business line. Possible values: * **paymentProcessing** * **banking** + Service string `json:"service"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -292,7 +291,7 @@ func (o *BusinessLineInfo) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLineInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -358,21 +357,23 @@ func (v *NullableBusinessLineInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BusinessLineInfo) isValidCapability() bool { - var allowedEnumValues = []string{"receivePayments", "receiveFromPlatformPayments", "issueBankAccount"} - for _, allowed := range allowedEnumValues { - if o.GetCapability() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false } func (o *BusinessLineInfo) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_line_info_update.go b/src/legalentity/model_business_line_info_update.go index 790c3c3e7..98e450abd 100644 --- a/src/legalentity/model_business_line_info_update.go +++ b/src/legalentity/model_business_line_info_update.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BusinessLineInfoUpdate type satisfies the MappedNullable interface at compile time @@ -28,11 +27,11 @@ type BusinessLineInfoUpdate struct { LegalEntityId *string `json:"legalEntityId,omitempty"` // A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. SalesChannels []string `json:"salesChannels,omitempty"` - // The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** - Service *string `json:"service,omitempty"` + // The service for which you are creating the business line. Possible values: * **paymentProcessing** * **banking** + Service *string `json:"service,omitempty"` SourceOfFunds *SourceOfFunds `json:"sourceOfFunds,omitempty"` // List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. - WebData []WebData `json:"webData,omitempty"` + WebData []WebData `json:"webData,omitempty"` WebDataExemption *WebDataExemption `json:"webDataExemption,omitempty"` } @@ -313,7 +312,7 @@ func (o *BusinessLineInfoUpdate) SetWebDataExemption(v WebDataExemption) { } func (o BusinessLineInfoUpdate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -385,21 +384,23 @@ func (v *NullableBusinessLineInfoUpdate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BusinessLineInfoUpdate) isValidCapability() bool { - var allowedEnumValues = []string{"receivePayments", "receiveFromPlatformPayments", "issueBankAccount"} - for _, allowed := range allowedEnumValues { - if o.GetCapability() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "receivePayments", "receiveFromPlatformPayments", "issueBankAccount" } + for _, allowed := range allowedEnumValues { + if o.GetCapability() == allowed { + return true + } + } + return false } func (o *BusinessLineInfoUpdate) isValidService() bool { - var allowedEnumValues = []string{"paymentProcessing", "issuing", "banking"} - for _, allowed := range allowedEnumValues { - if o.GetService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentProcessing", "banking" } + for _, allowed := range allowedEnumValues { + if o.GetService() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_business_lines.go b/src/legalentity/model_business_lines.go index 9d7fbc185..60885e3d5 100644 --- a/src/legalentity/model_business_lines.go +++ b/src/legalentity/model_business_lines.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BusinessLines type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *BusinessLines) SetBusinessLines(v []BusinessLine) { } func (o BusinessLines) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableBusinessLines) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_ca_local_account_identification.go b/src/legalentity/model_ca_local_account_identification.go index 087c30e2b..6812e0a30 100644 --- a/src/legalentity/model_ca_local_account_identification.go +++ b/src/legalentity/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_calculate_terms_of_service_status_response.go b/src/legalentity/model_calculate_terms_of_service_status_response.go index ededf8b8c..07a685c12 100644 --- a/src/legalentity/model_calculate_terms_of_service_status_response.go +++ b/src/legalentity/model_calculate_terms_of_service_status_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CalculateTermsOfServiceStatusResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CalculateTermsOfServiceStatusResponse) SetTermsOfServiceTypes(v []strin } func (o CalculateTermsOfServiceStatusResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCalculateTermsOfServiceStatusResponse) UnmarshalJSON(src []byte v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_capability_problem.go b/src/legalentity/model_capability_problem.go index af252d49b..7b0b1710b 100644 --- a/src/legalentity/model_capability_problem.go +++ b/src/legalentity/model_capability_problem.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblem type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &CapabilityProblem{} // CapabilityProblem struct for CapabilityProblem type CapabilityProblem struct { - Entity *CapabilityProblemEntity `json:"entity,omitempty"` - VerificationErrors []VerificationError `json:"verificationErrors,omitempty"` + Entity *CapabilityProblemEntity `json:"entity,omitempty"` + VerificationErrors []VerificationError `json:"verificationErrors,omitempty"` } // NewCapabilityProblem instantiates a new CapabilityProblem object @@ -105,7 +104,7 @@ func (o *CapabilityProblem) SetVerificationErrors(v []VerificationError) { } func (o CapabilityProblem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableCapabilityProblem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_capability_problem_entity.go b/src/legalentity/model_capability_problem_entity.go index 5ea4935fe..d2c0a1c80 100644 --- a/src/legalentity/model_capability_problem_entity.go +++ b/src/legalentity/model_capability_problem_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntity type satisfies the MappedNullable interface at compile time @@ -20,10 +19,10 @@ var _ common.MappedNullable = &CapabilityProblemEntity{} // CapabilityProblemEntity struct for CapabilityProblemEntity type CapabilityProblemEntity struct { // List of document IDs corresponding to the verification errors from capabilities. - Documents []string `json:"documents,omitempty"` - Id *string `json:"id,omitempty"` - Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` - Type *string `json:"type,omitempty"` + Documents []string `json:"documents,omitempty"` + Id *string `json:"id,omitempty"` + Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` + Type *string `json:"type,omitempty"` } // NewCapabilityProblemEntity instantiates a new CapabilityProblemEntity object @@ -172,7 +171,7 @@ func (o *CapabilityProblemEntity) SetType(v string) { } func (o CapabilityProblemEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,12 +231,14 @@ func (v *NullableCapabilityProblemEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntity) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity", "product"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity", "product" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_capability_problem_entity_recursive.go b/src/legalentity/model_capability_problem_entity_recursive.go index 964f41ee7..e1b6d1fda 100644 --- a/src/legalentity/model_capability_problem_entity_recursive.go +++ b/src/legalentity/model_capability_problem_entity_recursive.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntityRecursive type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &CapabilityProblemEntityRecursive{} type CapabilityProblemEntityRecursive struct { // List of document IDs corresponding to the verification errors from capabilities. Documents []string `json:"documents,omitempty"` - Id *string `json:"id,omitempty"` - Type *string `json:"type,omitempty"` + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` } // NewCapabilityProblemEntityRecursive instantiates a new CapabilityProblemEntityRecursive object @@ -139,7 +138,7 @@ func (o *CapabilityProblemEntityRecursive) SetType(v string) { } func (o CapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,12 +195,14 @@ func (v *NullableCapabilityProblemEntityRecursive) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntityRecursive) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity", "product"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity", "product" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_capability_settings.go b/src/legalentity/model_capability_settings.go index cd0aed56f..2de954d79 100644 --- a/src/legalentity/model_capability_settings.go +++ b/src/legalentity/model_capability_settings.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilitySettings type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type CapabilitySettings struct { // The funding source of the card, for example **debit**. FundingSource []string `json:"fundingSource,omitempty"` // The period when the rule conditions apply. - Interval *string `json:"interval,omitempty"` + Interval *string `json:"interval,omitempty"` MaxAmount *Amount `json:"maxAmount,omitempty"` } @@ -208,7 +207,7 @@ func (o *CapabilitySettings) SetMaxAmount(v Amount) { } func (o CapabilitySettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableCapabilitySettings) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilitySettings) isValidInterval() bool { - var allowedEnumValues = []string{"daily", "monthly", "weekly"} - for _, allowed := range allowedEnumValues { - if o.GetInterval() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "daily", "monthly", "weekly" } + for _, allowed := range allowedEnumValues { + if o.GetInterval() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_cz_local_account_identification.go b/src/legalentity/model_cz_local_account_identification.go index 6d0dd21e7..9814f5725 100644 --- a/src/legalentity/model_cz_local_account_identification.go +++ b/src/legalentity/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_data_review_confirmation_response.go b/src/legalentity/model_data_review_confirmation_response.go new file mode 100644 index 000000000..cf3a119d4 --- /dev/null +++ b/src/legalentity/model_data_review_confirmation_response.go @@ -0,0 +1,127 @@ +/* +Legal Entity Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package legalentity + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the DataReviewConfirmationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &DataReviewConfirmationResponse{} + +// DataReviewConfirmationResponse struct for DataReviewConfirmationResponse +type DataReviewConfirmationResponse struct { + // Date when data review was confirmed. + DataReviewedAt *string `json:"dataReviewedAt,omitempty"` +} + +// NewDataReviewConfirmationResponse instantiates a new DataReviewConfirmationResponse 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 NewDataReviewConfirmationResponse() *DataReviewConfirmationResponse { + this := DataReviewConfirmationResponse{} + return &this +} + +// NewDataReviewConfirmationResponseWithDefaults instantiates a new DataReviewConfirmationResponse 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 NewDataReviewConfirmationResponseWithDefaults() *DataReviewConfirmationResponse { + this := DataReviewConfirmationResponse{} + return &this +} + +// GetDataReviewedAt returns the DataReviewedAt field value if set, zero value otherwise. +func (o *DataReviewConfirmationResponse) GetDataReviewedAt() string { + if o == nil || common.IsNil(o.DataReviewedAt) { + var ret string + return ret + } + return *o.DataReviewedAt +} + +// GetDataReviewedAtOk returns a tuple with the DataReviewedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataReviewConfirmationResponse) GetDataReviewedAtOk() (*string, bool) { + if o == nil || common.IsNil(o.DataReviewedAt) { + return nil, false + } + return o.DataReviewedAt, true +} + +// HasDataReviewedAt returns a boolean if a field has been set. +func (o *DataReviewConfirmationResponse) HasDataReviewedAt() bool { + if o != nil && !common.IsNil(o.DataReviewedAt) { + return true + } + + return false +} + +// SetDataReviewedAt gets a reference to the given string and assigns it to the DataReviewedAt field. +func (o *DataReviewConfirmationResponse) SetDataReviewedAt(v string) { + o.DataReviewedAt = &v +} + +func (o DataReviewConfirmationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataReviewConfirmationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.DataReviewedAt) { + toSerialize["dataReviewedAt"] = o.DataReviewedAt + } + return toSerialize, nil +} + +type NullableDataReviewConfirmationResponse struct { + value *DataReviewConfirmationResponse + isSet bool +} + +func (v NullableDataReviewConfirmationResponse) Get() *DataReviewConfirmationResponse { + return v.value +} + +func (v *NullableDataReviewConfirmationResponse) Set(val *DataReviewConfirmationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDataReviewConfirmationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDataReviewConfirmationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataReviewConfirmationResponse(val *DataReviewConfirmationResponse) *NullableDataReviewConfirmationResponse { + return &NullableDataReviewConfirmationResponse{value: val, isSet: true} +} + +func (v NullableDataReviewConfirmationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataReviewConfirmationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/legalentity/model_dk_local_account_identification.go b/src/legalentity/model_dk_local_account_identification.go index cade03b85..29ba6a63d 100644 --- a/src/legalentity/model_dk_local_account_identification.go +++ b/src/legalentity/model_dk_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *DKLocalAccountIdentification) SetType(v string) { } func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"dkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_document.go b/src/legalentity/model_document.go index d1c45f0e9..ab86488c1 100644 --- a/src/legalentity/model_document.go +++ b/src/legalentity/model_document.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Document type satisfies the MappedNullable interface at compile time @@ -43,8 +42,8 @@ type Document struct { // The modification date of the document. ModificationDate *time.Time `json:"modificationDate,omitempty"` // The number in the document. - Number *string `json:"number,omitempty"` - Owner *OwnerEntity `json:"owner,omitempty"` + Number *string `json:"number,omitempty"` + Owner *OwnerEntity `json:"owner,omitempty"` // Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). Type string `json:"type"` } @@ -478,7 +477,7 @@ func (o *Document) SetType(v string) { } func (o Document) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -561,12 +560,14 @@ func (v *NullableDocument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Document) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_document_page.go b/src/legalentity/model_document_page.go index 68570e3c1..0b7a1c399 100644 --- a/src/legalentity/model_document_page.go +++ b/src/legalentity/model_document_page.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DocumentPage type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &DocumentPage{} // DocumentPage struct for DocumentPage type DocumentPage struct { - PageName *string `json:"pageName,omitempty"` - PageNumber *int32 `json:"pageNumber,omitempty"` - Type *string `json:"type,omitempty"` + PageName *string `json:"pageName,omitempty"` + PageNumber *int32 `json:"pageNumber,omitempty"` + Type *string `json:"type,omitempty"` } // NewDocumentPage instantiates a new DocumentPage object @@ -138,7 +137,7 @@ func (o *DocumentPage) SetType(v string) { } func (o DocumentPage) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,12 +194,14 @@ func (v *NullableDocumentPage) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DocumentPage) isValidType() bool { - var allowedEnumValues = []string{"BACK", "FRONT", "UNDEFINED"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BACK", "FRONT", "UNDEFINED" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_document_reference.go b/src/legalentity/model_document_reference.go index 96707d96a..98d3cf6fd 100644 --- a/src/legalentity/model_document_reference.go +++ b/src/legalentity/model_document_reference.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DocumentReference type satisfies the MappedNullable interface at compile time @@ -278,7 +277,7 @@ func (o *DocumentReference) SetType(v string) { } func (o DocumentReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -346,3 +345,6 @@ func (v *NullableDocumentReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_entity_reference.go b/src/legalentity/model_entity_reference.go index d285bda17..1425aeb79 100644 --- a/src/legalentity/model_entity_reference.go +++ b/src/legalentity/model_entity_reference.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the EntityReference type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *EntityReference) SetId(v string) { } func (o EntityReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableEntityReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index 2ce0ced2f..8df559058 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GeneratePciDescriptionRequest type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &GeneratePciDescriptionRequest{} // GeneratePciDescriptionRequest struct for GeneratePciDescriptionRequest type GeneratePciDescriptionRequest struct { - // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) before you generate the questionnaires. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** + // An array of additional sales channels to generate PCI questionnaires. Include the relevant sales channels if you need your user to sign PCI questionnaires. Not required if you [create stores](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/create-stores/) and [add payment methods](https://docs.adyen.com/marketplaces-and-platforms/payment-methods/) before you generate the questionnaires. Possible values: * **eCommerce** * **pos** * **ecomMoto** * **posMoto** AdditionalSalesChannels []string `json:"additionalSalesChannels,omitempty"` // Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. Language *string `json:"language,omitempty"` @@ -107,7 +106,7 @@ func (o *GeneratePciDescriptionRequest) SetLanguage(v string) { } func (o GeneratePciDescriptionRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableGeneratePciDescriptionRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_generate_pci_description_response.go b/src/legalentity/model_generate_pci_description_response.go index b8f26c439..9006e8a78 100644 --- a/src/legalentity/model_generate_pci_description_response.go +++ b/src/legalentity/model_generate_pci_description_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GeneratePciDescriptionResponse type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *GeneratePciDescriptionResponse) SetPciTemplateReferences(v []string) { } func (o GeneratePciDescriptionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableGeneratePciDescriptionResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_pci_questionnaire_infos_response.go b/src/legalentity/model_get_pci_questionnaire_infos_response.go index 07dcc7825..5f58b0717 100644 --- a/src/legalentity/model_get_pci_questionnaire_infos_response.go +++ b/src/legalentity/model_get_pci_questionnaire_infos_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetPciQuestionnaireInfosResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetPciQuestionnaireInfosResponse) SetData(v []PciDocumentInfo) { } func (o GetPciQuestionnaireInfosResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetPciQuestionnaireInfosResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_pci_questionnaire_response.go b/src/legalentity/model_get_pci_questionnaire_response.go index 10eee4f3b..bb2f69425 100644 --- a/src/legalentity/model_get_pci_questionnaire_response.go +++ b/src/legalentity/model_get_pci_questionnaire_response.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetPciQuestionnaireResponse type satisfies the MappedNullable interface at compile time @@ -176,7 +175,7 @@ func (o *GetPciQuestionnaireResponse) SetValidUntil(v time.Time) { } func (o GetPciQuestionnaireResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableGetPciQuestionnaireResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go b/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go index e354fef16..1a24e8730 100644 --- a/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go +++ b/src/legalentity/model_get_terms_of_service_acceptance_infos_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTermsOfServiceAcceptanceInfosResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetTermsOfServiceAcceptanceInfosResponse) SetData(v []TermsOfServiceAcc } func (o GetTermsOfServiceAcceptanceInfosResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetTermsOfServiceAcceptanceInfosResponse) UnmarshalJSON(src []b v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_get_terms_of_service_document_request.go b/src/legalentity/model_get_terms_of_service_document_request.go index a283a7cd2..237b29503 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTermsOfServiceDocumentRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &GetTermsOfServiceDocumentRequest{} type GetTermsOfServiceDocumentRequest struct { // The language to be used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. Language string `json:"language"` - // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type string `json:"type"` } @@ -93,7 +92,7 @@ func (o *GetTermsOfServiceDocumentRequest) SetType(v string) { } func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -143,12 +142,14 @@ func (v *NullableGetTermsOfServiceDocumentRequest) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *GetTermsOfServiceDocumentRequest) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_get_terms_of_service_document_response.go b/src/legalentity/model_get_terms_of_service_document_response.go index 938297761..6f58593ce 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTermsOfServiceDocumentResponse type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type GetTermsOfServiceDocumentResponse struct { Language *string `json:"language,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` - // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } @@ -209,7 +208,7 @@ func (o *GetTermsOfServiceDocumentResponse) SetType(v string) { } func (o GetTermsOfServiceDocumentResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableGetTermsOfServiceDocumentResponse) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *GetTermsOfServiceDocumentResponse) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_hk_local_account_identification.go b/src/legalentity/model_hk_local_account_identification.go index af026b211..4df5f6c58 100644 --- a/src/legalentity/model_hk_local_account_identification.go +++ b/src/legalentity/model_hk_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *HKLocalAccountIdentification) SetType(v string) { } func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableHKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"hkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "hkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_hu_local_account_identification.go b/src/legalentity/model_hu_local_account_identification.go index f685e3908..89bf92077 100644 --- a/src/legalentity/model_hu_local_account_identification.go +++ b/src/legalentity/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_iban_account_identification.go b/src/legalentity/model_iban_account_identification.go index 5d4b944f0..b6d2aefcc 100644 --- a/src/legalentity/model_iban_account_identification.go +++ b/src/legalentity/model_iban_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index c5d243a39..49ff619b8 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IdentificationData type satisfies the MappedNullable interface at compile time @@ -274,7 +273,7 @@ func (o *IdentificationData) SetType(v string) { } func (o IdentificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -341,12 +340,14 @@ func (v *NullableIdentificationData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IdentificationData) isValidType() bool { - var allowedEnumValues = []string{"nationalIdNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nationalIdNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_individual.go b/src/legalentity/model_individual.go index b94132f77..6fa283de1 100644 --- a/src/legalentity/model_individual.go +++ b/src/legalentity/model_individual.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Individual type satisfies the MappedNullable interface at compile time @@ -21,16 +20,16 @@ var _ common.MappedNullable = &Individual{} type Individual struct { BirthData *BirthData `json:"birthData,omitempty"` // The email address of the legal entity. - Email *string `json:"email,omitempty"` + Email *string `json:"email,omitempty"` IdentificationData *IdentificationData `json:"identificationData,omitempty"` - Name Name `json:"name"` + Name Name `json:"name"` // The individual's nationality. - Nationality *string `json:"nationality,omitempty"` - Phone *PhoneNumber `json:"phone,omitempty"` - ResidentialAddress Address `json:"residentialAddress"` + Nationality *string `json:"nationality,omitempty"` + Phone *PhoneNumber `json:"phone,omitempty"` + ResidentialAddress Address `json:"residentialAddress"` // The tax information of the individual. TaxInformation []TaxInformation `json:"taxInformation,omitempty"` - WebData *WebData `json:"webData,omitempty"` + WebData *WebData `json:"webData,omitempty"` } // NewIndividual instantiates a new Individual object @@ -325,7 +324,7 @@ func (o *Individual) SetWebData(v WebData) { } func (o Individual) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -395,3 +394,6 @@ func (v *NullableIndividual) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index c360dc7b5..8322dad74 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LegalEntity type satisfies the MappedNullable interface at compile time @@ -29,19 +28,19 @@ type LegalEntity struct { // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` // The unique identifier of the legal entity. - Id string `json:"id"` - Individual *Individual `json:"individual,omitempty"` + Id string `json:"id"` + Individual *Individual `json:"individual,omitempty"` Organization *Organization `json:"organization,omitempty"` // List of verification errors related to capabilities for the legal entity. Problems []CapabilityProblem `json:"problems,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` // List of transfer instruments that the legal entity owns. TransferInstruments []TransferInstrumentReference `json:"transferInstruments,omitempty"` - Trust *Trust `json:"trust,omitempty"` + Trust *Trust `json:"trust,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` UnincorporatedPartnership *UnincorporatedPartnership `json:"unincorporatedPartnership,omitempty"` // List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. VerificationDeadlines []VerificationDeadline `json:"verificationDeadlines,omitempty"` @@ -541,7 +540,7 @@ func (o *LegalEntity) SetVerificationDeadlines(v []VerificationDeadline) { } func (o LegalEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -632,12 +631,14 @@ func (v *NullableLegalEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntity) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_association.go b/src/legalentity/model_legal_entity_association.go index d17762667..efc598896 100644 --- a/src/legalentity/model_legal_entity_association.go +++ b/src/legalentity/model_legal_entity_association.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LegalEntityAssociation type satisfies the MappedNullable interface at compile time @@ -263,7 +262,7 @@ func (o *LegalEntityAssociation) SetType(v string) { } func (o LegalEntityAssociation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -328,12 +327,14 @@ func (v *NullableLegalEntityAssociation) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityAssociation) isValidType() bool { - var allowedEnumValues = []string{"definedBeneficiary", "director", "pciSignatory", "protector", "secondaryTrustee", "settlor", "signatory", "soleProprietorship", "trust", "trustOwnership", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany", "undefinedBeneficiary"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "definedBeneficiary", "director", "pciSignatory", "protector", "secondaryTrustee", "settlor", "signatory", "soleProprietorship", "trust", "trustOwnership", "uboThroughControl", "uboThroughOwnership", "ultimateParentCompany", "undefinedBeneficiary" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_capability.go b/src/legalentity/model_legal_entity_capability.go index 92e0c15c5..0df355011 100644 --- a/src/legalentity/model_legal_entity_capability.go +++ b/src/legalentity/model_legal_entity_capability.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LegalEntityCapability type satisfies the MappedNullable interface at compile time @@ -22,16 +21,16 @@ type LegalEntityCapability struct { // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful. Allowed *bool `json:"allowed,omitempty"` // The capability level that is allowed for the legal entity. Possible values: **notApplicable**, **low**, **medium**, **high**. - AllowedLevel *string `json:"allowedLevel,omitempty"` + AllowedLevel *string `json:"allowedLevel,omitempty"` AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` // Indicates whether the capability is requested. To check whether the legal entity is permitted to use the capability, refer to the `allowed` field. Requested *bool `json:"requested,omitempty"` // The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. - RequestedLevel *string `json:"requestedLevel,omitempty"` + RequestedLevel *string `json:"requestedLevel,omitempty"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` // The capability status of transfer instruments associated with the legal entity. TransferInstruments []SupportingEntityCapability `json:"transferInstruments,omitempty"` - // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -309,7 +308,7 @@ func (o *LegalEntityCapability) SetVerificationStatus(v string) { } func (o LegalEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,21 +380,23 @@ func (v *NullableLegalEntityCapability) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityCapability) isValidAllowedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetAllowedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetAllowedLevel() == allowed { + return true + } + } + return false } func (o *LegalEntityCapability) isValidRequestedLevel() bool { - var allowedEnumValues = []string{"high", "low", "medium", "notApplicable"} - for _, allowed := range allowedEnumValues { - if o.GetRequestedLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "high", "low", "medium", "notApplicable" } + for _, allowed := range allowedEnumValues { + if o.GetRequestedLevel() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_info.go b/src/legalentity/model_legal_entity_info.go index 51665ea6a..4d494f231 100644 --- a/src/legalentity/model_legal_entity_info.go +++ b/src/legalentity/model_legal_entity_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LegalEntityInfo type satisfies the MappedNullable interface at compile time @@ -23,14 +22,14 @@ type LegalEntityInfo struct { Capabilities *map[string]LegalEntityCapability `json:"capabilities,omitempty"` // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` - Individual *Individual `json:"individual,omitempty"` - Organization *Organization `json:"organization,omitempty"` + Individual *Individual `json:"individual,omitempty"` + Organization *Organization `json:"organization,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` - Trust *Trust `json:"trust,omitempty"` + Trust *Trust `json:"trust,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` UnincorporatedPartnership *UnincorporatedPartnership `json:"unincorporatedPartnership,omitempty"` } @@ -340,7 +339,7 @@ func (o *LegalEntityInfo) SetUnincorporatedPartnership(v UnincorporatedPartnersh } func (o LegalEntityInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -415,12 +414,14 @@ func (v *NullableLegalEntityInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityInfo) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_legal_entity_info_required_type.go b/src/legalentity/model_legal_entity_info_required_type.go index 5aa9b33bf..0849e9a9d 100644 --- a/src/legalentity/model_legal_entity_info_required_type.go +++ b/src/legalentity/model_legal_entity_info_required_type.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LegalEntityInfoRequiredType type satisfies the MappedNullable interface at compile time @@ -23,14 +22,14 @@ type LegalEntityInfoRequiredType struct { Capabilities *map[string]LegalEntityCapability `json:"capabilities,omitempty"` // List of legal entities associated with the current legal entity. For example, ultimate beneficial owners associated with an organization through ownership or control, or as signatories. EntityAssociations []LegalEntityAssociation `json:"entityAssociations,omitempty"` - Individual *Individual `json:"individual,omitempty"` - Organization *Organization `json:"organization,omitempty"` + Individual *Individual `json:"individual,omitempty"` + Organization *Organization `json:"organization,omitempty"` // Your reference for the legal entity, maximum 150 characters. - Reference *string `json:"reference,omitempty"` + Reference *string `json:"reference,omitempty"` SoleProprietorship *SoleProprietorship `json:"soleProprietorship,omitempty"` - Trust *Trust `json:"trust,omitempty"` + Trust *Trust `json:"trust,omitempty"` // The type of legal entity. Possible values: **individual**, **organization**, **soleProprietorship**, or **trust**. - Type string `json:"type"` + Type string `json:"type"` UnincorporatedPartnership *UnincorporatedPartnership `json:"unincorporatedPartnership,omitempty"` } @@ -333,7 +332,7 @@ func (o *LegalEntityInfoRequiredType) SetUnincorporatedPartnership(v Unincorpora } func (o LegalEntityInfoRequiredType) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -406,12 +405,14 @@ func (v *NullableLegalEntityInfoRequiredType) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *LegalEntityInfoRequiredType) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "soleProprietorship", "trust", "unincorporatedPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_name.go b/src/legalentity/model_name.go index f1c69d1a1..63aaa2f5f 100644 --- a/src/legalentity/model_name.go +++ b/src/legalentity/model_name.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_no_local_account_identification.go b/src/legalentity/model_no_local_account_identification.go index 43b0c0e15..783fa881b 100644 --- a/src/legalentity/model_no_local_account_identification.go +++ b/src/legalentity/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_number_and_bic_account_identification.go b/src/legalentity/model_number_and_bic_account_identification.go index 5d32fe11a..190a90489 100644 --- a/src/legalentity/model_number_and_bic_account_identification.go +++ b/src/legalentity/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_nz_local_account_identification.go b/src/legalentity/model_nz_local_account_identification.go index 28da05b01..f3b05c174 100644 --- a/src/legalentity/model_nz_local_account_identification.go +++ b/src/legalentity/model_nz_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NZLocalAccountIdentification) SetType(v string) { } func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"nzLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nzLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_onboarding_link.go b/src/legalentity/model_onboarding_link.go index 9ba70e669..2a683f076 100644 --- a/src/legalentity/model_onboarding_link.go +++ b/src/legalentity/model_onboarding_link.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OnboardingLink type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *OnboardingLink) SetUrl(v string) { } func (o OnboardingLink) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableOnboardingLink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_link_info.go b/src/legalentity/model_onboarding_link_info.go index e0cecf57b..fac750b2b 100644 --- a/src/legalentity/model_onboarding_link_info.go +++ b/src/legalentity/model_onboarding_link_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OnboardingLinkInfo type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type OnboardingLinkInfo struct { Locale *string `json:"locale,omitempty"` // The URL where the user is redirected after they complete hosted onboarding. RedirectUrl *string `json:"redirectUrl,omitempty"` - // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, these values are set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. By default, these value are set to **false**. Set the following values to **true** to require the user to sign PCI questionnaires based on their sales channels. The user must sign PCI questionnaires for all relevant sales channels. - **requirePciSignEcommerce** - **requirePciSignPos** - **requirePciSignEcomMoto** - **requirePciSignPosMoto** + // Boolean key-value pairs indicating the settings for the hosted onboarding page. The keys are the settings. Possible keys: By default, these values are set to **true**. Set to **false** to not allow the action. - **changeLegalEntityType**: The user can change their legal entity type. - **editPrefilledCountry**: The user can change the country of their legal entity's address, for example the registered address of an organization. By default, these values are set to **false**. Set to **true** to allow the action. - **allowBankAccountFormatSelection**: The user can select the format for their payout account if applicable. - **allowIntraRegionCrossBorderPayout**: The user can select a payout account in a different EU/EEA country than the country of their legal entity. By default, these value are set to **false**. Set the following values to **true** to require the user to sign PCI questionnaires based on their sales channels. The user must sign PCI questionnaires for all relevant sales channels. - **requirePciSignEcommerce** - **requirePciSignPos** - **requirePciSignEcomMoto** - **requirePciSignPosMoto** Settings *map[string]bool `json:"settings,omitempty"` // The unique identifier of the hosted onboarding theme. ThemeId *string `json:"themeId,omitempty"` @@ -175,7 +174,7 @@ func (o *OnboardingLinkInfo) SetThemeId(v string) { } func (o OnboardingLinkInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableOnboardingLinkInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_theme.go b/src/legalentity/model_onboarding_theme.go index f273940d6..427d7d699 100644 --- a/src/legalentity/model_onboarding_theme.go +++ b/src/legalentity/model_onboarding_theme.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OnboardingTheme type satisfies the MappedNullable interface at compile time @@ -189,7 +188,7 @@ func (o *OnboardingTheme) SetUpdatedAt(v time.Time) { } func (o OnboardingTheme) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -245,3 +244,6 @@ func (v *NullableOnboardingTheme) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_onboarding_themes.go b/src/legalentity/model_onboarding_themes.go index fb578a8c4..8a3cb3601 100644 --- a/src/legalentity/model_onboarding_themes.go +++ b/src/legalentity/model_onboarding_themes.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OnboardingThemes type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *OnboardingThemes) SetThemes(v []OnboardingTheme) { } func (o OnboardingThemes) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableOnboardingThemes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_organization.go b/src/legalentity/model_organization.go index b01b8a234..a96ea3bf9 100644 --- a/src/legalentity/model_organization.go +++ b/src/legalentity/model_organization.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Organization type satisfies the MappedNullable interface at compile time @@ -28,23 +27,23 @@ type Organization struct { // The email address of the legal entity. Email *string `json:"email,omitempty"` // The organization's legal name. - LegalName string `json:"legalName"` - Phone *PhoneNumber `json:"phone,omitempty"` - PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + LegalName string `json:"legalName"` + Phone *PhoneNumber `json:"phone,omitempty"` + PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` + RegisteredAddress Address `json:"registeredAddress"` // The organization's registration number. - RegistrationNumber *string `json:"registrationNumber,omitempty"` - StockData *StockData `json:"stockData,omitempty"` + RegistrationNumber *string `json:"registrationNumber,omitempty"` + StockData *StockData `json:"stockData,omitempty"` // The tax information of the organization. - TaxInformation []TaxInformation `json:"taxInformation,omitempty"` + TaxInformation []TaxInformation `json:"taxInformation,omitempty"` TaxReportingClassification *TaxReportingClassification `json:"taxReportingClassification,omitempty"` // Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. Type *string `json:"type,omitempty"` // The reason the organization has not provided a VAT number. Possible values: **industryExemption**, **belowTaxThreshold**. VatAbsenceReason *string `json:"vatAbsenceReason,omitempty"` // The organization's VAT number. - VatNumber *string `json:"vatNumber,omitempty"` - WebData *WebData `json:"webData,omitempty"` + VatNumber *string `json:"vatNumber,omitempty"` + WebData *WebData `json:"webData,omitempty"` } // NewOrganization instantiates a new Organization object @@ -563,7 +562,7 @@ func (o *Organization) SetWebData(v WebData) { } func (o Organization) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -655,21 +654,23 @@ func (v *NullableOrganization) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Organization) isValidType() bool { - var allowedEnumValues = []string{"associationIncorporated", "governmentalOrganization", "listedPublicCompany", "nonProfit", "partnershipIncorporated", "privateCompany"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "associationIncorporated", "governmentalOrganization", "listedPublicCompany", "nonProfit", "partnershipIncorporated", "privateCompany" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } func (o *Organization) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_owner_entity.go b/src/legalentity/model_owner_entity.go index 8a9276082..0ee3dddff 100644 --- a/src/legalentity/model_owner_entity.go +++ b/src/legalentity/model_owner_entity.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OwnerEntity type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *OwnerEntity) SetType(v string) { } func (o OwnerEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableOwnerEntity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_document_info.go b/src/legalentity/model_pci_document_info.go index 199037c5e..fb39ffd91 100644 --- a/src/legalentity/model_pci_document_info.go +++ b/src/legalentity/model_pci_document_info.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PciDocumentInfo type satisfies the MappedNullable interface at compile time @@ -142,7 +141,7 @@ func (o *PciDocumentInfo) SetValidUntil(v time.Time) { } func (o PciDocumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullablePciDocumentInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_signing_request.go b/src/legalentity/model_pci_signing_request.go index f000b633b..f83b56ca5 100644 --- a/src/legalentity/model_pci_signing_request.go +++ b/src/legalentity/model_pci_signing_request.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PciSigningRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *PciSigningRequest) SetSignedBy(v string) { } func (o PciSigningRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullablePciSigningRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pci_signing_response.go b/src/legalentity/model_pci_signing_response.go index c7f43b0b3..69534e253 100644 --- a/src/legalentity/model_pci_signing_response.go +++ b/src/legalentity/model_pci_signing_response.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PciSigningResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PciSigningResponse) SetSignedBy(v string) { } func (o PciSigningResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePciSigningResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_phone_number.go b/src/legalentity/model_phone_number.go index bd8eeae77..70ea07a76 100644 --- a/src/legalentity/model_phone_number.go +++ b/src/legalentity/model_phone_number.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PhoneNumber type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &PhoneNumber{} type PhoneNumber struct { // The full phone number, including the country code. For example, **+3112345678**. Number string `json:"number"` - // The type of phone number. Possible values: **mobile**, **landline**, **sip**, **fax.** + // The type of phone number. Possible values: **mobile**, **landline**, **sip**, **fax.** Type *string `json:"type,omitempty"` } @@ -100,7 +99,7 @@ func (o *PhoneNumber) SetType(v string) { } func (o PhoneNumber) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_pl_local_account_identification.go b/src/legalentity/model_pl_local_account_identification.go index 18e455ea0..037768496 100644 --- a/src/legalentity/model_pl_local_account_identification.go +++ b/src/legalentity/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_remediating_action.go b/src/legalentity/model_remediating_action.go index bb07a5ea4..2bbe7057a 100644 --- a/src/legalentity/model_remediating_action.go +++ b/src/legalentity/model_remediating_action.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RemediatingAction type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &RemediatingAction{} // RemediatingAction struct for RemediatingAction type RemediatingAction struct { - Code *string `json:"code,omitempty"` + Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` } @@ -105,7 +104,7 @@ func (o *RemediatingAction) SetMessage(v string) { } func (o RemediatingAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableRemediatingAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_se_local_account_identification.go b/src/legalentity/model_se_local_account_identification.go index 111bd87c5..57093e733 100644 --- a/src/legalentity/model_se_local_account_identification.go +++ b/src/legalentity/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_service_error.go b/src/legalentity/model_service_error.go index f8d470855..453c7994e 100644 --- a/src/legalentity/model_service_error.go +++ b/src/legalentity/model_service_error.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_sg_local_account_identification.go b/src/legalentity/model_sg_local_account_identification.go index 27e213309..c5a918bbc 100644 --- a/src/legalentity/model_sg_local_account_identification.go +++ b/src/legalentity/model_sg_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *SGLocalAccountIdentification) SetType(v string) { } func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,12 +183,14 @@ func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SGLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"sgLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_sole_proprietorship.go b/src/legalentity/model_sole_proprietorship.go index 071681ae7..1c112bbe0 100644 --- a/src/legalentity/model_sole_proprietorship.go +++ b/src/legalentity/model_sole_proprietorship.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SoleProprietorship type satisfies the MappedNullable interface at compile time @@ -23,12 +22,14 @@ type SoleProprietorship struct { CountryOfGoverningLaw string `json:"countryOfGoverningLaw"` // The date when the legal arrangement was incorporated in YYYY-MM-DD format. DateOfIncorporation *string `json:"dateOfIncorporation,omitempty"` + // Short description about the Legal Arrangement. + Description *string `json:"description,omitempty"` // The registered name, if different from the `name`. DoingBusinessAs *string `json:"doingBusinessAs,omitempty"` // The legal name. - Name string `json:"name"` + Name string `json:"name"` PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + RegisteredAddress Address `json:"registeredAddress"` // The registration number. RegistrationNumber *string `json:"registrationNumber,omitempty"` // The tax information of the entity. @@ -115,6 +116,38 @@ func (o *SoleProprietorship) SetDateOfIncorporation(v string) { o.DateOfIncorporation = &v } +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SoleProprietorship) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SoleProprietorship) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SoleProprietorship) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SoleProprietorship) SetDescription(v string) { + o.Description = &v +} + // GetDoingBusinessAs returns the DoingBusinessAs field value if set, zero value otherwise. func (o *SoleProprietorship) GetDoingBusinessAs() string { if o == nil || common.IsNil(o.DoingBusinessAs) { @@ -356,7 +389,7 @@ func (o *SoleProprietorship) SetVatNumber(v string) { } func (o SoleProprietorship) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -369,6 +402,9 @@ func (o SoleProprietorship) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DateOfIncorporation) { toSerialize["dateOfIncorporation"] = o.DateOfIncorporation } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } if !common.IsNil(o.DoingBusinessAs) { toSerialize["doingBusinessAs"] = o.DoingBusinessAs } @@ -428,12 +464,14 @@ func (v *NullableSoleProprietorship) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SoleProprietorship) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_source_of_funds.go b/src/legalentity/model_source_of_funds.go index f3bc71f32..b59cef133 100644 --- a/src/legalentity/model_source_of_funds.go +++ b/src/legalentity/model_source_of_funds.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SourceOfFunds type satisfies the MappedNullable interface at compile time @@ -179,7 +178,7 @@ func (o *SourceOfFunds) SetType(v string) { } func (o SourceOfFunds) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,12 +238,14 @@ func (v *NullableSourceOfFunds) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SourceOfFunds) isValidType() bool { - var allowedEnumValues = []string{"business"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "business" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_stock_data.go b/src/legalentity/model_stock_data.go index 3fabffc7b..847252a63 100644 --- a/src/legalentity/model_stock_data.go +++ b/src/legalentity/model_stock_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StockData type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *StockData) SetTickerSymbol(v string) { } func (o StockData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableStockData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_supporting_entity_capability.go b/src/legalentity/model_supporting_entity_capability.go index 95246967a..3cf08561a 100644 --- a/src/legalentity/model_supporting_entity_capability.go +++ b/src/legalentity/model_supporting_entity_capability.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SupportingEntityCapability type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &SupportingEntityCapability{} type SupportingEntityCapability struct { // Indicates whether the capability is allowed for the supporting entity. If a capability is allowed for a supporting entity but not for the parent legal entity, this means the legal entity has other supporting entities that failed verification. **You can use the allowed supporting entity** regardless of the verification status of other supporting entities. Allowed *bool `json:"allowed,omitempty"` - // Supporting entity reference + // Supporting entity reference Id *string `json:"id,omitempty"` - // Indicates whether the supporting entity capability is requested. + // Indicates whether the supporting entity capability is requested. Requested *bool `json:"requested,omitempty"` - // The status of the verification checks for the capability of the supporting entity. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + // The status of the verification checks for the capability of the supporting entity. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -175,7 +174,7 @@ func (o *SupportingEntityCapability) SetVerificationStatus(v string) { } func (o SupportingEntityCapability) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSupportingEntityCapability) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_tax_information.go b/src/legalentity/model_tax_information.go index 01c8eca47..b2877a724 100644 --- a/src/legalentity/model_tax_information.go +++ b/src/legalentity/model_tax_information.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TaxInformation type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *TaxInformation) SetType(v string) { } func (o TaxInformation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableTaxInformation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_tax_reporting_classification.go b/src/legalentity/model_tax_reporting_classification.go index 6ba64371a..0eb2ee86f 100644 --- a/src/legalentity/model_tax_reporting_classification.go +++ b/src/legalentity/model_tax_reporting_classification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TaxReportingClassification type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *TaxReportingClassification) SetType(v string) { } func (o TaxReportingClassification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,30 +234,32 @@ func (v *NullableTaxReportingClassification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TaxReportingClassification) isValidBusinessType() bool { - var allowedEnumValues = []string{"other", "listedPublicCompany", "subsidiaryOfListedPublicCompany", "governmentalOrganization", "internationalOrganization", "financialInstitution."} - for _, allowed := range allowedEnumValues { - if o.GetBusinessType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "other", "listedPublicCompany", "subsidiaryOfListedPublicCompany", "governmentalOrganization", "internationalOrganization", "financialInstitution." } + for _, allowed := range allowedEnumValues { + if o.GetBusinessType() == allowed { + return true + } + } + return false } func (o *TaxReportingClassification) isValidMainSourceOfIncome() bool { - var allowedEnumValues = []string{"businessOperation", "realEstateSales", "investmentInterestOrRoyalty", "propertyRental", "other"} - for _, allowed := range allowedEnumValues { - if o.GetMainSourceOfIncome() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "businessOperation", "realEstateSales", "investmentInterestOrRoyalty", "propertyRental", "other" } + for _, allowed := range allowedEnumValues { + if o.GetMainSourceOfIncome() == allowed { + return true + } + } + return false } func (o *TaxReportingClassification) isValidType() bool { - var allowedEnumValues = []string{"nonFinancialNonReportable", "financialNonReportable", "nonFinancialActive", "nonFinancialPassive"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nonFinancialNonReportable", "financialNonReportable", "nonFinancialActive", "nonFinancialPassive" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_terms_of_service_acceptance_info.go b/src/legalentity/model_terms_of_service_acceptance_info.go index 5d699144b..fe270167a 100644 --- a/src/legalentity/model_terms_of_service_acceptance_info.go +++ b/src/legalentity/model_terms_of_service_acceptance_info.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TermsOfServiceAcceptanceInfo type satisfies the MappedNullable interface at compile time @@ -28,7 +27,7 @@ type TermsOfServiceAcceptanceInfo struct { CreatedAt *time.Time `json:"createdAt,omitempty"` // An Adyen-generated reference for the accepted Terms of Service. Id *string `json:"id,omitempty"` - // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } @@ -210,7 +209,7 @@ func (o *TermsOfServiceAcceptanceInfo) SetType(v string) { } func (o TermsOfServiceAcceptanceInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,12 +272,14 @@ func (v *NullableTermsOfServiceAcceptanceInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TermsOfServiceAcceptanceInfo) isValidType() bool { - var allowedEnumValues = []string{"adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adyenAccount", "adyenCapital", "adyenCard", "adyenForPlatformsAdvanced", "adyenForPlatformsManage", "adyenFranchisee", "adyenIssuing" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument.go b/src/legalentity/model_transfer_instrument.go index 96b78cf26..de60724ed 100644 --- a/src/legalentity/model_transfer_instrument.go +++ b/src/legalentity/model_transfer_instrument.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferInstrument type satisfies the MappedNullable interface at compile time @@ -248,7 +247,7 @@ func (o *TransferInstrument) SetType(v string) { } func (o TransferInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableTransferInstrument) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInstrument) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "recurringDetail"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "recurringDetail" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument_info.go b/src/legalentity/model_transfer_instrument_info.go index b0548dcc2..7e7b5fdcd 100644 --- a/src/legalentity/model_transfer_instrument_info.go +++ b/src/legalentity/model_transfer_instrument_info.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferInstrumentInfo type satisfies the MappedNullable interface at compile time @@ -119,7 +118,7 @@ func (o *TransferInstrumentInfo) SetType(v string) { } func (o TransferInstrumentInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,12 +169,14 @@ func (v *NullableTransferInstrumentInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInstrumentInfo) isValidType() bool { - var allowedEnumValues = []string{"bankAccount", "recurringDetail"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bankAccount", "recurringDetail" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_transfer_instrument_reference.go b/src/legalentity/model_transfer_instrument_reference.go index 06156a2bf..cae0fed24 100644 --- a/src/legalentity/model_transfer_instrument_reference.go +++ b/src/legalentity/model_transfer_instrument_reference.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferInstrumentReference type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type TransferInstrumentReference struct { AccountIdentifier string `json:"accountIdentifier"` // The unique identifier of the resource. Id string `json:"id"` - // Four last digits of the bank account number. + // Four last digits of the bank account number. If the transfer instrument is created using [instant bank account verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding), and it is a virtual bank account, these digits may be different from the last four digits of the masked account number. RealLastFour *string `json:"realLastFour,omitempty"` // Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). TrustedSource *bool `json:"trustedSource,omitempty"` @@ -161,7 +160,7 @@ func (o *TransferInstrumentReference) SetTrustedSource(v bool) { } func (o TransferInstrumentReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableTransferInstrumentReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_trust.go b/src/legalentity/model_trust.go index 666c78db0..93006fdb9 100644 --- a/src/legalentity/model_trust.go +++ b/src/legalentity/model_trust.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Trust type satisfies the MappedNullable interface at compile time @@ -23,12 +22,14 @@ type Trust struct { CountryOfGoverningLaw string `json:"countryOfGoverningLaw"` // The date when the legal arrangement was incorporated in YYYY-MM-DD format. DateOfIncorporation *string `json:"dateOfIncorporation,omitempty"` + // Short description about the trust. + Description *string `json:"description,omitempty"` // The registered name, if different from the `name`. DoingBusinessAs *string `json:"doingBusinessAs,omitempty"` // The legal name. - Name string `json:"name"` + Name string `json:"name"` PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + RegisteredAddress Address `json:"registeredAddress"` // The registration number. RegistrationNumber *string `json:"registrationNumber,omitempty"` // The tax information of the entity. @@ -120,6 +121,38 @@ func (o *Trust) SetDateOfIncorporation(v string) { o.DateOfIncorporation = &v } +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Trust) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Trust) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Trust) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Trust) SetDescription(v string) { + o.Description = &v +} + // GetDoingBusinessAs returns the DoingBusinessAs field value if set, zero value otherwise. func (o *Trust) GetDoingBusinessAs() string { if o == nil || common.IsNil(o.DoingBusinessAs) { @@ -417,7 +450,7 @@ func (o *Trust) SetVatNumber(v string) { } func (o Trust) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -430,6 +463,9 @@ func (o Trust) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DateOfIncorporation) { toSerialize["dateOfIncorporation"] = o.DateOfIncorporation } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } if !common.IsNil(o.DoingBusinessAs) { toSerialize["doingBusinessAs"] = o.DoingBusinessAs } @@ -493,21 +529,23 @@ func (v *NullableTrust) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Trust) isValidType() bool { - var allowedEnumValues = []string{"cashManagementTrust", "corporateUnitTrust", "deceasedEstate", "discretionaryInvestmentTrust", "discretionaryServicesManagementTrust", "discretionaryTradingTrust", "firstHomeSaverAccountsTrust", "fixedTrust", "fixedUnitTrust", "hybridTrust", "listedPublicUnitTrust", "otherTrust", "pooledSuperannuationTrust", "publicTradingTrust", "unlistedPublicUnitTrust"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "cashManagementTrust", "corporateUnitTrust", "deceasedEstate", "discretionaryInvestmentTrust", "discretionaryServicesManagementTrust", "discretionaryTradingTrust", "firstHomeSaverAccountsTrust", "fixedTrust", "fixedUnitTrust", "hybridTrust", "listedPublicUnitTrust", "otherTrust", "pooledSuperannuationTrust", "publicTradingTrust", "unlistedPublicUnitTrust" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } func (o *Trust) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_uk_local_account_identification.go b/src/legalentity/model_uk_local_account_identification.go index ed8a3ece5..f172f27fa 100644 --- a/src/legalentity/model_uk_local_account_identification.go +++ b/src/legalentity/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_undefined_beneficiary.go b/src/legalentity/model_undefined_beneficiary.go index 3c1ce3784..6601aa087 100644 --- a/src/legalentity/model_undefined_beneficiary.go +++ b/src/legalentity/model_undefined_beneficiary.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UndefinedBeneficiary type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *UndefinedBeneficiary) SetReference(v string) { } func (o UndefinedBeneficiary) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableUndefinedBeneficiary) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_unincorporated_partnership.go b/src/legalentity/model_unincorporated_partnership.go index 5c39ecc5a..ca6edaadc 100644 --- a/src/legalentity/model_unincorporated_partnership.go +++ b/src/legalentity/model_unincorporated_partnership.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UnincorporatedPartnership type satisfies the MappedNullable interface at compile time @@ -23,12 +22,14 @@ type UnincorporatedPartnership struct { CountryOfGoverningLaw string `json:"countryOfGoverningLaw"` // The date when the legal arrangement was incorporated in YYYY-MM-DD format. DateOfIncorporation *string `json:"dateOfIncorporation,omitempty"` + // Short description about the Legal Arrangement. + Description *string `json:"description,omitempty"` // The registered name, if different from the `name`. DoingBusinessAs *string `json:"doingBusinessAs,omitempty"` // The legal name. - Name string `json:"name"` + Name string `json:"name"` PrincipalPlaceOfBusiness *Address `json:"principalPlaceOfBusiness,omitempty"` - RegisteredAddress Address `json:"registeredAddress"` + RegisteredAddress Address `json:"registeredAddress"` // The registration number. RegistrationNumber *string `json:"registrationNumber,omitempty"` // The tax information of the entity. @@ -118,6 +119,38 @@ func (o *UnincorporatedPartnership) SetDateOfIncorporation(v string) { o.DateOfIncorporation = &v } +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UnincorporatedPartnership) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UnincorporatedPartnership) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UnincorporatedPartnership) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UnincorporatedPartnership) SetDescription(v string) { + o.Description = &v +} + // GetDoingBusinessAs returns the DoingBusinessAs field value if set, zero value otherwise. func (o *UnincorporatedPartnership) GetDoingBusinessAs() string { if o == nil || common.IsNil(o.DoingBusinessAs) { @@ -383,7 +416,7 @@ func (o *UnincorporatedPartnership) SetVatNumber(v string) { } func (o UnincorporatedPartnership) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -396,6 +429,9 @@ func (o UnincorporatedPartnership) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.DateOfIncorporation) { toSerialize["dateOfIncorporation"] = o.DateOfIncorporation } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } if !common.IsNil(o.DoingBusinessAs) { toSerialize["doingBusinessAs"] = o.DoingBusinessAs } @@ -456,21 +492,23 @@ func (v *NullableUnincorporatedPartnership) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UnincorporatedPartnership) isValidType() bool { - var allowedEnumValues = []string{"limitedPartnership", "generalPartnership", "familyPartnership", "commercialPartnership", "publicPartnership", "otherPartnership", "gbr", "gmbh", "kgaa", "cv", "vof", "maatschap", "privateFundLimitedPartnership", "businessTrustEntity", "businessPartnership"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "limitedPartnership", "generalPartnership", "familyPartnership", "commercialPartnership", "publicPartnership", "otherPartnership", "gbr", "gmbh", "kgaa", "cv", "vof", "maatschap", "privateFundLimitedPartnership", "businessTrustEntity", "businessPartnership" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } func (o *UnincorporatedPartnership) isValidVatAbsenceReason() bool { - var allowedEnumValues = []string{"industryExemption", "belowTaxThreshold"} - for _, allowed := range allowedEnumValues { - if o.GetVatAbsenceReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "industryExemption", "belowTaxThreshold" } + for _, allowed := range allowedEnumValues { + if o.GetVatAbsenceReason() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_us_local_account_identification.go b/src/legalentity/model_us_local_account_identification.go index b58c2bca2..6d6472999 100644 --- a/src/legalentity/model_us_local_account_identification.go +++ b/src/legalentity/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_deadline.go b/src/legalentity/model_verification_deadline.go index 35146c696..42113db65 100644 --- a/src/legalentity/model_verification_deadline.go +++ b/src/legalentity/model_verification_deadline.go @@ -10,9 +10,8 @@ package legalentity import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationDeadline type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &VerificationDeadline{} // VerificationDeadline struct for VerificationDeadline type VerificationDeadline struct { - // The names of the capabilities to be disallowed. + // The list of capabilities that will be disallowed if information is not reviewed by the time of the deadline Capabilities []string `json:"capabilities"` // The unique identifiers of the bank account(s) that the deadline applies to EntityIds []string `json:"entityIds,omitempty"` @@ -128,7 +127,7 @@ func (o *VerificationDeadline) SetExpiresAt(v time.Time) { } func (o VerificationDeadline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,3 +179,6 @@ func (v *NullableVerificationDeadline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_verification_error.go b/src/legalentity/model_verification_error.go index 4395d0be9..014b995ee 100644 --- a/src/legalentity/model_verification_error.go +++ b/src/legalentity/model_verification_error.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *VerificationError) SetType(v string) { } func (o VerificationError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableVerificationError) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationError) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "dataReview", "invalidInput", "pendingStatus", "rejected"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "dataReview", "invalidInput", "pendingStatus", "rejected" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_error_recursive.go b/src/legalentity/model_verification_error_recursive.go index ec6f46184..24351e62f 100644 --- a/src/legalentity/model_verification_error_recursive.go +++ b/src/legalentity/model_verification_error_recursive.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationErrorRecursive type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *VerificationErrorRecursive) SetRemediatingActions(v []RemediatingAction } func (o VerificationErrorRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableVerificationErrorRecursive) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationErrorRecursive) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "dataReview", "invalidInput", "pendingStatus", "rejected"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "dataReview", "invalidInput", "pendingStatus", "rejected" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/legalentity/model_verification_errors.go b/src/legalentity/model_verification_errors.go index 06732bd36..d3be26e8f 100644 --- a/src/legalentity/model_verification_errors.go +++ b/src/legalentity/model_verification_errors.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationErrors type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *VerificationErrors) SetProblems(v []CapabilityProblem) { } func (o VerificationErrors) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableVerificationErrors) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_web_data.go b/src/legalentity/model_web_data.go index 4ccb4a0ea..7982066b8 100644 --- a/src/legalentity/model_web_data.go +++ b/src/legalentity/model_web_data.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WebData type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *WebData) SetWebAddressId(v string) { } func (o WebData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableWebData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/legalentity/model_web_data_exemption.go b/src/legalentity/model_web_data_exemption.go index 2174d83f1..5f8d9afd2 100644 --- a/src/legalentity/model_web_data_exemption.go +++ b/src/legalentity/model_web_data_exemption.go @@ -10,8 +10,7 @@ package legalentity import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WebDataExemption type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *WebDataExemption) SetReason(v string) { } func (o WebDataExemption) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableWebDataExemption) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *WebDataExemption) isValidReason() bool { - var allowedEnumValues = []string{"noOnlinePresence", "notCollectedDuringOnboarding"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noOnlinePresence", "notCollectedDuringOnboarding" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } + diff --git a/src/management/api_account_company_level.go b/src/management/api_account_company_level.go index b8daa34a4..ce6d64710 100644 --- a/src/management/api_account_company_level.go +++ b/src/management/api_account_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AccountCompanyLevelApi service @@ -27,6 +24,7 @@ type AccountCompanyLevelApiGetCompanyAccountInput struct { companyId string } + /* Prepare a request for GetCompanyAccount @param companyId The unique identifier of the company account. @@ -41,7 +39,7 @@ func (a *AccountCompanyLevelApi) GetCompanyAccountInput(companyId string) Accoun /* GetCompanyAccount Get a company account -Returns the company account specified in the path. Your API credential must have access to the company account. +Returns the company account specified in the path. Your API credential must have access to the company account. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read @@ -51,75 +49,76 @@ To make this request, your API credential must have the following [roles](https: @return Company, *http.Response, error */ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r AccountCompanyLevelApiGetCompanyAccountInput) (Company, *http.Response, error) { - res := &Company{} + res := &Company{} path := "/companies/{companyId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountCompanyLevelApi.ListCompanyAccounts type AccountCompanyLevelApiListCompanyAccountsInput struct { pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -134,13 +133,15 @@ func (r AccountCompanyLevelApiListCompanyAccountsInput) PageSize(pageSize int32) return r } + /* Prepare a request for ListCompanyAccounts @return AccountCompanyLevelApiListCompanyAccountsInput */ func (a *AccountCompanyLevelApi) ListCompanyAccountsInput() AccountCompanyLevelApiListCompanyAccountsInput { - return AccountCompanyLevelApiListCompanyAccountsInput{} + return AccountCompanyLevelApiListCompanyAccountsInput{ + } } /* @@ -157,81 +158,82 @@ To make this request, your API credential must have the following [roles](https: @return ListCompanyResponse, *http.Response, error */ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r AccountCompanyLevelApiListCompanyAccountsInput) (ListCompanyResponse, *http.Response, error) { - res := &ListCompanyResponse{} + res := &ListCompanyResponse{} path := "/companies" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountCompanyLevelApi.ListMerchantAccounts type AccountCompanyLevelApiListMerchantAccountsInput struct { - companyId string + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -246,6 +248,7 @@ func (r AccountCompanyLevelApiListMerchantAccountsInput) PageSize(pageSize int32 return r } + /* Prepare a request for ListMerchantAccounts @param companyId The unique identifier of the company account. @@ -260,7 +263,7 @@ func (a *AccountCompanyLevelApi) ListMerchantAccountsInput(companyId string) Acc /* ListMerchantAccounts Get a list of merchant accounts -Returns the list of merchant accounts under the company account specified in the path. The list only includes merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. +Returns the list of merchant accounts under the company account specified in the path. The list only includes merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read @@ -270,73 +273,74 @@ To make this request, your API credential must have the following [roles](https: @return ListMerchantResponse, *http.Response, error */ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r AccountCompanyLevelApiListMerchantAccountsInput) (ListMerchantResponse, *http.Response, error) { - res := &ListMerchantResponse{} + res := &ListMerchantResponse{} path := "/companies/{companyId}/merchants" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_account_merchant_level.go b/src/management/api_account_merchant_level.go index 207d9a7cf..1b4a09c22 100644 --- a/src/management/api_account_merchant_level.go +++ b/src/management/api_account_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AccountMerchantLevelApi service @@ -32,13 +29,15 @@ func (r AccountMerchantLevelApiCreateMerchantAccountInput) CreateMerchantRequest return r } + /* Prepare a request for CreateMerchantAccount @return AccountMerchantLevelApiCreateMerchantAccountInput */ func (a *AccountMerchantLevelApi) CreateMerchantAccountInput() AccountMerchantLevelApiCreateMerchantAccountInput { - return AccountMerchantLevelApiCreateMerchantAccountInput{} + return AccountMerchantLevelApiCreateMerchantAccountInput{ + } } /* @@ -56,75 +55,77 @@ To make this request, your API credential must have the following [roles](https: @return CreateMerchantResponse, *http.Response, error */ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r AccountMerchantLevelApiCreateMerchantAccountInput) (CreateMerchantResponse, *http.Response, error) { - res := &CreateMerchantResponse{} + res := &CreateMerchantResponse{} path := "/merchants" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createMerchantRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createMerchantRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountMerchantLevelApi.GetMerchantAccount type AccountMerchantLevelApiGetMerchantAccountInput struct { merchantId string } + /* Prepare a request for GetMerchantAccount @param merchantId The unique identifier of the merchant account. @@ -149,75 +150,76 @@ To make this request, your API credential must have the following [roles](https: @return Merchant, *http.Response, error */ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r AccountMerchantLevelApiGetMerchantAccountInput) (Merchant, *http.Response, error) { - res := &Merchant{} + res := &Merchant{} path := "/merchants/{merchantId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountMerchantLevelApi.ListMerchantAccounts type AccountMerchantLevelApiListMerchantAccountsInput struct { pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -232,19 +234,21 @@ func (r AccountMerchantLevelApiListMerchantAccountsInput) PageSize(pageSize int3 return r } + /* Prepare a request for ListMerchantAccounts @return AccountMerchantLevelApiListMerchantAccountsInput */ func (a *AccountMerchantLevelApi) ListMerchantAccountsInput() AccountMerchantLevelApiListMerchantAccountsInput { - return AccountMerchantLevelApiListMerchantAccountsInput{} + return AccountMerchantLevelApiListMerchantAccountsInput{ + } } /* ListMerchantAccounts Get a list of merchant accounts -Returns the list of merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. +Returns the list of merchant accounts that your API credential has access to. The list is grouped into pages as defined by the query parameters. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Account read @@ -254,81 +258,83 @@ To make this request, your API credential must have the following [roles](https: @return ListMerchantResponse, *http.Response, error */ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r AccountMerchantLevelApiListMerchantAccountsInput) (ListMerchantResponse, *http.Response, error) { - res := &ListMerchantResponse{} + res := &ListMerchantResponse{} path := "/merchants" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountMerchantLevelApi.RequestToActivateMerchantAccount type AccountMerchantLevelApiRequestToActivateMerchantAccountInput struct { merchantId string } + /* Prepare a request for RequestToActivateMerchantAccount @param merchantId The unique identifier of the merchant account. @@ -357,67 +363,68 @@ To make this request, your API credential must have the following [roles](https: @return RequestActivationResponse, *http.Response, error */ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.Context, r AccountMerchantLevelApiRequestToActivateMerchantAccountInput) (RequestActivationResponse, *http.Response, error) { - res := &RequestActivationResponse{} + res := &RequestActivationResponse{} path := "/merchants/{merchantId}/activate" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_account_store_level.go b/src/management/api_account_store_level.go index 81b8fb769..4f1d3378c 100644 --- a/src/management/api_account_store_level.go +++ b/src/management/api_account_store_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AccountStoreLevelApi service @@ -32,13 +29,15 @@ func (r AccountStoreLevelApiCreateStoreInput) StoreCreationWithMerchantCodeReque return r } + /* Prepare a request for CreateStore @return AccountStoreLevelApiCreateStoreInput */ func (a *AccountStoreLevelApi) CreateStoreInput() AccountStoreLevelApiCreateStoreInput { - return AccountStoreLevelApiCreateStoreInput{} + return AccountStoreLevelApiCreateStoreInput{ + } } /* @@ -54,73 +53,74 @@ To make this request, your API credential must have the following [role](https:/ @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLevelApiCreateStoreInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/stores" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storeCreationWithMerchantCodeRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storeCreationWithMerchantCodeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.CreateStoreByMerchantId type AccountStoreLevelApiCreateStoreByMerchantIdInput struct { - merchantId string + merchantId string storeCreationRequest *StoreCreationRequest } @@ -129,6 +129,7 @@ func (r AccountStoreLevelApiCreateStoreByMerchantIdInput) StoreCreationRequest(s return r } + /* Prepare a request for CreateStoreByMerchantId @param merchantId The unique identifier of the merchant account. @@ -153,77 +154,79 @@ To make this request, your API credential must have the following [role](https:/ @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r AccountStoreLevelApiCreateStoreByMerchantIdInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/merchants/{merchantId}/stores" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storeCreationRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storeCreationRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.GetStore type AccountStoreLevelApiGetStoreInput struct { merchantId string - storeId string + storeId string } + /* Prepare a request for GetStore @param merchantId The unique identifier of the merchant account.@param storeId The unique identifier of the store. @@ -232,7 +235,7 @@ Prepare a request for GetStore func (a *AccountStoreLevelApi) GetStoreInput(merchantId string, storeId string) AccountStoreLevelApiGetStoreInput { return AccountStoreLevelApiGetStoreInput{ merchantId: merchantId, - storeId: storeId, + storeId: storeId, } } @@ -250,77 +253,79 @@ To make this request, your API credential must have one of the following [roles] @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevelApiGetStoreInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/merchants/{merchantId}/stores/{storeId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.GetStoreById type AccountStoreLevelApiGetStoreByIdInput struct { storeId string } + /* Prepare a request for GetStoreById @param storeId The unique identifier of the store. @@ -346,76 +351,77 @@ To make this request, your API credential must have one of the following [roles] @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreLevelApiGetStoreByIdInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/stores/{storeId}" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.ListStores type AccountStoreLevelApiListStoresInput struct { pageNumber *int32 - pageSize *int32 - reference *string + pageSize *int32 + reference *string merchantId *string } @@ -443,13 +449,15 @@ func (r AccountStoreLevelApiListStoresInput) MerchantId(merchantId string) Accou return r } + /* Prepare a request for ListStores @return AccountStoreLevelApiListStoresInput */ func (a *AccountStoreLevelApi) ListStoresInput() AccountStoreLevelApiListStoresInput { - return AccountStoreLevelApiListStoresInput{} + return AccountStoreLevelApiListStoresInput{ + } } /* @@ -466,88 +474,89 @@ To make this request, your API credential must have one of the following [roles] @return ListStoresResponse, *http.Response, error */ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLevelApiListStoresInput) (ListStoresResponse, *http.Response, error) { - res := &ListStoresResponse{} + res := &ListStoresResponse{} path := "/stores" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.reference != nil { - common.ParameterAddToQuery(queryParams, "reference", r.reference, "") - } - if r.merchantId != nil { - common.ParameterAddToQuery(queryParams, "merchantId", r.merchantId, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.reference != nil { + common.ParameterAddToQuery(queryParams, "reference", r.reference, "") + } + if r.merchantId != nil { + common.ParameterAddToQuery(queryParams, "merchantId", r.merchantId, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.ListStoresByMerchantId type AccountStoreLevelApiListStoresByMerchantIdInput struct { merchantId string pageNumber *int32 - pageSize *int32 - reference *string + pageSize *int32 + reference *string } // The number of the page to fetch. @@ -568,6 +577,7 @@ func (r AccountStoreLevelApiListStoresByMerchantIdInput) Reference(reference str return r } + /* Prepare a request for ListStoresByMerchantId @param merchantId The unique identifier of the merchant account. @@ -593,84 +603,85 @@ To make this request, your API credential must have one of the following [roles] @return ListStoresResponse, *http.Response, error */ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r AccountStoreLevelApiListStoresByMerchantIdInput) (ListStoresResponse, *http.Response, error) { - res := &ListStoresResponse{} + res := &ListStoresResponse{} path := "/merchants/{merchantId}/stores" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.reference != nil { - common.ParameterAddToQuery(queryParams, "reference", r.reference, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.reference != nil { + common.ParameterAddToQuery(queryParams, "reference", r.reference, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.UpdateStore type AccountStoreLevelApiUpdateStoreInput struct { - merchantId string - storeId string + merchantId string + storeId string updateStoreRequest *UpdateStoreRequest } @@ -679,6 +690,7 @@ func (r AccountStoreLevelApiUpdateStoreInput) UpdateStoreRequest(updateStoreRequ return r } + /* Prepare a request for UpdateStore @param merchantId The unique identifier of the merchant account.@param storeId The unique identifier of the store. @@ -687,7 +699,7 @@ Prepare a request for UpdateStore func (a *AccountStoreLevelApi) UpdateStoreInput(merchantId string, storeId string) AccountStoreLevelApiUpdateStoreInput { return AccountStoreLevelApiUpdateStoreInput{ merchantId: merchantId, - storeId: storeId, + storeId: storeId, } } @@ -704,75 +716,76 @@ To make this request, your API credential must have the following [role](https:/ @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLevelApiUpdateStoreInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/merchants/{merchantId}/stores/{storeId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateStoreRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateStoreRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AccountStoreLevelApi.UpdateStoreById type AccountStoreLevelApiUpdateStoreByIdInput struct { - storeId string + storeId string updateStoreRequest *UpdateStoreRequest } @@ -781,6 +794,7 @@ func (r AccountStoreLevelApiUpdateStoreByIdInput) UpdateStoreRequest(updateStore return r } + /* Prepare a request for UpdateStoreById @param storeId The unique identifier of the store. @@ -806,67 +820,68 @@ To make this request, your API credential must have the following [role](https:/ @return Store, *http.Response, error */ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountStoreLevelApiUpdateStoreByIdInput) (Store, *http.Response, error) { - res := &Store{} + res := &Store{} path := "/stores/{storeId}" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateStoreRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateStoreRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_allowed_origins_company_level.go b/src/management/api_allowed_origins_company_level.go index 84cbd7534..5a42050e0 100644 --- a/src/management/api_allowed_origins_company_level.go +++ b/src/management/api_allowed_origins_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AllowedOriginsCompanyLevelApi service @@ -24,9 +21,9 @@ type AllowedOriginsCompanyLevelApi common.Service // All parameters accepted by AllowedOriginsCompanyLevelApi.CreateAllowedOrigin type AllowedOriginsCompanyLevelApiCreateAllowedOriginInput struct { - companyId string + companyId string apiCredentialId string - allowedOrigin *AllowedOrigin + allowedOrigin *AllowedOrigin } func (r AllowedOriginsCompanyLevelApiCreateAllowedOriginInput) AllowedOrigin(allowedOrigin AllowedOrigin) AllowedOriginsCompanyLevelApiCreateAllowedOriginInput { @@ -34,6 +31,7 @@ func (r AllowedOriginsCompanyLevelApiCreateAllowedOriginInput) AllowedOrigin(all return r } + /* Prepare a request for CreateAllowedOrigin @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -41,7 +39,7 @@ Prepare a request for CreateAllowedOrigin */ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOriginInput(companyId string, apiCredentialId string) AllowedOriginsCompanyLevelApiCreateAllowedOriginInput { return AllowedOriginsCompanyLevelApiCreateAllowedOriginInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -59,79 +57,81 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOriginsResponse, *http.Response, error */ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, r AllowedOriginsCompanyLevelApiCreateAllowedOriginInput) (AllowedOriginsResponse, *http.Response, error) { - res := &AllowedOriginsResponse{} + res := &AllowedOriginsResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.allowedOrigin, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.allowedOrigin, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AllowedOriginsCompanyLevelApi.DeleteAllowedOrigin type AllowedOriginsCompanyLevelApiDeleteAllowedOriginInput struct { - companyId string + companyId string apiCredentialId string - originId string + originId string } + /* Prepare a request for DeleteAllowedOrigin @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential.@param originId Unique identifier of the allowed origin. @@ -139,9 +139,9 @@ Prepare a request for DeleteAllowedOrigin */ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOriginInput(companyId string, apiCredentialId string, originId string) AllowedOriginsCompanyLevelApiDeleteAllowedOriginInput { return AllowedOriginsCompanyLevelApiDeleteAllowedOriginInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -158,80 +158,82 @@ To make this request, your API credential must have the following [roles](https: @return *http.Response, error */ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, r AllowedOriginsCompanyLevelApiDeleteAllowedOriginInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by AllowedOriginsCompanyLevelApi.GetAllowedOrigin type AllowedOriginsCompanyLevelApiGetAllowedOriginInput struct { - companyId string + companyId string apiCredentialId string - originId string + originId string } + /* Prepare a request for GetAllowedOrigin @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential.@param originId Unique identifier of the allowed origin. @@ -239,9 +241,9 @@ Prepare a request for GetAllowedOrigin */ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOriginInput(companyId string, apiCredentialId string, originId string) AllowedOriginsCompanyLevelApiGetAllowedOriginInput { return AllowedOriginsCompanyLevelApiGetAllowedOriginInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -258,79 +260,81 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOrigin, *http.Response, error */ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r AllowedOriginsCompanyLevelApiGetAllowedOriginInput) (AllowedOrigin, *http.Response, error) { - res := &AllowedOrigin{} + res := &AllowedOrigin{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AllowedOriginsCompanyLevelApi.ListAllowedOrigins type AllowedOriginsCompanyLevelApiListAllowedOriginsInput struct { - companyId string + companyId string apiCredentialId string } + /* Prepare a request for ListAllowedOrigins @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -338,7 +342,7 @@ Prepare a request for ListAllowedOrigins */ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOriginsInput(companyId string, apiCredentialId string) AllowedOriginsCompanyLevelApiListAllowedOriginsInput { return AllowedOriginsCompanyLevelApiListAllowedOriginsInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -356,68 +360,69 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOriginsResponse, *http.Response, error */ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, r AllowedOriginsCompanyLevelApiListAllowedOriginsInput) (AllowedOriginsResponse, *http.Response, error) { - res := &AllowedOriginsResponse{} + res := &AllowedOriginsResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_allowed_origins_merchant_level.go b/src/management/api_allowed_origins_merchant_level.go index a0baae34b..033afa665 100644 --- a/src/management/api_allowed_origins_merchant_level.go +++ b/src/management/api_allowed_origins_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AllowedOriginsMerchantLevelApi service @@ -24,9 +21,9 @@ type AllowedOriginsMerchantLevelApi common.Service // All parameters accepted by AllowedOriginsMerchantLevelApi.CreateAllowedOrigin type AllowedOriginsMerchantLevelApiCreateAllowedOriginInput struct { - merchantId string + merchantId string apiCredentialId string - allowedOrigin *AllowedOrigin + allowedOrigin *AllowedOrigin } func (r AllowedOriginsMerchantLevelApiCreateAllowedOriginInput) AllowedOrigin(allowedOrigin AllowedOrigin) AllowedOriginsMerchantLevelApiCreateAllowedOriginInput { @@ -34,6 +31,7 @@ func (r AllowedOriginsMerchantLevelApiCreateAllowedOriginInput) AllowedOrigin(al return r } + /* Prepare a request for CreateAllowedOrigin @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -41,7 +39,7 @@ Prepare a request for CreateAllowedOrigin */ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOriginInput(merchantId string, apiCredentialId string) AllowedOriginsMerchantLevelApiCreateAllowedOriginInput { return AllowedOriginsMerchantLevelApiCreateAllowedOriginInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -59,79 +57,81 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOriginsResponse, *http.Response, error */ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context, r AllowedOriginsMerchantLevelApiCreateAllowedOriginInput) (AllowedOriginsResponse, *http.Response, error) { - res := &AllowedOriginsResponse{} + res := &AllowedOriginsResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.allowedOrigin, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.allowedOrigin, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AllowedOriginsMerchantLevelApi.DeleteAllowedOrigin type AllowedOriginsMerchantLevelApiDeleteAllowedOriginInput struct { - merchantId string + merchantId string apiCredentialId string - originId string + originId string } + /* Prepare a request for DeleteAllowedOrigin @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential.@param originId Unique identifier of the allowed origin. @@ -139,9 +139,9 @@ Prepare a request for DeleteAllowedOrigin */ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOriginInput(merchantId string, apiCredentialId string, originId string) AllowedOriginsMerchantLevelApiDeleteAllowedOriginInput { return AllowedOriginsMerchantLevelApiDeleteAllowedOriginInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -158,80 +158,82 @@ To make this request, your API credential must have the following [roles](https: @return *http.Response, error */ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context, r AllowedOriginsMerchantLevelApiDeleteAllowedOriginInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by AllowedOriginsMerchantLevelApi.GetAllowedOrigin type AllowedOriginsMerchantLevelApiGetAllowedOriginInput struct { - merchantId string + merchantId string apiCredentialId string - originId string + originId string } + /* Prepare a request for GetAllowedOrigin @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential.@param originId Unique identifier of the allowed origin. @@ -239,9 +241,9 @@ Prepare a request for GetAllowedOrigin */ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOriginInput(merchantId string, apiCredentialId string, originId string) AllowedOriginsMerchantLevelApiGetAllowedOriginInput { return AllowedOriginsMerchantLevelApiGetAllowedOriginInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, - originId: originId, + originId: originId, } } @@ -258,79 +260,81 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOrigin, *http.Response, error */ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r AllowedOriginsMerchantLevelApiGetAllowedOriginInput) (AllowedOrigin, *http.Response, error) { - res := &AllowedOrigin{} + res := &AllowedOrigin{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AllowedOriginsMerchantLevelApi.ListAllowedOrigins type AllowedOriginsMerchantLevelApiListAllowedOriginsInput struct { - merchantId string + merchantId string apiCredentialId string } + /* Prepare a request for ListAllowedOrigins @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -338,7 +342,7 @@ Prepare a request for ListAllowedOrigins */ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOriginsInput(merchantId string, apiCredentialId string) AllowedOriginsMerchantLevelApiListAllowedOriginsInput { return AllowedOriginsMerchantLevelApiListAllowedOriginsInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -356,68 +360,69 @@ To make this request, your API credential must have the following [roles](https: @return AllowedOriginsResponse, *http.Response, error */ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, r AllowedOriginsMerchantLevelApiListAllowedOriginsInput) (AllowedOriginsResponse, *http.Response, error) { - res := &AllowedOriginsResponse{} + res := &AllowedOriginsResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_android_files_company_level.go b/src/management/api_android_files_company_level.go index e59f6ab47..7d102775e 100644 --- a/src/management/api_android_files_company_level.go +++ b/src/management/api_android_files_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // AndroidFilesCompanyLevelApi service @@ -25,9 +22,10 @@ type AndroidFilesCompanyLevelApi common.Service // All parameters accepted by AndroidFilesCompanyLevelApi.GetAndroidApp type AndroidFilesCompanyLevelApiGetAndroidAppInput struct { companyId string - id string + id string } + /* Prepare a request for GetAndroidApp @param companyId The unique identifier of the company account.@param id The unique identifier of the app. @@ -36,14 +34,14 @@ Prepare a request for GetAndroidApp func (a *AndroidFilesCompanyLevelApi) GetAndroidAppInput(companyId string, id string) AndroidFilesCompanyLevelApiGetAndroidAppInput { return AndroidFilesCompanyLevelApiGetAndroidAppInput{ companyId: companyId, - id: id, + id: id, } } /* GetAndroidApp Get Android app -Returns the details of the Android app identified in the path. +Returns the details of the Android app identified in the path. These apps have been uploaded to Adyen and can be installed or uninstalled on Android payment terminals through [terminal actions](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -55,77 +53,78 @@ To make this request, your API credential must have one of the following [roles] @return AndroidApp, *http.Response, error */ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r AndroidFilesCompanyLevelApiGetAndroidAppInput) (AndroidApp, *http.Response, error) { - res := &AndroidApp{} + res := &AndroidApp{} path := "/companies/{companyId}/androidApps/{id}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AndroidFilesCompanyLevelApi.ListAndroidApps type AndroidFilesCompanyLevelApiListAndroidAppsInput struct { - companyId string - pageNumber *int32 - pageSize *int32 + companyId string + pageNumber *int32 + pageSize *int32 packageName *string versionCode *int32 } @@ -154,6 +153,7 @@ func (r AndroidFilesCompanyLevelApiListAndroidAppsInput) VersionCode(versionCode return r } + /* Prepare a request for ListAndroidApps @param companyId The unique identifier of the company account. @@ -168,7 +168,7 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidAppsInput(companyId string) And /* ListAndroidApps Get a list of Android apps -Returns a list of the Android apps that are available for the company identified in the path. +Returns a list of the Android apps that are available for the company identified in the path. These apps have been uploaded to Adyen and can be installed or uninstalled on Android payment terminals through [terminal actions](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -182,88 +182,89 @@ To make this request, your API credential must have one of the following [roles] @return AndroidAppsResponse, *http.Response, error */ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r AndroidFilesCompanyLevelApiListAndroidAppsInput) (AndroidAppsResponse, *http.Response, error) { - res := &AndroidAppsResponse{} + res := &AndroidAppsResponse{} path := "/companies/{companyId}/androidApps" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.packageName != nil { - common.ParameterAddToQuery(queryParams, "packageName", r.packageName, "") - } - if r.versionCode != nil { - common.ParameterAddToQuery(queryParams, "versionCode", r.versionCode, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.packageName != nil { + common.ParameterAddToQuery(queryParams, "packageName", r.packageName, "") + } + if r.versionCode != nil { + common.ParameterAddToQuery(queryParams, "versionCode", r.versionCode, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AndroidFilesCompanyLevelApi.ListAndroidCertificates type AndroidFilesCompanyLevelApiListAndroidCertificatesInput struct { - companyId string - pageNumber *int32 - pageSize *int32 + companyId string + pageNumber *int32 + pageSize *int32 certificateName *string } @@ -285,6 +286,7 @@ func (r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) CertificateName return r } + /* Prepare a request for ListAndroidCertificates @param companyId The unique identifier of the company account. @@ -313,85 +315,87 @@ To make this request, your API credential must have one of the following [roles] @return AndroidCertificatesResponse, *http.Response, error */ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Context, r AndroidFilesCompanyLevelApiListAndroidCertificatesInput) (AndroidCertificatesResponse, *http.Response, error) { - res := &AndroidCertificatesResponse{} + res := &AndroidCertificatesResponse{} path := "/companies/{companyId}/androidCertificates" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.certificateName != nil { - common.ParameterAddToQuery(queryParams, "certificateName", r.certificateName, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.certificateName != nil { + common.ParameterAddToQuery(queryParams, "certificateName", r.certificateName, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by AndroidFilesCompanyLevelApi.UploadAndroidApp type AndroidFilesCompanyLevelApiUploadAndroidAppInput struct { companyId string } + /* Prepare a request for UploadAndroidApp @param companyId The unique identifier of the company account. @@ -418,67 +422,68 @@ To make this request, your API credential must have the following [role](https:/ @return *http.Response, error */ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r AndroidFilesCompanyLevelApiUploadAndroidAppInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/companies/{companyId}/androidApps" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + diff --git a/src/management/api_api_credentials_company_level.go b/src/management/api_api_credentials_company_level.go index 9dee75642..8bc2d65ad 100644 --- a/src/management/api_api_credentials_company_level.go +++ b/src/management/api_api_credentials_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APICredentialsCompanyLevelApi service @@ -24,7 +21,7 @@ type APICredentialsCompanyLevelApi common.Service // All parameters accepted by APICredentialsCompanyLevelApi.CreateApiCredential type APICredentialsCompanyLevelApiCreateApiCredentialInput struct { - companyId string + companyId string createCompanyApiCredentialRequest *CreateCompanyApiCredentialRequest } @@ -33,6 +30,7 @@ func (r APICredentialsCompanyLevelApiCreateApiCredentialInput) CreateCompanyApiC return r } + /* Prepare a request for CreateApiCredential @param companyId The unique identifier of the company account. @@ -66,77 +64,79 @@ To make this request, your API credential must have the following [roles](https: @return CreateCompanyApiCredentialResponse, *http.Response, error */ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, r APICredentialsCompanyLevelApiCreateApiCredentialInput) (CreateCompanyApiCredentialResponse, *http.Response, error) { - res := &CreateCompanyApiCredentialResponse{} + res := &CreateCompanyApiCredentialResponse{} path := "/companies/{companyId}/apiCredentials" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createCompanyApiCredentialRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createCompanyApiCredentialRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsCompanyLevelApi.GetApiCredential type APICredentialsCompanyLevelApiGetApiCredentialInput struct { - companyId string + companyId string apiCredentialId string } + /* Prepare a request for GetApiCredential @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -144,7 +144,7 @@ Prepare a request for GetApiCredential */ func (a *APICredentialsCompanyLevelApi) GetApiCredentialInput(companyId string, apiCredentialId string) APICredentialsCompanyLevelApiGetApiCredentialInput { return APICredentialsCompanyLevelApiGetApiCredentialInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -162,77 +162,78 @@ To make this request, your API credential must have the following [roles](https: @return CompanyApiCredential, *http.Response, error */ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r APICredentialsCompanyLevelApiGetApiCredentialInput) (CompanyApiCredential, *http.Response, error) { - res := &CompanyApiCredential{} + res := &CompanyApiCredential{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsCompanyLevelApi.ListApiCredentials type APICredentialsCompanyLevelApiListApiCredentialsInput struct { - companyId string + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -247,6 +248,7 @@ func (r APICredentialsCompanyLevelApiListApiCredentialsInput) PageSize(pageSize return r } + /* Prepare a request for ListApiCredentials @param companyId The unique identifier of the company account. @@ -271,81 +273,82 @@ To make this request, your API credential must have the following [roles](https: @return ListCompanyApiCredentialsResponse, *http.Response, error */ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, r APICredentialsCompanyLevelApiListApiCredentialsInput) (ListCompanyApiCredentialsResponse, *http.Response, error) { - res := &ListCompanyApiCredentialsResponse{} + res := &ListCompanyApiCredentialsResponse{} path := "/companies/{companyId}/apiCredentials" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsCompanyLevelApi.UpdateApiCredential type APICredentialsCompanyLevelApiUpdateApiCredentialInput struct { - companyId string - apiCredentialId string + companyId string + apiCredentialId string updateCompanyApiCredentialRequest *UpdateCompanyApiCredentialRequest } @@ -354,6 +357,7 @@ func (r APICredentialsCompanyLevelApiUpdateApiCredentialInput) UpdateCompanyApiC return r } + /* Prepare a request for UpdateApiCredential @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -361,7 +365,7 @@ Prepare a request for UpdateApiCredential */ func (a *APICredentialsCompanyLevelApi) UpdateApiCredentialInput(companyId string, apiCredentialId string) APICredentialsCompanyLevelApiUpdateApiCredentialInput { return APICredentialsCompanyLevelApiUpdateApiCredentialInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -369,7 +373,7 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredentialInput(companyId strin /* UpdateApiCredential Update an API credential. -Changes the API credential's roles, merchant account access, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. +Changes the API credential's roles, merchant account access, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write @@ -379,68 +383,69 @@ To make this request, your API credential must have the following [roles](https: @return CompanyApiCredential, *http.Response, error */ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, r APICredentialsCompanyLevelApiUpdateApiCredentialInput) (CompanyApiCredential, *http.Response, error) { - res := &CompanyApiCredential{} + res := &CompanyApiCredential{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateCompanyApiCredentialRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateCompanyApiCredentialRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_api_credentials_merchant_level.go b/src/management/api_api_credentials_merchant_level.go index 131a71eb5..8b5785ed9 100644 --- a/src/management/api_api_credentials_merchant_level.go +++ b/src/management/api_api_credentials_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APICredentialsMerchantLevelApi service @@ -24,7 +21,7 @@ type APICredentialsMerchantLevelApi common.Service // All parameters accepted by APICredentialsMerchantLevelApi.CreateApiCredential type APICredentialsMerchantLevelApiCreateApiCredentialInput struct { - merchantId string + merchantId string createMerchantApiCredentialRequest *CreateMerchantApiCredentialRequest } @@ -33,6 +30,7 @@ func (r APICredentialsMerchantLevelApiCreateApiCredentialInput) CreateMerchantAp return r } + /* Prepare a request for CreateApiCredential @param merchantId The unique identifier of the merchant account. @@ -66,77 +64,79 @@ To make this request, your API credential must have the following [roles](https: @return CreateApiCredentialResponse, *http.Response, error */ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context, r APICredentialsMerchantLevelApiCreateApiCredentialInput) (CreateApiCredentialResponse, *http.Response, error) { - res := &CreateApiCredentialResponse{} + res := &CreateApiCredentialResponse{} path := "/merchants/{merchantId}/apiCredentials" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createMerchantApiCredentialRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createMerchantApiCredentialRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsMerchantLevelApi.GetApiCredential type APICredentialsMerchantLevelApiGetApiCredentialInput struct { - merchantId string + merchantId string apiCredentialId string } + /* Prepare a request for GetApiCredential @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -144,7 +144,7 @@ Prepare a request for GetApiCredential */ func (a *APICredentialsMerchantLevelApi) GetApiCredentialInput(merchantId string, apiCredentialId string) APICredentialsMerchantLevelApiGetApiCredentialInput { return APICredentialsMerchantLevelApiGetApiCredentialInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -162,77 +162,78 @@ To make this request, your API credential must have the following [roles](https: @return ApiCredential, *http.Response, error */ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r APICredentialsMerchantLevelApiGetApiCredentialInput) (ApiCredential, *http.Response, error) { - res := &ApiCredential{} + res := &ApiCredential{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsMerchantLevelApi.ListApiCredentials type APICredentialsMerchantLevelApiListApiCredentialsInput struct { merchantId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -247,6 +248,7 @@ func (r APICredentialsMerchantLevelApiListApiCredentialsInput) PageSize(pageSize return r } + /* Prepare a request for ListApiCredentials @param merchantId The unique identifier of the merchant account. @@ -271,81 +273,82 @@ To make this request, your API credential must have the following [roles](https: @return ListMerchantApiCredentialsResponse, *http.Response, error */ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, r APICredentialsMerchantLevelApiListApiCredentialsInput) (ListMerchantApiCredentialsResponse, *http.Response, error) { - res := &ListMerchantApiCredentialsResponse{} + res := &ListMerchantApiCredentialsResponse{} path := "/merchants/{merchantId}/apiCredentials" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by APICredentialsMerchantLevelApi.UpdateApiCredential type APICredentialsMerchantLevelApiUpdateApiCredentialInput struct { - merchantId string - apiCredentialId string + merchantId string + apiCredentialId string updateMerchantApiCredentialRequest *UpdateMerchantApiCredentialRequest } @@ -354,6 +357,7 @@ func (r APICredentialsMerchantLevelApiUpdateApiCredentialInput) UpdateMerchantAp return r } + /* Prepare a request for UpdateApiCredential @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -361,7 +365,7 @@ Prepare a request for UpdateApiCredential */ func (a *APICredentialsMerchantLevelApi) UpdateApiCredentialInput(merchantId string, apiCredentialId string) APICredentialsMerchantLevelApiUpdateApiCredentialInput { return APICredentialsMerchantLevelApiUpdateApiCredentialInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -369,7 +373,7 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredentialInput(merchantId str /* UpdateApiCredential Update an API credential -Changes the API credential's roles, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. +Changes the API credential's roles, or allowed origins. The request has the new values for the fields you want to change. The response contains the full updated API credential, including the new values from the request. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—API credentials read and write @@ -379,68 +383,69 @@ To make this request, your API credential must have the following [roles](https: @return ApiCredential, *http.Response, error */ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context, r APICredentialsMerchantLevelApiUpdateApiCredentialInput) (ApiCredential, *http.Response, error) { - res := &ApiCredential{} + res := &ApiCredential{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateMerchantApiCredentialRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateMerchantApiCredentialRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_api_key_company_level.go b/src/management/api_api_key_company_level.go index e179e5fc6..a05d6c51c 100644 --- a/src/management/api_api_key_company_level.go +++ b/src/management/api_api_key_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIKeyCompanyLevelApi service @@ -24,10 +21,11 @@ type APIKeyCompanyLevelApi common.Service // All parameters accepted by APIKeyCompanyLevelApi.GenerateNewApiKey type APIKeyCompanyLevelApiGenerateNewApiKeyInput struct { - companyId string + companyId string apiCredentialId string } + /* Prepare a request for GenerateNewApiKey @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -35,7 +33,7 @@ Prepare a request for GenerateNewApiKey */ func (a *APIKeyCompanyLevelApi) GenerateNewApiKeyInput(companyId string, apiCredentialId string) APIKeyCompanyLevelApiGenerateNewApiKeyInput { return APIKeyCompanyLevelApiGenerateNewApiKeyInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -53,68 +51,69 @@ To make this request, your API credential must have the following [roles](https: @return GenerateApiKeyResponse, *http.Response, error */ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyCompanyLevelApiGenerateNewApiKeyInput) (GenerateApiKeyResponse, *http.Response, error) { - res := &GenerateApiKeyResponse{} + res := &GenerateApiKeyResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } + if httpRes == nil { + return *res, httpRes, err + } - return *res, httpRes, err + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_api_key_merchant_level.go b/src/management/api_api_key_merchant_level.go index 5bd8ca341..e5d65b21e 100644 --- a/src/management/api_api_key_merchant_level.go +++ b/src/management/api_api_key_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIKeyMerchantLevelApi service @@ -24,10 +21,11 @@ type APIKeyMerchantLevelApi common.Service // All parameters accepted by APIKeyMerchantLevelApi.GenerateNewApiKey type APIKeyMerchantLevelApiGenerateNewApiKeyInput struct { - merchantId string + merchantId string apiCredentialId string } + /* Prepare a request for GenerateNewApiKey @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -35,7 +33,7 @@ Prepare a request for GenerateNewApiKey */ func (a *APIKeyMerchantLevelApi) GenerateNewApiKeyInput(merchantId string, apiCredentialId string) APIKeyMerchantLevelApiGenerateNewApiKeyInput { return APIKeyMerchantLevelApiGenerateNewApiKeyInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -53,68 +51,69 @@ To make this request, your API credential must have the following [roles](https: @return GenerateApiKeyResponse, *http.Response, error */ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyMerchantLevelApiGenerateNewApiKeyInput) (GenerateApiKeyResponse, *http.Response, error) { - res := &GenerateApiKeyResponse{} + res := &GenerateApiKeyResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } + if httpRes == nil { + return *res, httpRes, err + } - return *res, httpRes, err + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_client_key_company_level.go b/src/management/api_client_key_company_level.go index d15e203b9..d5b7ed5bb 100644 --- a/src/management/api_client_key_company_level.go +++ b/src/management/api_client_key_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ClientKeyCompanyLevelApi service @@ -24,10 +21,11 @@ type ClientKeyCompanyLevelApi common.Service // All parameters accepted by ClientKeyCompanyLevelApi.GenerateNewClientKey type ClientKeyCompanyLevelApiGenerateNewClientKeyInput struct { - companyId string + companyId string apiCredentialId string } + /* Prepare a request for GenerateNewClientKey @param companyId The unique identifier of the company account.@param apiCredentialId Unique identifier of the API credential. @@ -35,7 +33,7 @@ Prepare a request for GenerateNewClientKey */ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKeyInput(companyId string, apiCredentialId string) ClientKeyCompanyLevelApiGenerateNewClientKeyInput { return ClientKeyCompanyLevelApiGenerateNewClientKeyInput{ - companyId: companyId, + companyId: companyId, apiCredentialId: apiCredentialId, } } @@ -53,68 +51,69 @@ To make this request, your API credential must have the following [roles](https: @return GenerateClientKeyResponse, *http.Response, error */ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r ClientKeyCompanyLevelApiGenerateNewClientKeyInput) (GenerateClientKeyResponse, *http.Response, error) { - res := &GenerateClientKeyResponse{} + res := &GenerateClientKeyResponse{} path := "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } + if httpRes == nil { + return *res, httpRes, err + } - return *res, httpRes, err + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_client_key_merchant_level.go b/src/management/api_client_key_merchant_level.go index fcaf77718..789f29c00 100644 --- a/src/management/api_client_key_merchant_level.go +++ b/src/management/api_client_key_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ClientKeyMerchantLevelApi service @@ -24,10 +21,11 @@ type ClientKeyMerchantLevelApi common.Service // All parameters accepted by ClientKeyMerchantLevelApi.GenerateNewClientKey type ClientKeyMerchantLevelApiGenerateNewClientKeyInput struct { - merchantId string + merchantId string apiCredentialId string } + /* Prepare a request for GenerateNewClientKey @param merchantId The unique identifier of the merchant account.@param apiCredentialId Unique identifier of the API credential. @@ -35,7 +33,7 @@ Prepare a request for GenerateNewClientKey */ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKeyInput(merchantId string, apiCredentialId string) ClientKeyMerchantLevelApiGenerateNewClientKeyInput { return ClientKeyMerchantLevelApiGenerateNewClientKeyInput{ - merchantId: merchantId, + merchantId: merchantId, apiCredentialId: apiCredentialId, } } @@ -53,68 +51,69 @@ To make this request, your API credential must have the following [roles](https: @return GenerateClientKeyResponse, *http.Response, error */ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r ClientKeyMerchantLevelApiGenerateNewClientKeyInput) (GenerateClientKeyResponse, *http.Response, error) { - res := &GenerateClientKeyResponse{} + res := &GenerateClientKeyResponse{} path := "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"apiCredentialId"+"}", url.PathEscape(common.ParameterValueToString(r.apiCredentialId, "apiCredentialId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } + if httpRes == nil { + return *res, httpRes, err + } - return *res, httpRes, err + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_my_api_credential.go b/src/management/api_my_api_credential.go index bd1a9ed7c..f0e8cf89c 100644 --- a/src/management/api_my_api_credential.go +++ b/src/management/api_my_api_credential.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // MyAPICredentialApi service @@ -32,13 +29,15 @@ func (r MyAPICredentialApiAddAllowedOriginInput) CreateAllowedOriginRequest(crea return r } + /* Prepare a request for AddAllowedOrigin @return MyAPICredentialApiAddAllowedOriginInput */ func (a *MyAPICredentialApi) AddAllowedOriginInput() MyAPICredentialApiAddAllowedOriginInput { - return MyAPICredentialApiAddAllowedOriginInput{} + return MyAPICredentialApiAddAllowedOriginInput{ + } } /* @@ -54,81 +53,84 @@ You can make this request with any of the Management API roles. @return AllowedOrigin, *http.Response, error */ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICredentialApiAddAllowedOriginInput) (AllowedOrigin, *http.Response, error) { - res := &AllowedOrigin{} + res := &AllowedOrigin{} path := "/me/allowedOrigins" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createAllowedOriginRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createAllowedOriginRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by MyAPICredentialApi.GenerateClientKey type MyAPICredentialApiGenerateClientKeyInput struct { } + /* Prepare a request for GenerateClientKey @return MyAPICredentialApiGenerateClientKeyInput */ func (a *MyAPICredentialApi) GenerateClientKeyInput() MyAPICredentialApiGenerateClientKeyInput { - return MyAPICredentialApiGenerateClientKeyInput{} + return MyAPICredentialApiGenerateClientKeyInput{ + } } /* @@ -146,75 +148,77 @@ To make this request, your API credential must have the following [role](https:/ @return GenerateClientKeyResponse, *http.Response, error */ func (a *MyAPICredentialApi) GenerateClientKey(ctx context.Context, r MyAPICredentialApiGenerateClientKeyInput) (GenerateClientKeyResponse, *http.Response, error) { - res := &GenerateClientKeyResponse{} + res := &GenerateClientKeyResponse{} path := "/me/generateClientKey" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by MyAPICredentialApi.GetAllowedOriginDetails type MyAPICredentialApiGetAllowedOriginDetailsInput struct { originId string } + /* Prepare a request for GetAllowedOriginDetails @param originId Unique identifier of the allowed origin. @@ -239,82 +243,85 @@ You can make this request with any of the Management API roles. @return AllowedOrigin, *http.Response, error */ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAPICredentialApiGetAllowedOriginDetailsInput) (AllowedOrigin, *http.Response, error) { - res := &AllowedOrigin{} + res := &AllowedOrigin{} path := "/me/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by MyAPICredentialApi.GetAllowedOrigins type MyAPICredentialApiGetAllowedOriginsInput struct { } + /* Prepare a request for GetAllowedOrigins @return MyAPICredentialApiGetAllowedOriginsInput */ func (a *MyAPICredentialApi) GetAllowedOriginsInput() MyAPICredentialApiGetAllowedOriginsInput { - return MyAPICredentialApiGetAllowedOriginsInput{} + return MyAPICredentialApiGetAllowedOriginsInput{ + } } /* @@ -329,81 +336,84 @@ You can make this request with any of the Management API roles. @return AllowedOriginsResponse, *http.Response, error */ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICredentialApiGetAllowedOriginsInput) (AllowedOriginsResponse, *http.Response, error) { - res := &AllowedOriginsResponse{} + res := &AllowedOriginsResponse{} path := "/me/allowedOrigins" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by MyAPICredentialApi.GetApiCredentialDetails type MyAPICredentialApiGetApiCredentialDetailsInput struct { } + /* Prepare a request for GetApiCredentialDetails @return MyAPICredentialApiGetApiCredentialDetailsInput */ func (a *MyAPICredentialApi) GetApiCredentialDetailsInput() MyAPICredentialApiGetApiCredentialDetailsInput { - return MyAPICredentialApiGetApiCredentialDetailsInput{} + return MyAPICredentialApiGetApiCredentialDetailsInput{ + } } /* @@ -418,75 +428,77 @@ You can make this request with any of the Management API roles. @return MeApiCredential, *http.Response, error */ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAPICredentialApiGetApiCredentialDetailsInput) (MeApiCredential, *http.Response, error) { - res := &MeApiCredential{} + res := &MeApiCredential{} path := "/me" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by MyAPICredentialApi.RemoveAllowedOrigin type MyAPICredentialApiRemoveAllowedOriginInput struct { originId string } + /* Prepare a request for RemoveAllowedOrigin @param originId Unique identifier of the allowed origin. @@ -511,67 +523,68 @@ You can make this request with any of the Management API roles. @return *http.Response, error */ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICredentialApiRemoveAllowedOriginInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/me/allowedOrigins/{originId}" - path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"originId"+"}", url.PathEscape(common.ParameterValueToString(r.originId, "originId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + diff --git a/src/management/api_payment_methods_merchant_level.go b/src/management/api_payment_methods_merchant_level.go index d15383062..61b8b83c5 100644 --- a/src/management/api_payment_methods_merchant_level.go +++ b/src/management/api_payment_methods_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentMethodsMerchantLevelApi service @@ -24,9 +21,9 @@ type PaymentMethodsMerchantLevelApi common.Service // All parameters accepted by PaymentMethodsMerchantLevelApi.AddApplePayDomain type PaymentMethodsMerchantLevelApiAddApplePayDomainInput struct { - merchantId string + merchantId string paymentMethodId string - applePayInfo *ApplePayInfo + applePayInfo *ApplePayInfo } func (r PaymentMethodsMerchantLevelApiAddApplePayDomainInput) ApplePayInfo(applePayInfo ApplePayInfo) PaymentMethodsMerchantLevelApiAddApplePayDomainInput { @@ -34,6 +31,7 @@ func (r PaymentMethodsMerchantLevelApiAddApplePayDomainInput) ApplePayInfo(apple return r } + /* Prepare a request for AddApplePayDomain @param merchantId The unique identifier of the merchant account.@param paymentMethodId The unique identifier of the payment method. @@ -41,7 +39,7 @@ Prepare a request for AddApplePayDomain */ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomainInput(merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiAddApplePayDomainInput { return PaymentMethodsMerchantLevelApiAddApplePayDomainInput{ - merchantId: merchantId, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } @@ -60,79 +58,80 @@ To make this request, your API credential must have the following [role](https:/ @return *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, r PaymentMethodsMerchantLevelApiAddApplePayDomainInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.applePayInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.applePayInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by PaymentMethodsMerchantLevelApi.GetAllPaymentMethods type PaymentMethodsMerchantLevelApiGetAllPaymentMethodsInput struct { - merchantId string - storeId *string + merchantId string + storeId *string businessLineId *string - pageSize *int32 - pageNumber *int32 + pageSize *int32 + pageNumber *int32 } // The unique identifier of the store for which to return the payment methods. @@ -159,6 +158,7 @@ func (r PaymentMethodsMerchantLevelApiGetAllPaymentMethodsInput) PageNumber(page return r } + /* Prepare a request for GetAllPaymentMethods @param merchantId The unique identifier of the merchant account. @@ -184,89 +184,91 @@ To make this request, your API credential must have the following [role](https:/ @return PaymentMethodResponse, *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Context, r PaymentMethodsMerchantLevelApiGetAllPaymentMethodsInput) (PaymentMethodResponse, *http.Response, error) { - res := &PaymentMethodResponse{} + res := &PaymentMethodResponse{} path := "/merchants/{merchantId}/paymentMethodSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.storeId != nil { - common.ParameterAddToQuery(queryParams, "storeId", r.storeId, "") - } - if r.businessLineId != nil { - common.ParameterAddToQuery(queryParams, "businessLineId", r.businessLineId, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.storeId != nil { + common.ParameterAddToQuery(queryParams, "storeId", r.storeId, "") + } + if r.businessLineId != nil { + common.ParameterAddToQuery(queryParams, "businessLineId", r.businessLineId, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentMethodsMerchantLevelApi.GetApplePayDomains type PaymentMethodsMerchantLevelApiGetApplePayDomainsInput struct { - merchantId string + merchantId string paymentMethodId string } + /* Prepare a request for GetApplePayDomains @param merchantId The unique identifier of the merchant account.@param paymentMethodId The unique identifier of the payment method. @@ -274,7 +276,7 @@ Prepare a request for GetApplePayDomains */ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomainsInput(merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiGetApplePayDomainsInput { return PaymentMethodsMerchantLevelApiGetApplePayDomainsInput{ - merchantId: merchantId, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } @@ -293,78 +295,80 @@ To make this request, your API credential must have the following [role](https:/ @return ApplePayInfo, *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, r PaymentMethodsMerchantLevelApiGetApplePayDomainsInput) (ApplePayInfo, *http.Response, error) { - res := &ApplePayInfo{} + res := &ApplePayInfo{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentMethodsMerchantLevelApi.GetPaymentMethodDetails type PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsInput struct { - merchantId string + merchantId string paymentMethodId string } + /* Prepare a request for GetPaymentMethodDetails @param merchantId The unique identifier of the merchant account.@param paymentMethodId The unique identifier of the payment method. @@ -372,7 +376,7 @@ Prepare a request for GetPaymentMethodDetails */ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetailsInput(merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsInput { return PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsInput{ - merchantId: merchantId, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } @@ -391,75 +395,76 @@ To make this request, your API credential must have the following [role](https:/ @return PaymentMethod, *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Context, r PaymentMethodsMerchantLevelApiGetPaymentMethodDetailsInput) (PaymentMethod, *http.Response, error) { - res := &PaymentMethod{} + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentMethodsMerchantLevelApi.RequestPaymentMethod type PaymentMethodsMerchantLevelApiRequestPaymentMethodInput struct { - merchantId string + merchantId string paymentMethodSetupInfo *PaymentMethodSetupInfo } @@ -468,6 +473,7 @@ func (r PaymentMethodsMerchantLevelApiRequestPaymentMethodInput) PaymentMethodSe return r } + /* Prepare a request for RequestPaymentMethod @param merchantId The unique identifier of the merchant account. @@ -493,75 +499,76 @@ To make this request, your API credential must have the following [role](https:/ @return PaymentMethod, *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Context, r PaymentMethodsMerchantLevelApiRequestPaymentMethodInput) (PaymentMethod, *http.Response, error) { - res := &PaymentMethod{} + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentMethodSetupInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentMethodSetupInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PaymentMethodsMerchantLevelApi.UpdatePaymentMethod type PaymentMethodsMerchantLevelApiUpdatePaymentMethodInput struct { - merchantId string - paymentMethodId string + merchantId string + paymentMethodId string updatePaymentMethodInfo *UpdatePaymentMethodInfo } @@ -570,6 +577,7 @@ func (r PaymentMethodsMerchantLevelApiUpdatePaymentMethodInput) UpdatePaymentMet return r } + /* Prepare a request for UpdatePaymentMethod @param merchantId The unique identifier of the merchant account.@param paymentMethodId The unique identifier of the payment method. @@ -577,7 +585,7 @@ Prepare a request for UpdatePaymentMethod */ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethodInput(merchantId string, paymentMethodId string) PaymentMethodsMerchantLevelApiUpdatePaymentMethodInput { return PaymentMethodsMerchantLevelApiUpdatePaymentMethodInput{ - merchantId: merchantId, + merchantId: merchantId, paymentMethodId: paymentMethodId, } } @@ -596,68 +604,69 @@ To make this request, your API credential must have the following [role](https:/ @return PaymentMethod, *http.Response, error */ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context, r PaymentMethodsMerchantLevelApiUpdatePaymentMethodInput) (PaymentMethod, *http.Response, error) { - res := &PaymentMethod{} + res := &PaymentMethod{} path := "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updatePaymentMethodInfo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"paymentMethodId"+"}", url.PathEscape(common.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updatePaymentMethodInfo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_payout_settings_merchant_level.go b/src/management/api_payout_settings_merchant_level.go index 4c32aecdf..b6413e095 100644 --- a/src/management/api_payout_settings_merchant_level.go +++ b/src/management/api_payout_settings_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PayoutSettingsMerchantLevelApi service @@ -24,7 +21,7 @@ type PayoutSettingsMerchantLevelApi common.Service // All parameters accepted by PayoutSettingsMerchantLevelApi.AddPayoutSetting type PayoutSettingsMerchantLevelApiAddPayoutSettingInput struct { - merchantId string + merchantId string payoutSettingsRequest *PayoutSettingsRequest } @@ -33,6 +30,7 @@ func (r PayoutSettingsMerchantLevelApiAddPayoutSettingInput) PayoutSettingsReque return r } + /* Prepare a request for AddPayoutSetting @param merchantId The unique identifier of the merchant account. @@ -62,77 +60,79 @@ To make this request, your API credential must have the following [roles](https: @return PayoutSettings, *http.Response, error */ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r PayoutSettingsMerchantLevelApiAddPayoutSettingInput) (PayoutSettings, *http.Response, error) { - res := &PayoutSettings{} + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.payoutSettingsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.payoutSettingsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PayoutSettingsMerchantLevelApi.DeletePayoutSetting type PayoutSettingsMerchantLevelApiDeletePayoutSettingInput struct { - merchantId string + merchantId string payoutSettingsId string } + /* Prepare a request for DeletePayoutSetting @param merchantId The unique identifier of the merchant account.@param payoutSettingsId The unique identifier of the payout setting. @@ -140,7 +140,7 @@ Prepare a request for DeletePayoutSetting */ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSettingInput(merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiDeletePayoutSettingInput { return PayoutSettingsMerchantLevelApiDeletePayoutSettingInput{ - merchantId: merchantId, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -161,78 +161,80 @@ To make this request, your API credential must have the following [roles](https: @return *http.Response, error */ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context, r PayoutSettingsMerchantLevelApiDeletePayoutSettingInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by PayoutSettingsMerchantLevelApi.GetPayoutSetting type PayoutSettingsMerchantLevelApiGetPayoutSettingInput struct { - merchantId string + merchantId string payoutSettingsId string } + /* Prepare a request for GetPayoutSetting @param merchantId The unique identifier of the merchant account.@param payoutSettingsId The unique identifier of the payout setting. @@ -240,7 +242,7 @@ Prepare a request for GetPayoutSetting */ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSettingInput(merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiGetPayoutSettingInput { return PayoutSettingsMerchantLevelApiGetPayoutSettingInput{ - merchantId: merchantId, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -260,77 +262,79 @@ To make this request, your API credential must have the following [roles](https: @return PayoutSettings, *http.Response, error */ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r PayoutSettingsMerchantLevelApiGetPayoutSettingInput) (PayoutSettings, *http.Response, error) { - res := &PayoutSettings{} + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PayoutSettingsMerchantLevelApi.ListPayoutSettings type PayoutSettingsMerchantLevelApiListPayoutSettingsInput struct { merchantId string } + /* Prepare a request for ListPayoutSettings @param merchantId The unique identifier of the merchant account. @@ -357,75 +361,76 @@ To make this request, your API credential must have the following [roles](https: @return PayoutSettingsResponse, *http.Response, error */ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, r PayoutSettingsMerchantLevelApiListPayoutSettingsInput) (PayoutSettingsResponse, *http.Response, error) { - res := &PayoutSettingsResponse{} + res := &PayoutSettingsResponse{} path := "/merchants/{merchantId}/payoutSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by PayoutSettingsMerchantLevelApi.UpdatePayoutSetting type PayoutSettingsMerchantLevelApiUpdatePayoutSettingInput struct { - merchantId string - payoutSettingsId string + merchantId string + payoutSettingsId string updatePayoutSettingsRequest *UpdatePayoutSettingsRequest } @@ -434,6 +439,7 @@ func (r PayoutSettingsMerchantLevelApiUpdatePayoutSettingInput) UpdatePayoutSett return r } + /* Prepare a request for UpdatePayoutSetting @param merchantId The unique identifier of the merchant account.@param payoutSettingsId The unique identifier of the payout setting. @@ -441,7 +447,7 @@ Prepare a request for UpdatePayoutSetting */ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSettingInput(merchantId string, payoutSettingsId string) PayoutSettingsMerchantLevelApiUpdatePayoutSettingInput { return PayoutSettingsMerchantLevelApiUpdatePayoutSettingInput{ - merchantId: merchantId, + merchantId: merchantId, payoutSettingsId: payoutSettingsId, } } @@ -462,68 +468,69 @@ To make this request, your API credential must have the following [roles](https: @return PayoutSettings, *http.Response, error */ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context, r PayoutSettingsMerchantLevelApiUpdatePayoutSettingInput) (PayoutSettings, *http.Response, error) { - res := &PayoutSettings{} + res := &PayoutSettings{} path := "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updatePayoutSettingsRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"payoutSettingsId"+"}", url.PathEscape(common.ParameterValueToString(r.payoutSettingsId, "payoutSettingsId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updatePayoutSettingsRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_split_configuration_merchant_level.go b/src/management/api_split_configuration_merchant_level.go index 937e4ab9a..57ec1ff74 100644 --- a/src/management/api_split_configuration_merchant_level.go +++ b/src/management/api_split_configuration_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // SplitConfigurationMerchantLevelApi service @@ -24,8 +21,8 @@ type SplitConfigurationMerchantLevelApi common.Service // All parameters accepted by SplitConfigurationMerchantLevelApi.CreateRule type SplitConfigurationMerchantLevelApiCreateRuleInput struct { - merchantId string - splitConfigurationId string + merchantId string + splitConfigurationId string splitConfigurationRule *SplitConfigurationRule } @@ -34,6 +31,7 @@ func (r SplitConfigurationMerchantLevelApiCreateRuleInput) SplitConfigurationRul return r } + /* Prepare a request for CreateRule @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration. @@ -41,7 +39,7 @@ Prepare a request for CreateRule */ func (a *SplitConfigurationMerchantLevelApi) CreateRuleInput(merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiCreateRuleInput { return SplitConfigurationMerchantLevelApiCreateRuleInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -59,75 +57,76 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r SplitConfigurationMerchantLevelApiCreateRuleInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.splitConfigurationRule, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.splitConfigurationRule, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.CreateSplitConfiguration type SplitConfigurationMerchantLevelApiCreateSplitConfigurationInput struct { - merchantId string + merchantId string splitConfiguration *SplitConfiguration } @@ -136,6 +135,7 @@ func (r SplitConfigurationMerchantLevelApiCreateSplitConfigurationInput) SplitCo return r } + /* Prepare a request for CreateSplitConfiguration @param merchantId The unique identifier of the merchant account. @@ -160,77 +160,79 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx context.Context, r SplitConfigurationMerchantLevelApiCreateSplitConfigurationInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.splitConfiguration, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.splitConfiguration, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.DeleteSplitConfiguration type SplitConfigurationMerchantLevelApiDeleteSplitConfigurationInput struct { - merchantId string + merchantId string splitConfigurationId string } + /* Prepare a request for DeleteSplitConfiguration @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration. @@ -238,7 +240,7 @@ Prepare a request for DeleteSplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationInput(merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiDeleteSplitConfigurationInput { return SplitConfigurationMerchantLevelApiDeleteSplitConfigurationInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -256,79 +258,81 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx context.Context, r SplitConfigurationMerchantLevelApiDeleteSplitConfigurationInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.DeleteSplitConfigurationRule type SplitConfigurationMerchantLevelApiDeleteSplitConfigurationRuleInput struct { - merchantId string + merchantId string splitConfigurationId string - ruleId string + ruleId string } + /* Prepare a request for DeleteSplitConfigurationRule @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration.@param ruleId @@ -336,9 +340,9 @@ Prepare a request for DeleteSplitConfigurationRule */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRuleInput(merchantId string, splitConfigurationId string, ruleId string) SplitConfigurationMerchantLevelApiDeleteSplitConfigurationRuleInput { return SplitConfigurationMerchantLevelApiDeleteSplitConfigurationRuleInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, - ruleId: ruleId, + ruleId: ruleId, } } @@ -355,79 +359,81 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx context.Context, r SplitConfigurationMerchantLevelApiDeleteSplitConfigurationRuleInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.GetSplitConfiguration type SplitConfigurationMerchantLevelApiGetSplitConfigurationInput struct { - merchantId string + merchantId string splitConfigurationId string } + /* Prepare a request for GetSplitConfiguration @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration. @@ -435,7 +441,7 @@ Prepare a request for GetSplitConfiguration */ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfigurationInput(merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiGetSplitConfigurationInput { return SplitConfigurationMerchantLevelApiGetSplitConfigurationInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -453,77 +459,79 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.Context, r SplitConfigurationMerchantLevelApiGetSplitConfigurationInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.ListSplitConfigurations type SplitConfigurationMerchantLevelApiListSplitConfigurationsInput struct { merchantId string } + /* Prepare a request for ListSplitConfigurations @param merchantId The unique identifier of the merchant account. @@ -548,76 +556,77 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfigurationList, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context.Context, r SplitConfigurationMerchantLevelApiListSplitConfigurationsInput) (SplitConfigurationList, *http.Response, error) { - res := &SplitConfigurationList{} + res := &SplitConfigurationList{} path := "/merchants/{merchantId}/splitConfigurations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.UpdateSplitConditions type SplitConfigurationMerchantLevelApiUpdateSplitConditionsInput struct { - merchantId string - splitConfigurationId string - ruleId string + merchantId string + splitConfigurationId string + ruleId string updateSplitConfigurationRuleRequest *UpdateSplitConfigurationRuleRequest } @@ -626,6 +635,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitConditionsInput) UpdateSpli return r } + /* Prepare a request for UpdateSplitConditions @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The identifier of the split configuration.@param ruleId The unique identifier of the split configuration rule. @@ -633,9 +643,9 @@ Prepare a request for UpdateSplitConditions */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditionsInput(merchantId string, splitConfigurationId string, ruleId string) SplitConfigurationMerchantLevelApiUpdateSplitConditionsInput { return SplitConfigurationMerchantLevelApiUpdateSplitConditionsInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, - ruleId: ruleId, + ruleId: ruleId, } } @@ -652,77 +662,78 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.Context, r SplitConfigurationMerchantLevelApiUpdateSplitConditionsInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateSplitConfigurationRuleRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateSplitConfigurationRuleRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.UpdateSplitConfigurationDescription type SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionInput struct { - merchantId string - splitConfigurationId string + merchantId string + splitConfigurationId string updateSplitConfigurationRequest *UpdateSplitConfigurationRequest } @@ -731,6 +742,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionInp return r } + /* Prepare a request for UpdateSplitConfigurationDescription @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration. @@ -738,7 +750,7 @@ Prepare a request for UpdateSplitConfigurationDescription */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescriptionInput(merchantId string, splitConfigurationId string) SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionInput { return SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, } } @@ -756,78 +768,79 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription(ctx context.Context, r SplitConfigurationMerchantLevelApiUpdateSplitConfigurationDescriptionInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateSplitConfigurationRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateSplitConfigurationRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by SplitConfigurationMerchantLevelApi.UpdateSplitLogic type SplitConfigurationMerchantLevelApiUpdateSplitLogicInput struct { - merchantId string - splitConfigurationId string - ruleId string - splitLogicId string + merchantId string + splitConfigurationId string + ruleId string + splitLogicId string updateSplitConfigurationLogicRequest *UpdateSplitConfigurationLogicRequest } @@ -836,6 +849,7 @@ func (r SplitConfigurationMerchantLevelApiUpdateSplitLogicInput) UpdateSplitConf return r } + /* Prepare a request for UpdateSplitLogic @param merchantId The unique identifier of the merchant account.@param splitConfigurationId The unique identifier of the split configuration.@param ruleId The unique identifier of the split configuration rule.@param splitLogicId The unique identifier of the split configuration split. @@ -843,10 +857,10 @@ Prepare a request for UpdateSplitLogic */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogicInput(merchantId string, splitConfigurationId string, ruleId string, splitLogicId string) SplitConfigurationMerchantLevelApiUpdateSplitLogicInput { return SplitConfigurationMerchantLevelApiUpdateSplitLogicInput{ - merchantId: merchantId, + merchantId: merchantId, splitConfigurationId: splitConfigurationId, - ruleId: ruleId, - splitLogicId: splitLogicId, + ruleId: ruleId, + splitLogicId: splitLogicId, } } @@ -863,70 +877,71 @@ To make this request, your API credential must have the following [role](https:/ @return SplitConfiguration, *http.Response, error */ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Context, r SplitConfigurationMerchantLevelApiUpdateSplitLogicInput) (SplitConfiguration, *http.Response, error) { - res := &SplitConfiguration{} + res := &SplitConfiguration{} path := "/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}/splitLogic/{splitLogicId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) - path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) - path = strings.Replace(path, "{"+"splitLogicId"+"}", url.PathEscape(common.ParameterValueToString(r.splitLogicId, "splitLogicId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateSplitConfigurationLogicRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"splitConfigurationId"+"}", url.PathEscape(common.ParameterValueToString(r.splitConfigurationId, "splitConfigurationId")), -1) + path = strings.Replace(path, "{"+"ruleId"+"}", url.PathEscape(common.ParameterValueToString(r.ruleId, "ruleId")), -1) + path = strings.Replace(path, "{"+"splitLogicId"+"}", url.PathEscape(common.ParameterValueToString(r.splitLogicId, "splitLogicId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateSplitConfigurationLogicRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_actions_company_level.go b/src/management/api_terminal_actions_company_level.go index d2220527a..09d880f22 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalActionsCompanyLevelApi service @@ -25,9 +22,10 @@ type TerminalActionsCompanyLevelApi common.Service // All parameters accepted by TerminalActionsCompanyLevelApi.GetTerminalAction type TerminalActionsCompanyLevelApiGetTerminalActionInput struct { companyId string - actionId string + actionId string } + /* Prepare a request for GetTerminalAction @param companyId The unique identifier of the company account.@param actionId The unique identifier of the terminal action. @@ -36,7 +34,7 @@ Prepare a request for GetTerminalAction func (a *TerminalActionsCompanyLevelApi) GetTerminalActionInput(companyId string, actionId string) TerminalActionsCompanyLevelApiGetTerminalActionInput { return TerminalActionsCompanyLevelApiGetTerminalActionInput{ companyId: companyId, - actionId: actionId, + actionId: actionId, } } @@ -53,79 +51,80 @@ To make this request, your API credential must have one of the following [roles] @return ExternalTerminalAction, *http.Response, error */ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, r TerminalActionsCompanyLevelApiGetTerminalActionInput) (ExternalTerminalAction, *http.Response, error) { - res := &ExternalTerminalAction{} + res := &ExternalTerminalAction{} path := "/companies/{companyId}/terminalActions/{actionId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"actionId"+"}", url.PathEscape(common.ParameterValueToString(r.actionId, "actionId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"actionId"+"}", url.PathEscape(common.ParameterValueToString(r.actionId, "actionId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalActionsCompanyLevelApi.ListTerminalActions type TerminalActionsCompanyLevelApiListTerminalActionsInput struct { - companyId string + companyId string pageNumber *int32 - pageSize *int32 - status *string - type_ *string + pageSize *int32 + status *string + type_ *string } // The number of the page to fetch. @@ -152,6 +151,7 @@ func (r TerminalActionsCompanyLevelApiListTerminalActionsInput) Type_(type_ stri return r } + /* Prepare a request for ListTerminalActions @param companyId The unique identifier of the company account. @@ -176,79 +176,80 @@ To make this request, your API credential must have one of the following [roles] @return ListExternalTerminalActionsResponse, *http.Response, error */ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context, r TerminalActionsCompanyLevelApiListTerminalActionsInput) (ListExternalTerminalActionsResponse, *http.Response, error) { - res := &ListExternalTerminalActionsResponse{} + res := &ListExternalTerminalActionsResponse{} path := "/companies/{companyId}/terminalActions" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.type_ != nil { - common.ParameterAddToQuery(queryParams, "type", r.type_, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.type_ != nil { + common.ParameterAddToQuery(queryParams, "type", r.type_, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_actions_terminal_level.go b/src/management/api_terminal_actions_terminal_level.go index 450e61166..c526c94ca 100644 --- a/src/management/api_terminal_actions_terminal_level.go +++ b/src/management/api_terminal_actions_terminal_level.go @@ -10,12 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalActionsTerminalLevelApi service @@ -31,24 +29,26 @@ func (r TerminalActionsTerminalLevelApiCreateTerminalActionInput) ScheduleTermin return r } + /* Prepare a request for CreateTerminalAction @return TerminalActionsTerminalLevelApiCreateTerminalActionInput */ func (a *TerminalActionsTerminalLevelApi) CreateTerminalActionInput() TerminalActionsTerminalLevelApiCreateTerminalActionInput { - return TerminalActionsTerminalLevelApiCreateTerminalActionInput{} + return TerminalActionsTerminalLevelApiCreateTerminalActionInput{ + } } /* CreateTerminalAction Create a terminal action -Schedules a [terminal action](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api) by specifying the action and the terminals that the action must be applied to. +Schedules a [terminal action](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api) by specifying the action and the terminals that the action must be applied to. The following restrictions apply: -* You can schedule only one action at a time. For example, to install a new app version and remove an old app version, you have to make two API requests. -* The maximum number of terminals in a request is **100**. For example, to apply an action to 250 terminals, you have to divide the terminals over three API requests. -* If there is an error with one or more terminal IDs in the request, the action is scheduled for none of the terminals. You need to fix the error and try again. +* You can schedule only one action at a time. For example, to install a new app version and remove an old app version, you have to make two API requests. +* The maximum number of terminals in a request is **100**. For example, to apply an action to 250 terminals, you have to divide the terminals over three API requests. +* If there is an error with one or more terminal IDs in the request, the action is scheduled for none of the terminals. You need to fix the error and try again. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal actions read and write @@ -58,66 +58,67 @@ To make this request, your API credential must have the following [role](https:/ @return ScheduleTerminalActionsResponse, *http.Response, error */ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Context, r TerminalActionsTerminalLevelApiCreateTerminalActionInput) (ScheduleTerminalActionsResponse, *http.Response, error) { - res := &ScheduleTerminalActionsResponse{} + res := &ScheduleTerminalActionsResponse{} path := "/terminals/scheduleActions" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.scheduleTerminalActionsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.scheduleTerminalActionsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_orders_company_level.go b/src/management/api_terminal_orders_company_level.go index 769669734..470806e44 100644 --- a/src/management/api_terminal_orders_company_level.go +++ b/src/management/api_terminal_orders_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalOrdersCompanyLevelApi service @@ -25,9 +22,10 @@ type TerminalOrdersCompanyLevelApi common.Service // All parameters accepted by TerminalOrdersCompanyLevelApi.CancelOrder type TerminalOrdersCompanyLevelApiCancelOrderInput struct { companyId string - orderId string + orderId string } + /* Prepare a request for CancelOrder @param companyId The unique identifier of the company account.@param orderId The unique identifier of the order. @@ -36,7 +34,7 @@ Prepare a request for CancelOrder func (a *TerminalOrdersCompanyLevelApi) CancelOrderInput(companyId string, orderId string) TerminalOrdersCompanyLevelApiCancelOrderInput { return TerminalOrdersCompanyLevelApiCancelOrderInput{ companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -55,75 +53,76 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r TerminalOrdersCompanyLevelApiCancelOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}/cancel" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.CreateOrder type TerminalOrdersCompanyLevelApiCreateOrderInput struct { - companyId string + companyId string terminalOrderRequest *TerminalOrderRequest } @@ -132,6 +131,7 @@ func (r TerminalOrdersCompanyLevelApiCreateOrderInput) TerminalOrderRequest(term return r } + /* Prepare a request for CreateOrder @param companyId The unique identifier of the company account. @@ -157,74 +157,75 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r TerminalOrdersCompanyLevelApiCreateOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalOrderRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalOrderRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.CreateShippingLocation type TerminalOrdersCompanyLevelApiCreateShippingLocationInput struct { - companyId string + companyId string shippingLocation *ShippingLocation } @@ -233,6 +234,7 @@ func (r TerminalOrdersCompanyLevelApiCreateShippingLocationInput) ShippingLocati return r } + /* Prepare a request for CreateShippingLocation @param companyId The unique identifier of the company account. @@ -257,77 +259,79 @@ To make this request, your API credential must have the following [role](https:/ @return ShippingLocation, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Context, r TerminalOrdersCompanyLevelApiCreateShippingLocationInput) (ShippingLocation, *http.Response, error) { - res := &ShippingLocation{} + res := &ShippingLocation{} path := "/companies/{companyId}/shippingLocations" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.shippingLocation, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.shippingLocation, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.GetOrder type TerminalOrdersCompanyLevelApiGetOrderInput struct { companyId string - orderId string + orderId string } + /* Prepare a request for GetOrder @param companyId The unique identifier of the company account.@param orderId The unique identifier of the order. @@ -336,7 +340,7 @@ Prepare a request for GetOrder func (a *TerminalOrdersCompanyLevelApi) GetOrderInput(companyId string, orderId string) TerminalOrdersCompanyLevelApiGetOrderInput { return TerminalOrdersCompanyLevelApiGetOrderInput{ companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -354,76 +358,77 @@ To make this request, your API credential must have one of the following [roles] @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r TerminalOrdersCompanyLevelApiGetOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.ListBillingEntities type TerminalOrdersCompanyLevelApiListBillingEntitiesInput struct { companyId string - name *string + name *string } // The name of the billing entity. @@ -432,6 +437,7 @@ func (r TerminalOrdersCompanyLevelApiListBillingEntitiesInput) Name(name string) return r } + /* Prepare a request for ListBillingEntities @param companyId The unique identifier of the company account. @@ -458,81 +464,82 @@ To make this request, your API credential must have one of the following [roles] @return BillingEntitiesResponse, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, r TerminalOrdersCompanyLevelApiListBillingEntitiesInput) (BillingEntitiesResponse, *http.Response, error) { - res := &BillingEntitiesResponse{} + res := &BillingEntitiesResponse{} path := "/companies/{companyId}/billingEntities" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.ListOrders type TerminalOrdersCompanyLevelApiListOrdersInput struct { - companyId string + companyId string customerOrderReference *string - status *string - offset *int32 - limit *int32 + status *string + offset *int32 + limit *int32 } // Your purchase order number. @@ -559,6 +566,7 @@ func (r TerminalOrdersCompanyLevelApiListOrdersInput) Limit(limit int32) Termina return r } + /* Prepare a request for ListOrders @param companyId The unique identifier of the company account. @@ -585,89 +593,90 @@ To make this request, your API credential must have one of the following [roles] @return TerminalOrdersResponse, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r TerminalOrdersCompanyLevelApiListOrdersInput) (TerminalOrdersResponse, *http.Response, error) { - res := &TerminalOrdersResponse{} + res := &TerminalOrdersResponse{} path := "/companies/{companyId}/terminalOrders" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.customerOrderReference != nil { - common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.customerOrderReference != nil { + common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.ListShippingLocations type TerminalOrdersCompanyLevelApiListShippingLocationsInput struct { companyId string - name *string - offset *int32 - limit *int32 + name *string + offset *int32 + limit *int32 } // The name of the shipping location. @@ -688,6 +697,7 @@ func (r TerminalOrdersCompanyLevelApiListShippingLocationsInput) Limit(limit int return r } + /* Prepare a request for ListShippingLocations @param companyId The unique identifier of the company account. @@ -714,85 +724,87 @@ To make this request, your API credential must have one of the following [roles] @return ShippingLocationsResponse, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Context, r TerminalOrdersCompanyLevelApiListShippingLocationsInput) (ShippingLocationsResponse, *http.Response, error) { - res := &ShippingLocationsResponse{} + res := &ShippingLocationsResponse{} path := "/companies/{companyId}/shippingLocations" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.ListTerminalModels type TerminalOrdersCompanyLevelApiListTerminalModelsInput struct { companyId string } + /* Prepare a request for ListTerminalModels @param companyId The unique identifier of the company account. @@ -819,78 +831,79 @@ To make this request, your API credential must have one of the following [roles] @return TerminalModelsResponse, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, r TerminalOrdersCompanyLevelApiListTerminalModelsInput) (TerminalModelsResponse, *http.Response, error) { - res := &TerminalModelsResponse{} + res := &TerminalModelsResponse{} path := "/companies/{companyId}/terminalModels" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.ListTerminalProducts type TerminalOrdersCompanyLevelApiListTerminalProductsInput struct { - companyId string - country *string + companyId string + country *string terminalModelId *string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** @@ -917,6 +930,7 @@ func (r TerminalOrdersCompanyLevelApiListTerminalProductsInput) Limit(limit int3 return r } + /* Prepare a request for ListTerminalProducts @param companyId The unique identifier of the company account. @@ -932,7 +946,7 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProductsInput(companyId stri ListTerminalProducts Get a list of terminal products Returns a country-specific list of payment terminal packages and parts that the company identified in the path has access to. - + To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read * Management API—Terminal ordering read and write @@ -942,87 +956,88 @@ To make this request, your API credential must have one of the following [roles] @return TerminalProductsResponse, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context, r TerminalOrdersCompanyLevelApiListTerminalProductsInput) (TerminalProductsResponse, *http.Response, error) { - res := &TerminalProductsResponse{} + res := &TerminalProductsResponse{} path := "/companies/{companyId}/terminalProducts" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.country != nil { - common.ParameterAddToQuery(queryParams, "country", r.country, "") - } - if r.terminalModelId != nil { - common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.country != nil { + common.ParameterAddToQuery(queryParams, "country", r.country, "") + } + if r.terminalModelId != nil { + common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersCompanyLevelApi.UpdateOrder type TerminalOrdersCompanyLevelApiUpdateOrderInput struct { - companyId string - orderId string + companyId string + orderId string terminalOrderRequest *TerminalOrderRequest } @@ -1031,6 +1046,7 @@ func (r TerminalOrdersCompanyLevelApiUpdateOrderInput) TerminalOrderRequest(term return r } + /* Prepare a request for UpdateOrder @param companyId The unique identifier of the company account.@param orderId The unique identifier of the order. @@ -1039,7 +1055,7 @@ Prepare a request for UpdateOrder func (a *TerminalOrdersCompanyLevelApi) UpdateOrderInput(companyId string, orderId string) TerminalOrdersCompanyLevelApiUpdateOrderInput { return TerminalOrdersCompanyLevelApiUpdateOrderInput{ companyId: companyId, - orderId: orderId, + orderId: orderId, } } @@ -1049,7 +1065,7 @@ UpdateOrder Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. -The request body only needs to contain what you want to change. +The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provide the entire array. For example, if the array has three items: To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. @@ -1061,68 +1077,69 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r TerminalOrdersCompanyLevelApiUpdateOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/companies/{companyId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalOrderRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalOrderRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_orders_merchant_level.go b/src/management/api_terminal_orders_merchant_level.go index 663396a0e..10269d84b 100644 --- a/src/management/api_terminal_orders_merchant_level.go +++ b/src/management/api_terminal_orders_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalOrdersMerchantLevelApi service @@ -25,9 +22,10 @@ type TerminalOrdersMerchantLevelApi common.Service // All parameters accepted by TerminalOrdersMerchantLevelApi.CancelOrder type TerminalOrdersMerchantLevelApiCancelOrderInput struct { merchantId string - orderId string + orderId string } + /* Prepare a request for CancelOrder @param merchantId The unique identifier of the merchant account.@param orderId The unique identifier of the order. @@ -36,7 +34,7 @@ Prepare a request for CancelOrder func (a *TerminalOrdersMerchantLevelApi) CancelOrderInput(merchantId string, orderId string) TerminalOrdersMerchantLevelApiCancelOrderInput { return TerminalOrdersMerchantLevelApiCancelOrderInput{ merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -55,75 +53,76 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r TerminalOrdersMerchantLevelApiCancelOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}/cancel" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.CreateOrder type TerminalOrdersMerchantLevelApiCreateOrderInput struct { - merchantId string + merchantId string terminalOrderRequest *TerminalOrderRequest } @@ -132,6 +131,7 @@ func (r TerminalOrdersMerchantLevelApiCreateOrderInput) TerminalOrderRequest(ter return r } + /* Prepare a request for CreateOrder @param merchantId The unique identifier of the merchant account. @@ -157,74 +157,75 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r TerminalOrdersMerchantLevelApiCreateOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalOrderRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalOrderRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.CreateShippingLocation type TerminalOrdersMerchantLevelApiCreateShippingLocationInput struct { - merchantId string + merchantId string shippingLocation *ShippingLocation } @@ -233,6 +234,7 @@ func (r TerminalOrdersMerchantLevelApiCreateShippingLocationInput) ShippingLocat return r } + /* Prepare a request for CreateShippingLocation @param merchantId The unique identifier of the merchant account. @@ -247,7 +249,7 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocationInput(merchantId /* CreateShippingLocation Create a shipping location -Creates a shipping location for the merchant account identified in the path. A shipping location defines an address where orders can be shipped to. +Creates a shipping location for the merchant account identified in the path. A shipping location defines an address where orders can be shipped to. To make this request, your API credential must have the following [role](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API—Terminal ordering read and write @@ -257,77 +259,79 @@ To make this request, your API credential must have the following [role](https:/ @return ShippingLocation, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Context, r TerminalOrdersMerchantLevelApiCreateShippingLocationInput) (ShippingLocation, *http.Response, error) { - res := &ShippingLocation{} + res := &ShippingLocation{} path := "/merchants/{merchantId}/shippingLocations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.shippingLocation, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.shippingLocation, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.GetOrder type TerminalOrdersMerchantLevelApiGetOrderInput struct { merchantId string - orderId string + orderId string } + /* Prepare a request for GetOrder @param merchantId The unique identifier of the merchant account.@param orderId The unique identifier of the order. @@ -336,7 +340,7 @@ Prepare a request for GetOrder func (a *TerminalOrdersMerchantLevelApi) GetOrderInput(merchantId string, orderId string) TerminalOrdersMerchantLevelApiGetOrderInput { return TerminalOrdersMerchantLevelApiGetOrderInput{ merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -354,76 +358,77 @@ To make this request, your API credential must have one of the following [roles] @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r TerminalOrdersMerchantLevelApiGetOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.ListBillingEntities type TerminalOrdersMerchantLevelApiListBillingEntitiesInput struct { merchantId string - name *string + name *string } // The name of the billing entity. @@ -432,6 +437,7 @@ func (r TerminalOrdersMerchantLevelApiListBillingEntitiesInput) Name(name string return r } + /* Prepare a request for ListBillingEntities @param merchantId The unique identifier of the merchant account. @@ -458,81 +464,82 @@ To make this request, your API credential must have one of the following [roles] @return BillingEntitiesResponse, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context, r TerminalOrdersMerchantLevelApiListBillingEntitiesInput) (BillingEntitiesResponse, *http.Response, error) { - res := &BillingEntitiesResponse{} + res := &BillingEntitiesResponse{} path := "/merchants/{merchantId}/billingEntities" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.ListOrders type TerminalOrdersMerchantLevelApiListOrdersInput struct { - merchantId string + merchantId string customerOrderReference *string - status *string - offset *int32 - limit *int32 + status *string + offset *int32 + limit *int32 } // Your purchase order number. @@ -559,6 +566,7 @@ func (r TerminalOrdersMerchantLevelApiListOrdersInput) Limit(limit int32) Termin return r } + /* Prepare a request for ListOrders @param merchantId @@ -584,89 +592,90 @@ To make this request, your API credential must have one of the following [roles] @return TerminalOrdersResponse, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r TerminalOrdersMerchantLevelApiListOrdersInput) (TerminalOrdersResponse, *http.Response, error) { - res := &TerminalOrdersResponse{} + res := &TerminalOrdersResponse{} path := "/merchants/{merchantId}/terminalOrders" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.customerOrderReference != nil { - common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") - } - if r.status != nil { - common.ParameterAddToQuery(queryParams, "status", r.status, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.customerOrderReference != nil { + common.ParameterAddToQuery(queryParams, "customerOrderReference", r.customerOrderReference, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.ListShippingLocations type TerminalOrdersMerchantLevelApiListShippingLocationsInput struct { merchantId string - name *string - offset *int32 - limit *int32 + name *string + offset *int32 + limit *int32 } // The name of the shipping location. @@ -687,6 +696,7 @@ func (r TerminalOrdersMerchantLevelApiListShippingLocationsInput) Limit(limit in return r } + /* Prepare a request for ListShippingLocations @param merchantId The unique identifier of the merchant account. @@ -713,85 +723,87 @@ To make this request, your API credential must have one of the following [roles] @return ShippingLocationsResponse, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Context, r TerminalOrdersMerchantLevelApiListShippingLocationsInput) (ShippingLocationsResponse, *http.Response, error) { - res := &ShippingLocationsResponse{} + res := &ShippingLocationsResponse{} path := "/merchants/{merchantId}/shippingLocations" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.name != nil { - common.ParameterAddToQuery(queryParams, "name", r.name, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.name != nil { + common.ParameterAddToQuery(queryParams, "name", r.name, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.ListTerminalModels type TerminalOrdersMerchantLevelApiListTerminalModelsInput struct { merchantId string } + /* Prepare a request for ListTerminalModels @param merchantId The unique identifier of the merchant account. @@ -817,78 +829,79 @@ To make this request, your API credential must have one of the following [roles] @return TerminalModelsResponse, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, r TerminalOrdersMerchantLevelApiListTerminalModelsInput) (TerminalModelsResponse, *http.Response, error) { - res := &TerminalModelsResponse{} + res := &TerminalModelsResponse{} path := "/merchants/{merchantId}/terminalModels" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.ListTerminalProducts type TerminalOrdersMerchantLevelApiListTerminalProductsInput struct { - merchantId string - country *string + merchantId string + country *string terminalModelId *string - offset *int32 - limit *int32 + offset *int32 + limit *int32 } // The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** @@ -915,6 +928,7 @@ func (r TerminalOrdersMerchantLevelApiListTerminalProductsInput) Limit(limit int return r } + /* Prepare a request for ListTerminalProducts @param merchantId The unique identifier of the merchant account. @@ -940,87 +954,88 @@ To make this request, your API credential must have one of the following [roles] @return TerminalProductsResponse, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Context, r TerminalOrdersMerchantLevelApiListTerminalProductsInput) (TerminalProductsResponse, *http.Response, error) { - res := &TerminalProductsResponse{} + res := &TerminalProductsResponse{} path := "/merchants/{merchantId}/terminalProducts" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.country != nil { - common.ParameterAddToQuery(queryParams, "country", r.country, "") - } - if r.terminalModelId != nil { - common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") - } - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.country != nil { + common.ParameterAddToQuery(queryParams, "country", r.country, "") + } + if r.terminalModelId != nil { + common.ParameterAddToQuery(queryParams, "terminalModelId", r.terminalModelId, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalOrdersMerchantLevelApi.UpdateOrder type TerminalOrdersMerchantLevelApiUpdateOrderInput struct { - merchantId string - orderId string + merchantId string + orderId string terminalOrderRequest *TerminalOrderRequest } @@ -1029,6 +1044,7 @@ func (r TerminalOrdersMerchantLevelApiUpdateOrderInput) TerminalOrderRequest(ter return r } + /* Prepare a request for UpdateOrder @param merchantId The unique identifier of the merchant account.@param orderId The unique identifier of the order. @@ -1037,7 +1053,7 @@ Prepare a request for UpdateOrder func (a *TerminalOrdersMerchantLevelApi) UpdateOrderInput(merchantId string, orderId string) TerminalOrdersMerchantLevelApiUpdateOrderInput { return TerminalOrdersMerchantLevelApiUpdateOrderInput{ merchantId: merchantId, - orderId: orderId, + orderId: orderId, } } @@ -1047,7 +1063,7 @@ UpdateOrder Update an order Updates the terminal products order identified in the path. Updating is only possible while the order has the status **Placed**. -The request body only needs to contain what you want to change. +The request body only needs to contain what you want to change. However, to update the products in the `items` array, you must provide the entire array. For example, if the array has three items: To remove one item, the array must include the remaining two items. Or to add one item, the array must include all four items. @@ -1059,68 +1075,69 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalOrder, *http.Response, error */ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r TerminalOrdersMerchantLevelApiUpdateOrderInput) (TerminalOrder, *http.Response, error) { - res := &TerminalOrder{} + res := &TerminalOrder{} path := "/merchants/{merchantId}/terminalOrders/{orderId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalOrderRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"orderId"+"}", url.PathEscape(common.ParameterValueToString(r.orderId, "orderId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalOrderRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_company_level.go b/src/management/api_terminal_settings_company_level.go index 69e06047e..fa94daad4 100644 --- a/src/management/api_terminal_settings_company_level.go +++ b/src/management/api_terminal_settings_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalSettingsCompanyLevelApi service @@ -25,7 +22,7 @@ type TerminalSettingsCompanyLevelApi common.Service // All parameters accepted by TerminalSettingsCompanyLevelApi.GetTerminalLogo type TerminalSettingsCompanyLevelApiGetTerminalLogoInput struct { companyId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -34,6 +31,7 @@ func (r TerminalSettingsCompanyLevelApiGetTerminalLogoInput) Model(model string) return r } + /* Prepare a request for GetTerminalLogo @param companyId The unique identifier of the company account. @@ -48,9 +46,9 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogoInput(companyId string) /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the company identified in the path. +Returns the logo that is configured for a specific payment terminal model at the company identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -62,79 +60,81 @@ To make this request, your API credential must have one of the following [roles] @return Logo, *http.Response, error */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r TerminalSettingsCompanyLevelApiGetTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/companies/{companyId}/terminalLogos" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsCompanyLevelApi.GetTerminalSettings type TerminalSettingsCompanyLevelApiGetTerminalSettingsInput struct { companyId string } + /* Prepare a request for GetTerminalSettings @param companyId The unique identifier of the company account. @@ -163,76 +163,77 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Context, r TerminalSettingsCompanyLevelApiGetTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/companies/{companyId}/terminalSettings" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsCompanyLevelApi.UpdateTerminalLogo type TerminalSettingsCompanyLevelApiUpdateTerminalLogoInput struct { companyId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -246,6 +247,7 @@ func (r TerminalSettingsCompanyLevelApiUpdateTerminalLogoInput) Logo(logo Logo) return r } + /* Prepare a request for UpdateTerminalLogo @param companyId The unique identifier of the company account. @@ -261,7 +263,7 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogoInput(companyId stri UpdateTerminalLogo Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the company identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). +This logo applies to all terminals of the specified model under the company, unless a different logo is configured at a lower level (merchant account, store, or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from the Adyen PSP level, specify an empty logo value. @@ -273,77 +275,78 @@ To make this request, your API credential must have the following [role](https:/ @return Logo, *http.Response, error */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context, r TerminalSettingsCompanyLevelApiUpdateTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/companies/{companyId}/terminalLogos" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.logo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.logo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsCompanyLevelApi.UpdateTerminalSettings type TerminalSettingsCompanyLevelApiUpdateTerminalSettingsInput struct { - companyId string + companyId string terminalSettings *TerminalSettings } @@ -352,6 +355,7 @@ func (r TerminalSettingsCompanyLevelApiUpdateTerminalSettingsInput) TerminalSett return r } + /* Prepare a request for UpdateTerminalSettings @param companyId The unique identifier of the company account. @@ -383,67 +387,68 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Context, r TerminalSettingsCompanyLevelApiUpdateTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/companies/{companyId}/terminalSettings" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalSettings, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalSettings, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_merchant_level.go b/src/management/api_terminal_settings_merchant_level.go index dfc194651..3670ce7df 100644 --- a/src/management/api_terminal_settings_merchant_level.go +++ b/src/management/api_terminal_settings_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalSettingsMerchantLevelApi service @@ -25,7 +22,7 @@ type TerminalSettingsMerchantLevelApi common.Service // All parameters accepted by TerminalSettingsMerchantLevelApi.GetTerminalLogo type TerminalSettingsMerchantLevelApiGetTerminalLogoInput struct { merchantId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -34,6 +31,7 @@ func (r TerminalSettingsMerchantLevelApiGetTerminalLogoInput) Model(model string return r } + /* Prepare a request for GetTerminalLogo @param merchantId The unique identifier of the merchant account. @@ -48,8 +46,8 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogoInput(merchantId strin /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the merchant account identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the merchant account identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the merchant account, unless a different logo is configured at a lower level (store or individual terminal). To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -61,79 +59,81 @@ To make this request, your API credential must have one of the following [roles] @return Logo, *http.Response, error */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, r TerminalSettingsMerchantLevelApiGetTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/merchants/{merchantId}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsMerchantLevelApi.GetTerminalSettings type TerminalSettingsMerchantLevelApiGetTerminalSettingsInput struct { merchantId string } + /* Prepare a request for GetTerminalSettings @param merchantId The unique identifier of the merchant account. @@ -159,76 +159,77 @@ To make this request, your API credential must have one of the following [roles] @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Context, r TerminalSettingsMerchantLevelApiGetTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/merchants/{merchantId}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsMerchantLevelApi.UpdateTerminalLogo type TerminalSettingsMerchantLevelApiUpdateTerminalLogoInput struct { merchantId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -242,6 +243,7 @@ func (r TerminalSettingsMerchantLevelApiUpdateTerminalLogoInput) Logo(logo Logo) return r } + /* Prepare a request for UpdateTerminalLogo @param merchantId The unique identifier of the merchant account. @@ -256,7 +258,7 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogoInput(merchantId st /* UpdateTerminalLogo Update the terminal logo -Updates the logo for a specific payment terminal model at the merchant account identified in the path. You can update the logo for only one terminal model at a time. +Updates the logo for a specific payment terminal model at the merchant account identified in the path. You can update the logo for only one terminal model at a time. This logo applies to all terminals of the specified model under the merchant account, unless a different logo is configured at a lower level (store or individual terminal). * To change the logo, specify the image file as a Base64-encoded string. @@ -270,77 +272,78 @@ To make this request, your API credential must have the following [role](https:/ @return Logo, *http.Response, error */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Context, r TerminalSettingsMerchantLevelApiUpdateTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/merchants/{merchantId}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.logo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.logo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsMerchantLevelApi.UpdateTerminalSettings type TerminalSettingsMerchantLevelApiUpdateTerminalSettingsInput struct { - merchantId string + merchantId string terminalSettings *TerminalSettings } @@ -349,6 +352,7 @@ func (r TerminalSettingsMerchantLevelApiUpdateTerminalSettingsInput) TerminalSet return r } + /* Prepare a request for UpdateTerminalSettings @param merchantId The unique identifier of the merchant account. @@ -378,67 +382,68 @@ To make this request, your API credential must have the following [role](https:/ @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Context, r TerminalSettingsMerchantLevelApiUpdateTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/merchants/{merchantId}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalSettings, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalSettings, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_store_level.go b/src/management/api_terminal_settings_store_level.go index 146aed423..8911b7754 100644 --- a/src/management/api_terminal_settings_store_level.go +++ b/src/management/api_terminal_settings_store_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalSettingsStoreLevelApi service @@ -25,8 +22,8 @@ type TerminalSettingsStoreLevelApi common.Service // All parameters accepted by TerminalSettingsStoreLevelApi.GetTerminalLogo type TerminalSettingsStoreLevelApiGetTerminalLogoInput struct { merchantId string - reference string - model *string + reference string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -35,6 +32,7 @@ func (r TerminalSettingsStoreLevelApiGetTerminalLogoInput) Model(model string) T return r } + /* Prepare a request for GetTerminalLogo @param merchantId The unique identifier of the merchant account.@param reference The reference that identifies the store. @@ -43,15 +41,15 @@ Prepare a request for GetTerminalLogo func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoInput(merchantId string, reference string) TerminalSettingsStoreLevelApiGetTerminalLogoInput { return TerminalSettingsStoreLevelApiGetTerminalLogoInput{ merchantId: merchantId, - reference: reference, + reference: reference, } } /* GetTerminalLogo Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the store identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the store identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -63,79 +61,80 @@ To make this request, your API credential must have one of the following [roles] @return Logo, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r TerminalSettingsStoreLevelApiGetTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/merchants/{merchantId}/stores/{reference}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.GetTerminalLogoByStoreId type TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdInput struct { storeId string - model *string + model *string } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -144,6 +143,7 @@ func (r TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdInput) Model(model return r } + /* Prepare a request for GetTerminalLogoByStoreId @param storeId The unique identifier of the store. @@ -158,8 +158,8 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreIdInput(storeId st /* GetTerminalLogoByStoreId Get the terminal logo -Returns the logo that is configured for a specific payment terminal model at the store identified in the path. -The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. +Returns the logo that is configured for a specific payment terminal model at the store identified in the path. +The logo is returned as a Base64-encoded string. You need to Base64-decode the string to get the actual image file. This logo applies to all terminals of that model under the store unless a different logo is configured for an individual terminal. To make this request, your API credential must have one of the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): @@ -171,80 +171,82 @@ To make this request, your API credential must have one of the following [roles] @return Logo, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Context, r TerminalSettingsStoreLevelApiGetTerminalLogoByStoreIdInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/stores/{storeId}/terminalLogos" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.GetTerminalSettings type TerminalSettingsStoreLevelApiGetTerminalSettingsInput struct { merchantId string - reference string + reference string } + /* Prepare a request for GetTerminalSettings @param merchantId The unique identifier of the merchant account.@param reference The reference that identifies the store. @@ -253,7 +255,7 @@ Prepare a request for GetTerminalSettings func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsInput(merchantId string, reference string) TerminalSettingsStoreLevelApiGetTerminalSettingsInput { return TerminalSettingsStoreLevelApiGetTerminalSettingsInput{ merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -274,77 +276,79 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, r TerminalSettingsStoreLevelApiGetTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/merchants/{merchantId}/stores/{reference}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.GetTerminalSettingsByStoreId type TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdInput struct { storeId string } + /* Prepare a request for GetTerminalSettingsByStoreId @param storeId The unique identifier of the store. @@ -373,77 +377,78 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context.Context, r TerminalSettingsStoreLevelApiGetTerminalSettingsByStoreIdInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/stores/{storeId}/terminalSettings" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.UpdateTerminalLogo type TerminalSettingsStoreLevelApiUpdateTerminalLogoInput struct { merchantId string - reference string - model *string - logo *Logo + reference string + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T @@ -457,6 +462,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalLogoInput) Logo(logo Logo) Te return r } + /* Prepare a request for UpdateTerminalLogo @param merchantId The unique identifier of the merchant account.@param reference The reference that identifies the store. @@ -465,7 +471,7 @@ Prepare a request for UpdateTerminalLogo func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoInput(merchantId string, reference string) TerminalSettingsStoreLevelApiUpdateTerminalLogoInput { return TerminalSettingsStoreLevelApiUpdateTerminalLogoInput{ merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -473,7 +479,7 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoInput(merchantId strin UpdateTerminalLogo Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. +This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. @@ -486,80 +492,81 @@ To make this request, your API credential must have the following [role](https:/ @return Logo, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, r TerminalSettingsStoreLevelApiUpdateTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/merchants/{merchantId}/stores/{reference}/terminalLogos" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.logo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.logo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.UpdateTerminalLogoByStoreId type TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdInput struct { storeId string - model *string - logo *Logo + model *string + logo *Logo } // The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. @@ -573,6 +580,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdInput) Logo(logo return r } + /* Prepare a request for UpdateTerminalLogoByStoreId @param storeId The unique identifier of the store. @@ -588,7 +596,7 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreIdInput(storeId UpdateTerminalLogoByStoreId Update the terminal logo Updates the logo that is configured for a specific payment terminal model at the store identified in the path. You can update the logo for only one terminal model at a time. -This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. +This logo applies to all terminals of the specified model under the store, unless a different logo is configured for an individual terminal. * To change the logo, specify the image file as a Base64-encoded string. * To restore the logo inherited from a higher level (merchant or company account), specify an empty logo value. @@ -601,78 +609,79 @@ To make this request, your API credential must have the following [role](https:/ @return Logo, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context.Context, r TerminalSettingsStoreLevelApiUpdateTerminalLogoByStoreIdInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/stores/{storeId}/terminalLogos" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.model != nil { - common.ParameterAddToQuery(queryParams, "model", r.model, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.logo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.model != nil { + common.ParameterAddToQuery(queryParams, "model", r.model, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.logo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.UpdateTerminalSettings type TerminalSettingsStoreLevelApiUpdateTerminalSettingsInput struct { - merchantId string - reference string + merchantId string + reference string terminalSettings *TerminalSettings } @@ -681,6 +690,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalSettingsInput) TerminalSettin return r } + /* Prepare a request for UpdateTerminalSettings @param merchantId The unique identifier of the merchant account.@param reference The reference that identifies the store. @@ -689,7 +699,7 @@ Prepare a request for UpdateTerminalSettings func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsInput(merchantId string, reference string) TerminalSettingsStoreLevelApiUpdateTerminalSettingsInput { return TerminalSettingsStoreLevelApiUpdateTerminalSettingsInput{ merchantId: merchantId, - reference: reference, + reference: reference, } } @@ -713,75 +723,76 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Context, r TerminalSettingsStoreLevelApiUpdateTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/merchants/{merchantId}/stores/{reference}/terminalSettings" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalSettings, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"reference"+"}", url.PathEscape(common.ParameterValueToString(r.reference, "reference")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalSettings, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsStoreLevelApi.UpdateTerminalSettingsByStoreId type TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdInput struct { - storeId string + storeId string terminalSettings *TerminalSettings } @@ -790,6 +801,7 @@ func (r TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdInput) Termi return r } + /* Prepare a request for UpdateTerminalSettingsByStoreId @param storeId The unique identifier of the store. @@ -821,67 +833,68 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx context.Context, r TerminalSettingsStoreLevelApiUpdateTerminalSettingsByStoreIdInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/stores/{storeId}/terminalSettings" - path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalSettings, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"storeId"+"}", url.PathEscape(common.ParameterValueToString(r.storeId, "storeId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalSettings, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminal_settings_terminal_level.go b/src/management/api_terminal_settings_terminal_level.go index c0e8b2506..05b300ee4 100644 --- a/src/management/api_terminal_settings_terminal_level.go +++ b/src/management/api_terminal_settings_terminal_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalSettingsTerminalLevelApi service @@ -27,6 +24,7 @@ type TerminalSettingsTerminalLevelApiGetTerminalLogoInput struct { terminalId string } + /* Prepare a request for GetTerminalLogo @param terminalId The unique identifier of the payment terminal. @@ -53,76 +51,78 @@ To make this request, your API credential must have one of the following [roles] @return Logo, *http.Response, error */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, r TerminalSettingsTerminalLevelApiGetTerminalLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/terminals/{terminalId}/terminalLogos" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsTerminalLevelApi.GetTerminalSettings type TerminalSettingsTerminalLevelApiGetTerminalSettingsInput struct { terminalId string } + /* Prepare a request for GetTerminalSettings @param terminalId The unique identifier of the payment terminal. @@ -151,75 +151,76 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Context, r TerminalSettingsTerminalLevelApiGetTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/terminals/{terminalId}/terminalSettings" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsTerminalLevelApi.UpdateLogo type TerminalSettingsTerminalLevelApiUpdateLogoInput struct { terminalId string - logo *Logo + logo *Logo } func (r TerminalSettingsTerminalLevelApiUpdateLogoInput) Logo(logo Logo) TerminalSettingsTerminalLevelApiUpdateLogoInput { @@ -227,6 +228,7 @@ func (r TerminalSettingsTerminalLevelApiUpdateLogoInput) Logo(logo Logo) Termina return r } + /* Prepare a request for UpdateLogo @param terminalId The unique identifier of the payment terminal. @@ -254,74 +256,75 @@ To make this request, your API credential must have the following [role](https:/ @return Logo, *http.Response, error */ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r TerminalSettingsTerminalLevelApiUpdateLogoInput) (Logo, *http.Response, error) { - res := &Logo{} + res := &Logo{} path := "/terminals/{terminalId}/terminalLogos" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.logo, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.logo, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalSettingsTerminalLevelApi.UpdateTerminalSettings type TerminalSettingsTerminalLevelApiUpdateTerminalSettingsInput struct { - terminalId string + terminalId string terminalSettings *TerminalSettings } @@ -330,6 +333,7 @@ func (r TerminalSettingsTerminalLevelApiUpdateTerminalSettingsInput) TerminalSet return r } + /* Prepare a request for UpdateTerminalSettings @param terminalId The unique identifier of the payment terminal. @@ -361,67 +365,68 @@ For [sensitive terminal settings](https://docs.adyen.com/point-of-sale/automatin @return TerminalSettings, *http.Response, error */ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Context, r TerminalSettingsTerminalLevelApiUpdateTerminalSettingsInput) (TerminalSettings, *http.Response, error) { - res := &TerminalSettings{} + res := &TerminalSettings{} path := "/terminals/{terminalId}/terminalSettings" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalSettings, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalSettings, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_terminals_terminal_level.go b/src/management/api_terminals_terminal_level.go index 1c5703f49..5333002ad 100644 --- a/src/management/api_terminals_terminal_level.go +++ b/src/management/api_terminals_terminal_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TerminalsTerminalLevelApi service @@ -25,13 +22,13 @@ type TerminalsTerminalLevelApi common.Service // All parameters accepted by TerminalsTerminalLevelApi.ListTerminals type TerminalsTerminalLevelApiListTerminalsInput struct { searchQuery *string - otpQuery *string - countries *string + otpQuery *string + countries *string merchantIds *string - storeIds *string + storeIds *string brandModels *string - pageNumber *int32 - pageSize *int32 + pageNumber *int32 + pageSize *int32 } // Returns terminals with an ID that contains the specified string. If present, other query parameters are ignored. @@ -82,19 +79,21 @@ func (r TerminalsTerminalLevelApiListTerminalsInput) PageSize(pageSize int32) Te return r } + /* Prepare a request for ListTerminals @return TerminalsTerminalLevelApiListTerminalsInput */ func (a *TerminalsTerminalLevelApi) ListTerminalsInput() TerminalsTerminalLevelApiListTerminalsInput { - return TerminalsTerminalLevelApiListTerminalsInput{} + return TerminalsTerminalLevelApiListTerminalsInput{ + } } /* ListTerminals Get a list of terminals -Returns the payment terminals that the API credential has access to and that match the query parameters. +Returns the payment terminals that the API credential has access to and that match the query parameters. To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions): * Management API — Terminal actions read @@ -103,97 +102,98 @@ To make this request, your API credential must have the following [roles](https: @return ListTerminalsResponse, *http.Response, error */ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r TerminalsTerminalLevelApiListTerminalsInput) (ListTerminalsResponse, *http.Response, error) { - res := &ListTerminalsResponse{} + res := &ListTerminalsResponse{} path := "/terminals" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.searchQuery != nil { - common.ParameterAddToQuery(queryParams, "searchQuery", r.searchQuery, "") - } - if r.otpQuery != nil { - common.ParameterAddToQuery(queryParams, "otpQuery", r.otpQuery, "") - } - if r.countries != nil { - common.ParameterAddToQuery(queryParams, "countries", r.countries, "") - } - if r.merchantIds != nil { - common.ParameterAddToQuery(queryParams, "merchantIds", r.merchantIds, "") - } - if r.storeIds != nil { - common.ParameterAddToQuery(queryParams, "storeIds", r.storeIds, "") - } - if r.brandModels != nil { - common.ParameterAddToQuery(queryParams, "brandModels", r.brandModels, "") - } - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.searchQuery != nil { + common.ParameterAddToQuery(queryParams, "searchQuery", r.searchQuery, "") + } + if r.otpQuery != nil { + common.ParameterAddToQuery(queryParams, "otpQuery", r.otpQuery, "") + } + if r.countries != nil { + common.ParameterAddToQuery(queryParams, "countries", r.countries, "") + } + if r.merchantIds != nil { + common.ParameterAddToQuery(queryParams, "merchantIds", r.merchantIds, "") + } + if r.storeIds != nil { + common.ParameterAddToQuery(queryParams, "storeIds", r.storeIds, "") + } + if r.brandModels != nil { + common.ParameterAddToQuery(queryParams, "brandModels", r.brandModels, "") + } + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TerminalsTerminalLevelApi.ReassignTerminal type TerminalsTerminalLevelApiReassignTerminalInput struct { - terminalId string + terminalId string terminalReassignmentRequest *TerminalReassignmentRequest } @@ -202,6 +202,7 @@ func (r TerminalsTerminalLevelApiReassignTerminalInput) TerminalReassignmentRequ return r } + /* Prepare a request for ReassignTerminal @param terminalId The unique identifier of the payment terminal. @@ -226,67 +227,68 @@ To make this request, your API credential must have the following [role](https:/ @return *http.Response, error */ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r TerminalsTerminalLevelApiReassignTerminalInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/terminals/{terminalId}/reassign" - path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.terminalReassignmentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"terminalId"+"}", url.PathEscape(common.ParameterValueToString(r.terminalId, "terminalId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.terminalReassignmentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + diff --git a/src/management/api_users_company_level.go b/src/management/api_users_company_level.go index bf7524b0c..c95591af0 100644 --- a/src/management/api_users_company_level.go +++ b/src/management/api_users_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // UsersCompanyLevelApi service @@ -24,7 +21,7 @@ type UsersCompanyLevelApi common.Service // All parameters accepted by UsersCompanyLevelApi.CreateNewUser type UsersCompanyLevelApiCreateNewUserInput struct { - companyId string + companyId string createCompanyUserRequest *CreateCompanyUserRequest } @@ -33,6 +30,7 @@ func (r UsersCompanyLevelApiCreateNewUserInput) CreateCompanyUserRequest(createC return r } + /* Prepare a request for CreateNewUser @param companyId The unique identifier of the company account. @@ -58,77 +56,79 @@ To make this request, your API credential must have the following [role](https:/ @return CreateCompanyUserResponse, *http.Response, error */ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompanyLevelApiCreateNewUserInput) (CreateCompanyUserResponse, *http.Response, error) { - res := &CreateCompanyUserResponse{} + res := &CreateCompanyUserResponse{} path := "/companies/{companyId}/users" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createCompanyUserRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createCompanyUserRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersCompanyLevelApi.GetUserDetails type UsersCompanyLevelApiGetUserDetailsInput struct { companyId string - userId string + userId string } + /* Prepare a request for GetUserDetails @param companyId The unique identifier of the company account.@param userId The unique identifier of the user. @@ -137,7 +137,7 @@ Prepare a request for GetUserDetails func (a *UsersCompanyLevelApi) GetUserDetailsInput(companyId string, userId string) UsersCompanyLevelApiGetUserDetailsInput { return UsersCompanyLevelApiGetUserDetailsInput{ companyId: companyId, - userId: userId, + userId: userId, } } @@ -155,78 +155,79 @@ To make this request, your API credential must have the following [role](https:/ @return CompanyUser, *http.Response, error */ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompanyLevelApiGetUserDetailsInput) (CompanyUser, *http.Response, error) { - res := &CompanyUser{} + res := &CompanyUser{} path := "/companies/{companyId}/users/{userId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersCompanyLevelApi.ListUsers type UsersCompanyLevelApiListUsersInput struct { - companyId string + companyId string pageNumber *int32 - pageSize *int32 - username *string + pageSize *int32 + username *string } // The number of the page to return. @@ -247,6 +248,7 @@ func (r UsersCompanyLevelApiListUsersInput) Username(username string) UsersCompa return r } + /* Prepare a request for ListUsers @param companyId The unique identifier of the company account. @@ -272,84 +274,85 @@ To make this request, your API credential must have the following [role](https:/ @return ListCompanyUsersResponse, *http.Response, error */ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLevelApiListUsersInput) (ListCompanyUsersResponse, *http.Response, error) { - res := &ListCompanyUsersResponse{} + res := &ListCompanyUsersResponse{} path := "/companies/{companyId}/users" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.username != nil { - common.ParameterAddToQuery(queryParams, "username", r.username, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.username != nil { + common.ParameterAddToQuery(queryParams, "username", r.username, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersCompanyLevelApi.UpdateUserDetails type UsersCompanyLevelApiUpdateUserDetailsInput struct { - companyId string - userId string + companyId string + userId string updateCompanyUserRequest *UpdateCompanyUserRequest } @@ -358,6 +361,7 @@ func (r UsersCompanyLevelApiUpdateUserDetailsInput) UpdateCompanyUserRequest(upd return r } + /* Prepare a request for UpdateUserDetails @param companyId The unique identifier of the company account.@param userId The unique identifier of the user. @@ -366,7 +370,7 @@ Prepare a request for UpdateUserDetails func (a *UsersCompanyLevelApi) UpdateUserDetailsInput(companyId string, userId string) UsersCompanyLevelApiUpdateUserDetailsInput { return UsersCompanyLevelApiUpdateUserDetailsInput{ companyId: companyId, - userId: userId, + userId: userId, } } @@ -384,68 +388,69 @@ To make this request, your API credential must have the following [role](https:/ @return CompanyUser, *http.Response, error */ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCompanyLevelApiUpdateUserDetailsInput) (CompanyUser, *http.Response, error) { - res := &CompanyUser{} + res := &CompanyUser{} path := "/companies/{companyId}/users/{userId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateCompanyUserRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateCompanyUserRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_users_merchant_level.go b/src/management/api_users_merchant_level.go index efc79a915..5730cdd0b 100644 --- a/src/management/api_users_merchant_level.go +++ b/src/management/api_users_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // UsersMerchantLevelApi service @@ -24,7 +21,7 @@ type UsersMerchantLevelApi common.Service // All parameters accepted by UsersMerchantLevelApi.CreateNewUser type UsersMerchantLevelApiCreateNewUserInput struct { - merchantId string + merchantId string createMerchantUserRequest *CreateMerchantUserRequest } @@ -33,6 +30,7 @@ func (r UsersMerchantLevelApiCreateNewUserInput) CreateMerchantUserRequest(creat return r } + /* Prepare a request for CreateNewUser @param merchantId Unique identifier of the merchant. @@ -58,77 +56,79 @@ To make this request, your API credential must have the following [role](https:/ @return CreateUserResponse, *http.Response, error */ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMerchantLevelApiCreateNewUserInput) (CreateUserResponse, *http.Response, error) { - res := &CreateUserResponse{} + res := &CreateUserResponse{} path := "/merchants/{merchantId}/users" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createMerchantUserRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createMerchantUserRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersMerchantLevelApi.GetUserDetails type UsersMerchantLevelApiGetUserDetailsInput struct { merchantId string - userId string + userId string } + /* Prepare a request for GetUserDetails @param merchantId Unique identifier of the merchant.@param userId Unique identifier of the user. @@ -137,7 +137,7 @@ Prepare a request for GetUserDetails func (a *UsersMerchantLevelApi) GetUserDetailsInput(merchantId string, userId string) UsersMerchantLevelApiGetUserDetailsInput { return UsersMerchantLevelApiGetUserDetailsInput{ merchantId: merchantId, - userId: userId, + userId: userId, } } @@ -155,78 +155,79 @@ To make this request, your API credential must have the following [role](https:/ @return User, *http.Response, error */ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerchantLevelApiGetUserDetailsInput) (User, *http.Response, error) { - res := &User{} + res := &User{} path := "/merchants/{merchantId}/users/{userId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersMerchantLevelApi.ListUsers type UsersMerchantLevelApiListUsersInput struct { merchantId string pageNumber *int32 - pageSize *int32 - username *string + pageSize *int32 + username *string } // The number of the page to fetch. @@ -247,6 +248,7 @@ func (r UsersMerchantLevelApiListUsersInput) Username(username string) UsersMerc return r } + /* Prepare a request for ListUsers @param merchantId Unique identifier of the merchant. @@ -272,84 +274,85 @@ To make this request, your API credential must have the following [role](https:/ @return ListMerchantUsersResponse, *http.Response, error */ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLevelApiListUsersInput) (ListMerchantUsersResponse, *http.Response, error) { - res := &ListMerchantUsersResponse{} + res := &ListMerchantUsersResponse{} path := "/merchants/{merchantId}/users" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - if r.username != nil { - common.ParameterAddToQuery(queryParams, "username", r.username, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + if r.username != nil { + common.ParameterAddToQuery(queryParams, "username", r.username, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by UsersMerchantLevelApi.UpdateUser type UsersMerchantLevelApiUpdateUserInput struct { - merchantId string - userId string + merchantId string + userId string updateMerchantUserRequest *UpdateMerchantUserRequest } @@ -358,6 +361,7 @@ func (r UsersMerchantLevelApiUpdateUserInput) UpdateMerchantUserRequest(updateMe return r } + /* Prepare a request for UpdateUser @param merchantId Unique identifier of the merchant.@param userId Unique identifier of the user. @@ -366,7 +370,7 @@ Prepare a request for UpdateUser func (a *UsersMerchantLevelApi) UpdateUserInput(merchantId string, userId string) UsersMerchantLevelApiUpdateUserInput { return UsersMerchantLevelApiUpdateUserInput{ merchantId: merchantId, - userId: userId, + userId: userId, } } @@ -384,68 +388,69 @@ To make this request, your API credential must have the following [role](https:/ @return User, *http.Response, error */ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantLevelApiUpdateUserInput) (User, *http.Response, error) { - res := &User{} + res := &User{} path := "/merchants/{merchantId}/users/{userId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateMerchantUserRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"userId"+"}", url.PathEscape(common.ParameterValueToString(r.userId, "userId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateMerchantUserRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_webhooks_company_level.go b/src/management/api_webhooks_company_level.go index 4463707b2..9bd073469 100644 --- a/src/management/api_webhooks_company_level.go +++ b/src/management/api_webhooks_company_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // WebhooksCompanyLevelApi service @@ -28,6 +25,7 @@ type WebhooksCompanyLevelApiGenerateHmacKeyInput struct { webhookId string } + /* Prepare a request for GenerateHmacKey @param companyId The unique identifier of the company account.@param webhookId Unique identifier of the webhook configuration. @@ -53,78 +51,80 @@ To make this request, your API credential must have the following [roles](https: @return GenerateHmacKeyResponse, *http.Response, error */ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r WebhooksCompanyLevelApiGenerateHmacKeyInput) (GenerateHmacKeyResponse, *http.Response, error) { - res := &GenerateHmacKeyResponse{} + res := &GenerateHmacKeyResponse{} path := "/companies/{companyId}/webhooks/{webhookId}/generateHmac" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.GetWebhook type WebhooksCompanyLevelApiGetWebhookInput struct { companyId string webhookId string } + /* Prepare a request for GetWebhook @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account).@param webhookId Unique identifier of the webhook configuration. @@ -151,77 +151,78 @@ To make this request, your API credential must have one of the following [roles] @return Webhook, *http.Response, error */ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksCompanyLevelApiGetWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.ListAllWebhooks type WebhooksCompanyLevelApiListAllWebhooksInput struct { - companyId string + companyId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -236,6 +237,7 @@ func (r WebhooksCompanyLevelApiListAllWebhooksInput) PageSize(pageSize int32) We return r } + /* Prepare a request for ListAllWebhooks @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). @@ -261,83 +263,85 @@ To make this request, your API credential must have one of the following [roles] @return ListWebhooksResponse, *http.Response, error */ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r WebhooksCompanyLevelApiListAllWebhooksInput) (ListWebhooksResponse, *http.Response, error) { - res := &ListWebhooksResponse{} + res := &ListWebhooksResponse{} path := "/companies/{companyId}/webhooks" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.RemoveWebhook type WebhooksCompanyLevelApiRemoveWebhookInput struct { companyId string webhookId string } + /* Prepare a request for RemoveWebhook @param companyId The unique identifier of the company account.@param webhookId Unique identifier of the webhook configuration. @@ -363,75 +367,76 @@ To make this request, your API credential must have the following [roles](https: @return *http.Response, error */ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksCompanyLevelApiRemoveWebhookInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.SetUpWebhook type WebhooksCompanyLevelApiSetUpWebhookInput struct { - companyId string + companyId string createCompanyWebhookRequest *CreateCompanyWebhookRequest } @@ -440,6 +445,7 @@ func (r WebhooksCompanyLevelApiSetUpWebhookInput) CreateCompanyWebhookRequest(cr return r } + /* Prepare a request for SetUpWebhook @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). @@ -464,75 +470,76 @@ To make this request, your API credential must have the following [roles](https: @return Webhook, *http.Response, error */ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCompanyLevelApiSetUpWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/companies/{companyId}/webhooks" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createCompanyWebhookRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createCompanyWebhookRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.TestWebhook type WebhooksCompanyLevelApiTestWebhookInput struct { - companyId string - webhookId string + companyId string + webhookId string testCompanyWebhookRequest *TestCompanyWebhookRequest } @@ -541,6 +548,7 @@ func (r WebhooksCompanyLevelApiTestWebhookInput) TestCompanyWebhookRequest(testC return r } + /* Prepare a request for TestWebhook @param companyId The unique identifier of the company account.@param webhookId Unique identifier of the webhook configuration. @@ -572,76 +580,77 @@ To make this request, your API credential must have the following [roles](https: @return TestWebhookResponse, *http.Response, error */ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCompanyLevelApiTestWebhookInput) (TestWebhookResponse, *http.Response, error) { - res := &TestWebhookResponse{} + res := &TestWebhookResponse{} path := "/companies/{companyId}/webhooks/{webhookId}/test" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.testCompanyWebhookRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.testCompanyWebhookRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksCompanyLevelApi.UpdateWebhook type WebhooksCompanyLevelApiUpdateWebhookInput struct { - companyId string - webhookId string + companyId string + webhookId string updateCompanyWebhookRequest *UpdateCompanyWebhookRequest } @@ -650,6 +659,7 @@ func (r WebhooksCompanyLevelApiUpdateWebhookInput) UpdateCompanyWebhookRequest(u return r } + /* Prepare a request for UpdateWebhook @param companyId The unique identifier of the company account.@param webhookId Unique identifier of the webhook configuration. @@ -675,68 +685,69 @@ To make this request, your API credential must have the following [roles](https: @return Webhook, *http.Response, error */ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksCompanyLevelApiUpdateWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/companies/{companyId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateCompanyWebhookRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"companyId"+"}", url.PathEscape(common.ParameterValueToString(r.companyId, "companyId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateCompanyWebhookRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/api_webhooks_merchant_level.go b/src/management/api_webhooks_merchant_level.go index adcf3dff5..9f57d7844 100644 --- a/src/management/api_webhooks_merchant_level.go +++ b/src/management/api_webhooks_merchant_level.go @@ -10,13 +10,10 @@ package management import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // WebhooksMerchantLevelApi service @@ -25,9 +22,10 @@ type WebhooksMerchantLevelApi common.Service // All parameters accepted by WebhooksMerchantLevelApi.GenerateHmacKey type WebhooksMerchantLevelApiGenerateHmacKeyInput struct { merchantId string - webhookId string + webhookId string } + /* Prepare a request for GenerateHmacKey @param merchantId The unique identifier of the merchant account.@param webhookId @@ -36,7 +34,7 @@ Prepare a request for GenerateHmacKey func (a *WebhooksMerchantLevelApi) GenerateHmacKeyInput(merchantId string, webhookId string) WebhooksMerchantLevelApiGenerateHmacKeyInput { return WebhooksMerchantLevelApiGenerateHmacKeyInput{ merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -53,78 +51,80 @@ To make this request, your API credential must have the following [roles](https: @return GenerateHmacKeyResponse, *http.Response, error */ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r WebhooksMerchantLevelApiGenerateHmacKeyInput) (GenerateHmacKeyResponse, *http.Response, error) { - res := &GenerateHmacKeyResponse{} + res := &GenerateHmacKeyResponse{} path := "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.GetWebhook type WebhooksMerchantLevelApiGetWebhookInput struct { merchantId string - webhookId string + webhookId string } + /* Prepare a request for GetWebhook @param merchantId The unique identifier of the merchant account.@param webhookId Unique identifier of the webhook configuration. @@ -133,7 +133,7 @@ Prepare a request for GetWebhook func (a *WebhooksMerchantLevelApi) GetWebhookInput(merchantId string, webhookId string) WebhooksMerchantLevelApiGetWebhookInput { return WebhooksMerchantLevelApiGetWebhookInput{ merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -151,77 +151,78 @@ To make this request, your API credential must have one of the following [roles] @return Webhook, *http.Response, error */ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMerchantLevelApiGetWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.ListAllWebhooks type WebhooksMerchantLevelApiListAllWebhooksInput struct { merchantId string pageNumber *int32 - pageSize *int32 + pageSize *int32 } // The number of the page to fetch. @@ -236,6 +237,7 @@ func (r WebhooksMerchantLevelApiListAllWebhooksInput) PageSize(pageSize int32) W return r } + /* Prepare a request for ListAllWebhooks @param merchantId The unique identifier of the merchant account. @@ -261,83 +263,85 @@ To make this request, your API credential must have one of the following [roles] @return ListWebhooksResponse, *http.Response, error */ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r WebhooksMerchantLevelApiListAllWebhooksInput) (ListWebhooksResponse, *http.Response, error) { - res := &ListWebhooksResponse{} + res := &ListWebhooksResponse{} path := "/merchants/{merchantId}/webhooks" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.pageNumber != nil { - common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") - } - if r.pageSize != nil { - common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.pageNumber != nil { + common.ParameterAddToQuery(queryParams, "pageNumber", r.pageNumber, "") + } + if r.pageSize != nil { + common.ParameterAddToQuery(queryParams, "pageSize", r.pageSize, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.RemoveWebhook type WebhooksMerchantLevelApiRemoveWebhookInput struct { merchantId string - webhookId string + webhookId string } + /* Prepare a request for RemoveWebhook @param merchantId The unique identifier of the merchant account.@param webhookId Unique identifier of the webhook configuration. @@ -346,7 +350,7 @@ Prepare a request for RemoveWebhook func (a *WebhooksMerchantLevelApi) RemoveWebhookInput(merchantId string, webhookId string) WebhooksMerchantLevelApiRemoveWebhookInput { return WebhooksMerchantLevelApiRemoveWebhookInput{ merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -363,75 +367,76 @@ To make this request, your API credential must have the following [roles](https: @return *http.Response, error */ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r WebhooksMerchantLevelApiRemoveWebhookInput) (*http.Response, error) { - var res interface{} + var res interface{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodDelete, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return httpRes, decodeError - } - return httpRes, serviceError - } - - return httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodDelete, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return httpRes, decodeError + } + return httpRes, serviceError + } + + return httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.SetUpWebhook type WebhooksMerchantLevelApiSetUpWebhookInput struct { - merchantId string + merchantId string createMerchantWebhookRequest *CreateMerchantWebhookRequest } @@ -440,6 +445,7 @@ func (r WebhooksMerchantLevelApiSetUpWebhookInput) CreateMerchantWebhookRequest( return r } + /* Prepare a request for SetUpWebhook @param merchantId The unique identifier of the merchant account. @@ -464,75 +470,76 @@ To make this request, your API credential must have the following [roles](https: @return Webhook, *http.Response, error */ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksMerchantLevelApiSetUpWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/merchants/{merchantId}/webhooks" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createMerchantWebhookRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createMerchantWebhookRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.TestWebhook type WebhooksMerchantLevelApiTestWebhookInput struct { - merchantId string - webhookId string + merchantId string + webhookId string testWebhookRequest *TestWebhookRequest } @@ -541,6 +548,7 @@ func (r WebhooksMerchantLevelApiTestWebhookInput) TestWebhookRequest(testWebhook return r } + /* Prepare a request for TestWebhook @param merchantId The unique identifier of the merchant account.@param webhookId Unique identifier of the webhook configuration. @@ -549,7 +557,7 @@ Prepare a request for TestWebhook func (a *WebhooksMerchantLevelApi) TestWebhookInput(merchantId string, webhookId string) WebhooksMerchantLevelApiTestWebhookInput { return WebhooksMerchantLevelApiTestWebhookInput{ merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -570,76 +578,77 @@ To make this request, your API credential must have the following [roles](https: @return TestWebhookResponse, *http.Response, error */ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMerchantLevelApiTestWebhookInput) (TestWebhookResponse, *http.Response, error) { - res := &TestWebhookResponse{} + res := &TestWebhookResponse{} path := "/merchants/{merchantId}/webhooks/{webhookId}/test" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.testWebhookRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.testWebhookRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by WebhooksMerchantLevelApi.UpdateWebhook type WebhooksMerchantLevelApiUpdateWebhookInput struct { - merchantId string - webhookId string + merchantId string + webhookId string updateMerchantWebhookRequest *UpdateMerchantWebhookRequest } @@ -648,6 +657,7 @@ func (r WebhooksMerchantLevelApiUpdateWebhookInput) UpdateMerchantWebhookRequest return r } + /* Prepare a request for UpdateWebhook @param merchantId The unique identifier of the merchant account.@param webhookId Unique identifier of the webhook configuration. @@ -656,7 +666,7 @@ Prepare a request for UpdateWebhook func (a *WebhooksMerchantLevelApi) UpdateWebhookInput(merchantId string, webhookId string) WebhooksMerchantLevelApiUpdateWebhookInput { return WebhooksMerchantLevelApiUpdateWebhookInput{ merchantId: merchantId, - webhookId: webhookId, + webhookId: webhookId, } } @@ -673,68 +683,69 @@ To make this request, your API credential must have the following [roles](https: @return Webhook, *http.Response, error */ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r WebhooksMerchantLevelApiUpdateWebhookInput) (Webhook, *http.Response, error) { - res := &Webhook{} + res := &Webhook{} path := "/merchants/{merchantId}/webhooks/{webhookId}" - path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) - path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.updateMerchantWebhookRequest, - res, - http.MethodPatch, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"merchantId"+"}", url.PathEscape(common.ParameterValueToString(r.merchantId, "merchantId")), -1) + path = strings.Replace(path, "{"+"webhookId"+"}", url.PathEscape(common.ParameterValueToString(r.webhookId, "webhookId")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.updateMerchantWebhookRequest, + res, + http.MethodPatch, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/management/model_additional_commission.go b/src/management/model_additional_commission.go index 811392cce..354fa19fd 100644 --- a/src/management/model_additional_commission.go +++ b/src/management/model_additional_commission.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalCommission type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalCommission) SetVariablePercentage(v int64) { } func (o AdditionalCommission) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalCommission) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_additional_settings.go b/src/management/model_additional_settings.go index 2e215155f..36fc17130 100644 --- a/src/management/model_additional_settings.go +++ b/src/management/model_additional_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalSettings type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &AdditionalSettings{} // AdditionalSettings struct for AdditionalSettings type AdditionalSettings struct { - // Object containing list of event codes for which the notifcation will be sent. + // Object containing list of event codes for which the notifcation will be sent. IncludeEventCodes []string `json:"includeEventCodes,omitempty"` // Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. Properties *map[string]bool `json:"properties,omitempty"` @@ -107,7 +106,7 @@ func (o *AdditionalSettings) SetProperties(v map[string]bool) { } func (o AdditionalSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableAdditionalSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_additional_settings_response.go b/src/management/model_additional_settings_response.go index 91b44797d..319a75200 100644 --- a/src/management/model_additional_settings_response.go +++ b/src/management/model_additional_settings_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalSettingsResponse type satisfies the MappedNullable interface at compile time @@ -19,9 +18,9 @@ var _ common.MappedNullable = &AdditionalSettingsResponse{} // AdditionalSettingsResponse struct for AdditionalSettingsResponse type AdditionalSettingsResponse struct { - // Object containing list of event codes for which the notifcation will not be sent. + // Object containing list of event codes for which the notifcation will not be sent. ExcludeEventCodes []string `json:"excludeEventCodes,omitempty"` - // Object containing list of event codes for which the notifcation will be sent. + // Object containing list of event codes for which the notifcation will be sent. IncludeEventCodes []string `json:"includeEventCodes,omitempty"` // Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured. Properties *map[string]bool `json:"properties,omitempty"` @@ -141,7 +140,7 @@ func (o *AdditionalSettingsResponse) SetProperties(v map[string]bool) { } func (o AdditionalSettingsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalSettingsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_address.go b/src/management/model_address.go index d968763f2..0e82d4ed7 100644 --- a/src/management/model_address.go +++ b/src/management/model_address.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *Address) SetStreetAddress2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_afterpay_touch_info.go b/src/management/model_afterpay_touch_info.go index e6fcee01a..7949ad7b8 100644 --- a/src/management/model_afterpay_touch_info.go +++ b/src/management/model_afterpay_touch_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AfterpayTouchInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *AfterpayTouchInfo) SetSupportUrl(v string) { } func (o AfterpayTouchInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableAfterpayTouchInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_allowed_origin.go b/src/management/model_allowed_origin.go index 4fc9fe433..3fddd3671 100644 --- a/src/management/model_allowed_origin.go +++ b/src/management/model_allowed_origin.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AllowedOrigin type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *AllowedOrigin) SetId(v string) { } func (o AllowedOrigin) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullableAllowedOrigin) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_allowed_origins_response.go b/src/management/model_allowed_origins_response.go index c839eca1c..34c6bc8cf 100644 --- a/src/management/model_allowed_origins_response.go +++ b/src/management/model_allowed_origins_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AllowedOriginsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AllowedOriginsResponse) SetData(v []AllowedOrigin) { } func (o AllowedOriginsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAllowedOriginsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_amex_info.go b/src/management/model_amex_info.go index bc5fd4b36..5507294ff 100644 --- a/src/management/model_amex_info.go +++ b/src/management/model_amex_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AmexInfo type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *AmexInfo) SetServiceLevel(v string) { } func (o AmexInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableAmexInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AmexInfo) isValidServiceLevel() bool { - var allowedEnumValues = []string{"noContract", "gatewayContract", "paymentDesignatorContract"} - for _, allowed := range allowedEnumValues { - if o.GetServiceLevel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noContract", "gatewayContract", "paymentDesignatorContract" } + for _, allowed := range allowedEnumValues { + if o.GetServiceLevel() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_amount.go b/src/management/model_amount.go index 810d94bcd..dd052878e 100644 --- a/src/management/model_amount.go +++ b/src/management/model_amount.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_app.go b/src/management/model_android_app.go index 85f92e4b1..26371c3d5 100644 --- a/src/management/model_android_app.go +++ b/src/management/model_android_app.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AndroidApp type satisfies the MappedNullable interface at compile time @@ -297,7 +296,7 @@ func (o *AndroidApp) SetVersionName(v string) { } func (o AndroidApp) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -364,3 +363,6 @@ func (v *NullableAndroidApp) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_apps_response.go b/src/management/model_android_apps_response.go index 4cfc25f81..687f87050 100644 --- a/src/management/model_android_apps_response.go +++ b/src/management/model_android_apps_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AndroidAppsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AndroidAppsResponse) SetData(v []AndroidApp) { } func (o AndroidAppsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAndroidAppsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_certificate.go b/src/management/model_android_certificate.go index cff68137e..5e2df492e 100644 --- a/src/management/model_android_certificate.go +++ b/src/management/model_android_certificate.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AndroidCertificate type satisfies the MappedNullable interface at compile time @@ -271,7 +270,7 @@ func (o *AndroidCertificate) SetStatus(v string) { } func (o AndroidCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -337,3 +336,6 @@ func (v *NullableAndroidCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_android_certificates_response.go b/src/management/model_android_certificates_response.go index 48d921831..9bd6222f8 100644 --- a/src/management/model_android_certificates_response.go +++ b/src/management/model_android_certificates_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AndroidCertificatesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AndroidCertificatesResponse) SetData(v []AndroidCertificate) { } func (o AndroidCertificatesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAndroidCertificatesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_api_credential.go b/src/management/model_api_credential.go index 44fda19a8..3b8ee213e 100644 --- a/src/management/model_api_credential.go +++ b/src/management/model_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApiCredential type satisfies the MappedNullable interface at compile time @@ -302,7 +301,7 @@ func (o *ApiCredential) SetUsername(v string) { } func (o ApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -364,3 +363,6 @@ func (v *NullableApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_api_credential_links.go b/src/management/model_api_credential_links.go index cad6c5d94..29b76fede 100644 --- a/src/management/model_api_credential_links.go +++ b/src/management/model_api_credential_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApiCredentialLinks type satisfies the MappedNullable interface at compile time @@ -19,12 +18,12 @@ var _ common.MappedNullable = &ApiCredentialLinks{} // ApiCredentialLinks struct for ApiCredentialLinks type ApiCredentialLinks struct { - AllowedOrigins *LinksElement `json:"allowedOrigins,omitempty"` - Company *LinksElement `json:"company,omitempty"` - GenerateApiKey *LinksElement `json:"generateApiKey,omitempty"` + AllowedOrigins *LinksElement `json:"allowedOrigins,omitempty"` + Company *LinksElement `json:"company,omitempty"` + GenerateApiKey *LinksElement `json:"generateApiKey,omitempty"` GenerateClientKey *LinksElement `json:"generateClientKey,omitempty"` - Merchant *LinksElement `json:"merchant,omitempty"` - Self LinksElement `json:"self"` + Merchant *LinksElement `json:"merchant,omitempty"` + Self LinksElement `json:"self"` } // NewApiCredentialLinks instantiates a new ApiCredentialLinks object @@ -230,7 +229,7 @@ func (o *ApiCredentialLinks) SetSelf(v LinksElement) { } func (o ApiCredentialLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -293,3 +292,6 @@ func (v *NullableApiCredentialLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_apple_pay_info.go b/src/management/model_apple_pay_info.go index 562b76467..177f02e40 100644 --- a/src/management/model_apple_pay_info.go +++ b/src/management/model_apple_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplePayInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *ApplePayInfo) SetDomains(v []string) { } func (o ApplePayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableApplePayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_bcmc_info.go b/src/management/model_bcmc_info.go index 879750f2f..1d4dfb179 100644 --- a/src/management/model_bcmc_info.go +++ b/src/management/model_bcmc_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BcmcInfo type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &BcmcInfo{} // BcmcInfo struct for BcmcInfo type BcmcInfo struct { // Indicates if [Bancontact mobile](https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile) is enabled. - EnableBcmcMobile *bool `json:"enableBcmcMobile,omitempty"` + EnableBcmcMobile *bool `json:"enableBcmcMobile,omitempty"` TransactionDescription *TransactionDescriptionInfo `json:"transactionDescription,omitempty"` } @@ -106,7 +105,7 @@ func (o *BcmcInfo) SetTransactionDescription(v TransactionDescriptionInfo) { } func (o BcmcInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableBcmcInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_billing_entities_response.go b/src/management/model_billing_entities_response.go index 196b1a16c..e7c3250af 100644 --- a/src/management/model_billing_entities_response.go +++ b/src/management/model_billing_entities_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BillingEntitiesResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *BillingEntitiesResponse) SetData(v []BillingEntity) { } func (o BillingEntitiesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableBillingEntitiesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_billing_entity.go b/src/management/model_billing_entity.go index e69812891..c903e27d8 100644 --- a/src/management/model_billing_entity.go +++ b/src/management/model_billing_entity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BillingEntity type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *BillingEntity) SetTaxId(v string) { } func (o BillingEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableBillingEntity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_cardholder_receipt.go b/src/management/model_cardholder_receipt.go index 507fb5e55..69c7c88bf 100644 --- a/src/management/model_cardholder_receipt.go +++ b/src/management/model_cardholder_receipt.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CardholderReceipt type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *CardholderReceipt) SetHeaderForAuthorizedReceipt(v string) { } func (o CardholderReceipt) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableCardholderReceipt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_cartes_bancaires_info.go b/src/management/model_cartes_bancaires_info.go index 420656775..2084722b7 100644 --- a/src/management/model_cartes_bancaires_info.go +++ b/src/management/model_cartes_bancaires_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CartesBancairesInfo type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &CartesBancairesInfo{} // CartesBancairesInfo struct for CartesBancairesInfo type CartesBancairesInfo struct { // Cartes Bancaires SIRET. Format: 14 digits. - Siret string `json:"siret"` + Siret string `json:"siret"` TransactionDescription *TransactionDescriptionInfo `json:"transactionDescription,omitempty"` } @@ -99,7 +98,7 @@ func (o *CartesBancairesInfo) SetTransactionDescription(v TransactionDescription } func (o CartesBancairesInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableCartesBancairesInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_clearpay_info.go b/src/management/model_clearpay_info.go index cc9d7fe39..55abcbeb7 100644 --- a/src/management/model_clearpay_info.go +++ b/src/management/model_clearpay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ClearpayInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *ClearpayInfo) SetSupportUrl(v string) { } func (o ClearpayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableClearpayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_commission.go b/src/management/model_commission.go index f85c595d1..b52321f18 100644 --- a/src/management/model_commission.go +++ b/src/management/model_commission.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Commission type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Commission) SetVariablePercentage(v int64) { } func (o Commission) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommission) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company.go b/src/management/model_company.go index a2d6f8a57..dc6ed6ede 100644 --- a/src/management/model_company.go +++ b/src/management/model_company.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Company type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *Company) SetStatus(v string) { } func (o Company) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableCompany) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_api_credential.go b/src/management/model_company_api_credential.go index 08051493f..3d7a6d9b6 100644 --- a/src/management/model_company_api_credential.go +++ b/src/management/model_company_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CompanyApiCredential type satisfies the MappedNullable interface at compile time @@ -336,7 +335,7 @@ func (o *CompanyApiCredential) SetUsername(v string) { } func (o CompanyApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -401,3 +400,6 @@ func (v *NullableCompanyApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_links.go b/src/management/model_company_links.go index e2506be7e..3dbc4489a 100644 --- a/src/management/model_company_links.go +++ b/src/management/model_company_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CompanyLinks type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &CompanyLinks{} // CompanyLinks struct for CompanyLinks type CompanyLinks struct { ApiCredentials *LinksElement `json:"apiCredentials,omitempty"` - Self LinksElement `json:"self"` - Users *LinksElement `json:"users,omitempty"` - Webhooks *LinksElement `json:"webhooks,omitempty"` + Self LinksElement `json:"self"` + Users *LinksElement `json:"users,omitempty"` + Webhooks *LinksElement `json:"webhooks,omitempty"` } // NewCompanyLinks instantiates a new CompanyLinks object @@ -164,7 +163,7 @@ func (o *CompanyLinks) SetWebhooks(v LinksElement) { } func (o CompanyLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,3 +220,6 @@ func (v *NullableCompanyLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_company_user.go b/src/management/model_company_user.go index 11fd41180..f20043dda 100644 --- a/src/management/model_company_user.go +++ b/src/management/model_company_user.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CompanyUser type satisfies the MappedNullable interface at compile time @@ -31,8 +30,8 @@ type CompanyUser struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -376,7 +375,7 @@ func (o *CompanyUser) SetUsername(v string) { } func (o CompanyUser) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -446,3 +445,6 @@ func (v *NullableCompanyUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_configuration.go b/src/management/model_configuration.go index b95117afb..7b410ddb8 100644 --- a/src/management/model_configuration.go +++ b/src/management/model_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Configuration type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Configuration{} // Configuration struct for Configuration type Configuration struct { - // Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + // Payment method, like **eftpos_australia** or **mc**. See the [possible values](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). Brand string `json:"brand"` // Currency, and surcharge percentage or amount. Currencies []Currency `json:"currencies"` @@ -127,7 +126,7 @@ func (o *Configuration) SetSources(v []string) { } func (o Configuration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_connectivity.go b/src/management/model_connectivity.go index c443e9b79..a5c93b031 100644 --- a/src/management/model_connectivity.go +++ b/src/management/model_connectivity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Connectivity type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Connectivity) SetSimcardStatus(v string) { } func (o Connectivity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -124,12 +123,14 @@ func (v *NullableConnectivity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Connectivity) isValidSimcardStatus() bool { - var allowedEnumValues = []string{"ACTIVATED", "INVENTORY"} - for _, allowed := range allowedEnumValues { - if o.GetSimcardStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ACTIVATED", "INVENTORY" } + for _, allowed := range allowedEnumValues { + if o.GetSimcardStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_contact.go b/src/management/model_contact.go index bb161b1fa..cad67bd81 100644 --- a/src/management/model_contact.go +++ b/src/management/model_contact.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Contact type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *Contact) SetPhoneNumber(v string) { } func (o Contact) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableContact) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_allowed_origin_request.go b/src/management/model_create_allowed_origin_request.go index 57f15d713..adca1df4a 100644 --- a/src/management/model_create_allowed_origin_request.go +++ b/src/management/model_create_allowed_origin_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateAllowedOriginRequest type satisfies the MappedNullable interface at compile time @@ -133,7 +132,7 @@ func (o *CreateAllowedOriginRequest) SetId(v string) { } func (o CreateAllowedOriginRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -187,3 +186,6 @@ func (v *NullableCreateAllowedOriginRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_api_credential_response.go b/src/management/model_create_api_credential_response.go index 82018384a..63119fcd3 100644 --- a/src/management/model_create_api_credential_response.go +++ b/src/management/model_create_api_credential_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateApiCredentialResponse type satisfies the MappedNullable interface at compile time @@ -356,7 +355,7 @@ func (o *CreateApiCredentialResponse) SetUsername(v string) { } func (o CreateApiCredentialResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -420,3 +419,6 @@ func (v *NullableCreateApiCredentialResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_api_credential_request.go b/src/management/model_create_company_api_credential_request.go index 5e16fc3bc..27d04a680 100644 --- a/src/management/model_create_company_api_credential_request.go +++ b/src/management/model_create_company_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCompanyApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *CreateCompanyApiCredentialRequest) SetRoles(v []string) { } func (o CreateCompanyApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableCreateCompanyApiCredentialRequest) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_api_credential_response.go b/src/management/model_create_company_api_credential_response.go index 029484271..f45b5c85a 100644 --- a/src/management/model_create_company_api_credential_response.go +++ b/src/management/model_create_company_api_credential_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCompanyApiCredentialResponse type satisfies the MappedNullable interface at compile time @@ -383,7 +382,7 @@ func (o *CreateCompanyApiCredentialResponse) SetUsername(v string) { } func (o CreateCompanyApiCredentialResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -448,3 +447,6 @@ func (v *NullableCreateCompanyApiCredentialResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_user_request.go b/src/management/model_create_company_user_request.go index e33f905df..84ce7132e 100644 --- a/src/management/model_create_company_user_request.go +++ b/src/management/model_create_company_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCompanyUserRequest type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type CreateCompanyUserRequest struct { AssociatedMerchantAccounts []string `json:"associatedMerchantAccounts,omitempty"` // The email address of the user. Email string `json:"email"` - Name Name `json:"name"` + Name Name `json:"name"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -255,7 +254,7 @@ func (o *CreateCompanyUserRequest) SetUsername(v string) { } func (o CreateCompanyUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -317,3 +316,6 @@ func (v *NullableCreateCompanyUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_user_response.go b/src/management/model_create_company_user_response.go index 8f9068c64..2dfec8a3b 100644 --- a/src/management/model_create_company_user_response.go +++ b/src/management/model_create_company_user_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCompanyUserResponse type satisfies the MappedNullable interface at compile time @@ -31,8 +30,8 @@ type CreateCompanyUserResponse struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -376,7 +375,7 @@ func (o *CreateCompanyUserResponse) SetUsername(v string) { } func (o CreateCompanyUserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -446,3 +445,6 @@ func (v *NullableCreateCompanyUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_company_webhook_request.go b/src/management/model_create_company_webhook_request.go index 1c778bb0b..8d874e85f 100644 --- a/src/management/model_create_company_webhook_request.go +++ b/src/management/model_create_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,15 +25,15 @@ type CreateCompanyWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` // SSL version to access the public webhook URL specified in the `url` field. Possible values: * **TLSv1.3** * **TLSv1.2** * **HTTP** - Only allowed on Test environment. If not specified, the webhook will use `sslVersion`: **TLSv1.2**. EncryptionProtocol *string `json:"encryptionProtocol,omitempty"` - // Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **allAccounts** : Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. * **includeAccounts** : The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts** : The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. + // Shows how merchant accounts are filtered when configuring the webhook. Possible values: * **allAccounts** : Includes all merchant accounts, and does not require specifying `filterMerchantAccounts`. * **includeAccounts** : The webhook is configured for the merchant accounts listed in `filterMerchantAccounts`. * **excludeAccounts** : The webhook is not configured for the merchant accounts listed in `filterMerchantAccounts`. FilterMerchantAccountType string `json:"filterMerchantAccountType"` // A list of merchant account names that are included or excluded from receiving the webhook. Inclusion or exclusion is based on the value defined for `filterMerchantAccountType`. Required if `filterMerchantAccountType` is either: * **includeAccounts** * **excludeAccounts** Not needed for `filterMerchantAccountType`: **allAccounts**. FilterMerchantAccounts []string `json:"filterMerchantAccounts"` @@ -540,7 +539,7 @@ func (o *CreateCompanyWebhookRequest) SetUsername(v string) { } func (o CreateCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -624,39 +623,41 @@ func (v *NullableCreateCompanyWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateCompanyWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidEncryptionProtocol() bool { - var allowedEnumValues = []string{"HTTP", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetEncryptionProtocol() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetEncryptionProtocol() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *CreateCompanyWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_create_merchant_api_credential_request.go b/src/management/model_create_merchant_api_credential_request.go index 9861c15dd..1644ee432 100644 --- a/src/management/model_create_merchant_api_credential_request.go +++ b/src/management/model_create_merchant_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateMerchantApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CreateMerchantApiCredentialRequest) SetRoles(v []string) { } func (o CreateMerchantApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCreateMerchantApiCredentialRequest) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_request.go b/src/management/model_create_merchant_request.go index cf5c0db7d..ce57746c4 100644 --- a/src/management/model_create_merchant_request.go +++ b/src/management/model_create_merchant_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateMerchantRequest type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *CreateMerchantRequest) SetSalesChannels(v []string) { } func (o CreateMerchantRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -336,3 +335,6 @@ func (v *NullableCreateMerchantRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_response.go b/src/management/model_create_merchant_response.go index 6f0e4706a..8039cc83f 100644 --- a/src/management/model_create_merchant_response.go +++ b/src/management/model_create_merchant_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateMerchantResponse type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *CreateMerchantResponse) SetReference(v string) { } func (o CreateMerchantResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableCreateMerchantResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_user_request.go b/src/management/model_create_merchant_user_request.go index a726be7af..cb549dc6a 100644 --- a/src/management/model_create_merchant_user_request.go +++ b/src/management/model_create_merchant_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateMerchantUserRequest type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type CreateMerchantUserRequest struct { AccountGroups []string `json:"accountGroups,omitempty"` // The email address of the user. Email string `json:"email"` - Name Name `json:"name"` + Name Name `json:"name"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -221,7 +220,7 @@ func (o *CreateMerchantUserRequest) SetUsername(v string) { } func (o CreateMerchantUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -280,3 +279,6 @@ func (v *NullableCreateMerchantUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_create_merchant_webhook_request.go b/src/management/model_create_merchant_webhook_request.go index 90c5207fb..8db754337 100644 --- a/src/management/model_create_merchant_webhook_request.go +++ b/src/management/model_create_merchant_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateMerchantWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type CreateMerchantWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -486,7 +485,7 @@ func (o *CreateMerchantWebhookRequest) SetUsername(v string) { } func (o CreateMerchantWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -568,30 +567,32 @@ func (v *NullableCreateMerchantWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CreateMerchantWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *CreateMerchantWebhookRequest) isValidEncryptionProtocol() bool { - var allowedEnumValues = []string{"HTTP", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetEncryptionProtocol() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetEncryptionProtocol() == allowed { + return true + } + } + return false } func (o *CreateMerchantWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_create_user_response.go b/src/management/model_create_user_response.go index 0ef628695..c753ef539 100644 --- a/src/management/model_create_user_response.go +++ b/src/management/model_create_user_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time @@ -29,8 +28,8 @@ type CreateUserResponse struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -342,7 +341,7 @@ func (o *CreateUserResponse) SetUsername(v string) { } func (o CreateUserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,3 +408,6 @@ func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_currency.go b/src/management/model_currency.go index 2dd47039c..de39577ca 100644 --- a/src/management/model_currency.go +++ b/src/management/model_currency.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Currency type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *Currency) SetPercentage(v float64) { } func (o Currency) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableCurrency) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_custom_notification.go b/src/management/model_custom_notification.go index 3ece89bec..6e4023044 100644 --- a/src/management/model_custom_notification.go +++ b/src/management/model_custom_notification.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CustomNotification type satisfies the MappedNullable interface at compile time @@ -27,11 +26,11 @@ type CustomNotification struct { EventDate *time.Time `json:"eventDate,omitempty"` // Your reference for the custom test notification. MerchantReference *string `json:"merchantReference,omitempty"` - // The payment method for the payment that the notification is about. Possible values: * **amex** * **visa** * **mc** * **maestro** * **bcmc** * **paypal** * **sms** * **bankTransfer_NL** * **bankTransfer_DE** * **bankTransfer_BE** * **ideal** * **elv** * **sepadirectdebit** + // The payment method for the payment that the notification is about. Possible values: * **amex** * **visa** * **mc** * **maestro** * **bcmc** * **paypal** * **sms** * **bankTransfer_NL** * **bankTransfer_DE** * **bankTransfer_BE** * **ideal** * **elv** * **sepadirectdebit** PaymentMethod *string `json:"paymentMethod,omitempty"` // A descripton of what caused the notification. Reason *string `json:"reason,omitempty"` - // The outcome of the event which the notification is about. Set to either **true** or **false**. + // The outcome of the event which the notification is about. Set to either **true** or **false**. Success *bool `json:"success,omitempty"` } @@ -277,7 +276,7 @@ func (o *CustomNotification) SetSuccess(v bool) { } func (o CustomNotification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableCustomNotification) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_data_center.go b/src/management/model_data_center.go index efaf16515..62a7b2c14 100644 --- a/src/management/model_data_center.go +++ b/src/management/model_data_center.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DataCenter type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *DataCenter) SetName(v string) { } func (o DataCenter) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableDataCenter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_event_url.go b/src/management/model_event_url.go index 586d90515..fbd3aec1c 100644 --- a/src/management/model_event_url.go +++ b/src/management/model_event_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the EventUrl type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *EventUrl) SetEventPublicUrls(v []Url) { } func (o EventUrl) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableEventUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_external_terminal_action.go b/src/management/model_external_terminal_action.go index d7bfef437..6fbae6514 100644 --- a/src/management/model_external_terminal_action.go +++ b/src/management/model_external_terminal_action.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ExternalTerminalAction type satisfies the MappedNullable interface at compile time @@ -312,7 +311,7 @@ func (o *ExternalTerminalAction) SetTerminalId(v string) { } func (o ExternalTerminalAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -383,3 +382,6 @@ func (v *NullableExternalTerminalAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_file.go b/src/management/model_file.go index 35982aae8..b120b20ca 100644 --- a/src/management/model_file.go +++ b/src/management/model_file.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the File type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *File) SetName(v string) { } func (o File) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableFile) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_api_key_response.go b/src/management/model_generate_api_key_response.go index 469010c97..faf30b91d 100644 --- a/src/management/model_generate_api_key_response.go +++ b/src/management/model_generate_api_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GenerateApiKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateApiKeyResponse) SetApiKey(v string) { } func (o GenerateApiKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateApiKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_client_key_response.go b/src/management/model_generate_client_key_response.go index 7f28ae0b1..a807892f3 100644 --- a/src/management/model_generate_client_key_response.go +++ b/src/management/model_generate_client_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GenerateClientKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateClientKeyResponse) SetClientKey(v string) { } func (o GenerateClientKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateClientKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generate_hmac_key_response.go b/src/management/model_generate_hmac_key_response.go index 8e8903b19..ea1c10232 100644 --- a/src/management/model_generate_hmac_key_response.go +++ b/src/management/model_generate_hmac_key_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GenerateHmacKeyResponse type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GenerateHmacKeyResponse) SetHmacKey(v string) { } func (o GenerateHmacKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGenerateHmacKeyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_generic_pm_with_tdi_info.go b/src/management/model_generic_pm_with_tdi_info.go index d8966a4c9..afa76865c 100644 --- a/src/management/model_generic_pm_with_tdi_info.go +++ b/src/management/model_generic_pm_with_tdi_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GenericPmWithTdiInfo type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *GenericPmWithTdiInfo) SetTransactionDescription(v TransactionDescriptio } func (o GenericPmWithTdiInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableGenericPmWithTdiInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_giro_pay_info.go b/src/management/model_giro_pay_info.go index ddcc67ef7..b1acc33c9 100644 --- a/src/management/model_giro_pay_info.go +++ b/src/management/model_giro_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GiroPayInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GiroPayInfo) SetSupportEmail(v string) { } func (o GiroPayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGiroPayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_google_pay_info.go b/src/management/model_google_pay_info.go index 43df24af0..fb27ff6dd 100644 --- a/src/management/model_google_pay_info.go +++ b/src/management/model_google_pay_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GooglePayInfo type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *GooglePayInfo) SetReuseMerchantId(v bool) { } func (o GooglePayInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableGooglePayInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_gratuity.go b/src/management/model_gratuity.go index 16a174e30..dadefa37a 100644 --- a/src/management/model_gratuity.go +++ b/src/management/model_gratuity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Gratuity type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Gratuity) SetUsePredefinedTipEntries(v bool) { } func (o Gratuity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableGratuity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_hardware.go b/src/management/model_hardware.go index 8fa24ffd3..948459f8c 100644 --- a/src/management/model_hardware.go +++ b/src/management/model_hardware.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Hardware type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Hardware) SetRestartHour(v int32) { } func (o Hardware) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableHardware) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_id_name.go b/src/management/model_id_name.go index 2d5b626a9..a664017a4 100644 --- a/src/management/model_id_name.go +++ b/src/management/model_id_name.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IdName type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *IdName) SetName(v string) { } func (o IdName) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableIdName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_install_android_app_details.go b/src/management/model_install_android_app_details.go index 9082246ca..3a4dffec6 100644 --- a/src/management/model_install_android_app_details.go +++ b/src/management/model_install_android_app_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InstallAndroidAppDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *InstallAndroidAppDetails) SetType(v string) { } func (o InstallAndroidAppDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableInstallAndroidAppDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *InstallAndroidAppDetails) isValidType() bool { - var allowedEnumValues = []string{"InstallAndroidApp"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "InstallAndroidApp" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_install_android_certificate_details.go b/src/management/model_install_android_certificate_details.go index 283bc37f1..79e093dcf 100644 --- a/src/management/model_install_android_certificate_details.go +++ b/src/management/model_install_android_certificate_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InstallAndroidCertificateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *InstallAndroidCertificateDetails) SetType(v string) { } func (o InstallAndroidCertificateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableInstallAndroidCertificateDetails) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *InstallAndroidCertificateDetails) isValidType() bool { - var allowedEnumValues = []string{"InstallAndroidCertificate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "InstallAndroidCertificate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_invalid_field.go b/src/management/model_invalid_field.go index 568646a6b..de4db567c 100644 --- a/src/management/model_invalid_field.go +++ b/src/management/model_invalid_field.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_key.go b/src/management/model_key.go index 9d576c691..ae82a6a86 100644 --- a/src/management/model_key.go +++ b/src/management/model_key.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Key type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Key) SetVersion(v int32) { } func (o Key) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_klarna_info.go b/src/management/model_klarna_info.go index 75d4ebed0..532ac2fc1 100644 --- a/src/management/model_klarna_info.go +++ b/src/management/model_klarna_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the KlarnaInfo type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *KlarnaInfo) SetSupportEmail(v string) { } func (o KlarnaInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -208,12 +207,14 @@ func (v *NullableKlarnaInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *KlarnaInfo) isValidRegion() bool { - var allowedEnumValues = []string{"NA", "EU", "CH", "AU"} - for _, allowed := range allowedEnumValues { - if o.GetRegion() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NA", "EU", "CH", "AU" } + for _, allowed := range allowedEnumValues { + if o.GetRegion() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_links.go b/src/management/model_links.go index 5fc757fc9..09431e99e 100644 --- a/src/management/model_links.go +++ b/src/management/model_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Links type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *Links) SetSelf(v LinksElement) { } func (o Links) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_links_element.go b/src/management/model_links_element.go index f35d84a54..df2e3fd85 100644 --- a/src/management/model_links_element.go +++ b/src/management/model_links_element.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the LinksElement type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *LinksElement) SetHref(v string) { } func (o LinksElement) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableLinksElement) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_api_credentials_response.go b/src/management/model_list_company_api_credentials_response.go index 8cfac6aca..48fa6a0a9 100644 --- a/src/management/model_list_company_api_credentials_response.go +++ b/src/management/model_list_company_api_credentials_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListCompanyApiCredentialsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyApiCredentialsResponse) SetPagesTotal(v int32) { } func (o ListCompanyApiCredentialsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyApiCredentialsResponse) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_response.go b/src/management/model_list_company_response.go index a18b2d440..edbf019f0 100644 --- a/src/management/model_list_company_response.go +++ b/src/management/model_list_company_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListCompanyResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyResponse) SetPagesTotal(v int32) { } func (o ListCompanyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_company_users_response.go b/src/management/model_list_company_users_response.go index f0383a94f..da818503b 100644 --- a/src/management/model_list_company_users_response.go +++ b/src/management/model_list_company_users_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListCompanyUsersResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListCompanyUsersResponse) SetPagesTotal(v int32) { } func (o ListCompanyUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListCompanyUsersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_external_terminal_actions_response.go b/src/management/model_list_external_terminal_actions_response.go index 58c4b1c4e..858cc1386 100644 --- a/src/management/model_list_external_terminal_actions_response.go +++ b/src/management/model_list_external_terminal_actions_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListExternalTerminalActionsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ListExternalTerminalActionsResponse) SetData(v []ExternalTerminalAction } func (o ListExternalTerminalActionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableListExternalTerminalActionsResponse) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_api_credentials_response.go b/src/management/model_list_merchant_api_credentials_response.go index 6b4a5c177..e3b927c6b 100644 --- a/src/management/model_list_merchant_api_credentials_response.go +++ b/src/management/model_list_merchant_api_credentials_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListMerchantApiCredentialsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantApiCredentialsResponse) SetPagesTotal(v int32) { } func (o ListMerchantApiCredentialsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantApiCredentialsResponse) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_response.go b/src/management/model_list_merchant_response.go index 7af9b9368..1ab5e0209 100644 --- a/src/management/model_list_merchant_response.go +++ b/src/management/model_list_merchant_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListMerchantResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantResponse) SetPagesTotal(v int32) { } func (o ListMerchantResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_merchant_users_response.go b/src/management/model_list_merchant_users_response.go index 84a683e69..e8f81cd91 100644 --- a/src/management/model_list_merchant_users_response.go +++ b/src/management/model_list_merchant_users_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListMerchantUsersResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListMerchantUsersResponse) SetPagesTotal(v int32) { } func (o ListMerchantUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListMerchantUsersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_stores_response.go b/src/management/model_list_stores_response.go index 590a84833..660b0fbfb 100644 --- a/src/management/model_list_stores_response.go +++ b/src/management/model_list_stores_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListStoresResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListStoresResponse) SetPagesTotal(v int32) { } func (o ListStoresResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListStoresResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_terminals_response.go b/src/management/model_list_terminals_response.go index 9e0f2fd4c..69a863927 100644 --- a/src/management/model_list_terminals_response.go +++ b/src/management/model_list_terminals_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListTerminalsResponse type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *ListTerminalsResponse) SetPagesTotal(v int32) { } func (o ListTerminalsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -215,3 +214,6 @@ func (v *NullableListTerminalsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_list_webhooks_response.go b/src/management/model_list_webhooks_response.go index df9598790..4aa7d05bd 100644 --- a/src/management/model_list_webhooks_response.go +++ b/src/management/model_list_webhooks_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ListWebhooksResponse type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *ListWebhooksResponse) SetPagesTotal(v int32) { } func (o ListWebhooksResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -252,3 +251,6 @@ func (v *NullableListWebhooksResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_localization.go b/src/management/model_localization.go index 7b55d9e6a..c029a763a 100644 --- a/src/management/model_localization.go +++ b/src/management/model_localization.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Localization type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Localization) SetLanguage(v string) { } func (o Localization) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableLocalization) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_logo.go b/src/management/model_logo.go index daacaa18e..74f511c42 100644 --- a/src/management/model_logo.go +++ b/src/management/model_logo.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Logo type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Logo) SetData(v string) { } func (o Logo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableLogo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_me_api_credential.go b/src/management/model_me_api_credential.go index a69f0431b..d689797aa 100644 --- a/src/management/model_me_api_credential.go +++ b/src/management/model_me_api_credential.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MeApiCredential type satisfies the MappedNullable interface at compile time @@ -370,7 +369,7 @@ func (o *MeApiCredential) SetUsername(v string) { } func (o MeApiCredential) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -438,3 +437,6 @@ func (v *NullableMeApiCredential) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_meal_voucher_fr_info.go b/src/management/model_meal_voucher_fr_info.go index 29a159c12..0c6e58411 100644 --- a/src/management/model_meal_voucher_fr_info.go +++ b/src/management/model_meal_voucher_fr_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MealVoucherFRInfo type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *MealVoucherFRInfo) SetSubTypes(v []string) { } func (o MealVoucherFRInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableMealVoucherFRInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_merchant.go b/src/management/model_merchant.go index 773c69842..8f91a4482 100644 --- a/src/management/model_merchant.go +++ b/src/management/model_merchant.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Merchant type satisfies the MappedNullable interface at compile time @@ -514,7 +513,7 @@ func (o *Merchant) SetStatus(v string) { } func (o Merchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -603,3 +602,6 @@ func (v *NullableMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_merchant_links.go b/src/management/model_merchant_links.go index 6713f29c9..afe1fccbe 100644 --- a/src/management/model_merchant_links.go +++ b/src/management/model_merchant_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantLinks type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &MerchantLinks{} // MerchantLinks struct for MerchantLinks type MerchantLinks struct { ApiCredentials *LinksElement `json:"apiCredentials,omitempty"` - Self LinksElement `json:"self"` - Users *LinksElement `json:"users,omitempty"` - Webhooks *LinksElement `json:"webhooks,omitempty"` + Self LinksElement `json:"self"` + Users *LinksElement `json:"users,omitempty"` + Webhooks *LinksElement `json:"webhooks,omitempty"` } // NewMerchantLinks instantiates a new MerchantLinks object @@ -164,7 +163,7 @@ func (o *MerchantLinks) SetWebhooks(v LinksElement) { } func (o MerchantLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -221,3 +220,6 @@ func (v *NullableMerchantLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_minor_units_monetary_value.go b/src/management/model_minor_units_monetary_value.go index 2c121263f..e526465b2 100644 --- a/src/management/model_minor_units_monetary_value.go +++ b/src/management/model_minor_units_monetary_value.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MinorUnitsMonetaryValue type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *MinorUnitsMonetaryValue) SetCurrencyCode(v string) { } func (o MinorUnitsMonetaryValue) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableMinorUnitsMonetaryValue) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_name.go b/src/management/model_name.go index 914062890..9fd2419f7 100644 --- a/src/management/model_name.go +++ b/src/management/model_name.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_name2.go b/src/management/model_name2.go index 74c5e6172..8e35726e7 100644 --- a/src/management/model_name2.go +++ b/src/management/model_name2.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name2 type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Name2) SetLastName(v string) { } func (o Name2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableName2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_nexo.go b/src/management/model_nexo.go index 9ab5cd65c..bcba96431 100644 --- a/src/management/model_nexo.go +++ b/src/management/model_nexo.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Nexo type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &Nexo{} // Nexo struct for Nexo type Nexo struct { - DisplayUrls *NotificationUrl `json:"displayUrls,omitempty"` - EncryptionKey *Key `json:"encryptionKey,omitempty"` - EventUrls *EventUrl `json:"eventUrls,omitempty"` + DisplayUrls *NotificationUrl `json:"displayUrls,omitempty"` + EncryptionKey *Key `json:"encryptionKey,omitempty"` + EventUrls *EventUrl `json:"eventUrls,omitempty"` // One or more URLs to send event messages to when using Terminal API. // Deprecated - NexoEventUrls []string `json:"nexoEventUrls,omitempty"` - Notification *Notification `json:"notification,omitempty"` + NexoEventUrls []string `json:"nexoEventUrls,omitempty"` + Notification *Notification `json:"notification,omitempty"` } // NewNexo instantiates a new Nexo object @@ -209,7 +208,7 @@ func (o *Nexo) SetNotification(v Notification) { } func (o Nexo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableNexo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_notification.go b/src/management/model_notification.go index 0467a9594..30518d916 100644 --- a/src/management/model_notification.go +++ b/src/management/model_notification.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Notification type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Notification) SetShowButton(v bool) { } func (o Notification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableNotification) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_notification_url.go b/src/management/model_notification_url.go index da84a22c9..ecf1a4952 100644 --- a/src/management/model_notification_url.go +++ b/src/management/model_notification_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NotificationUrl type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *NotificationUrl) SetPublicUrls(v []Url) { } func (o NotificationUrl) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableNotificationUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_offline_processing.go b/src/management/model_offline_processing.go index e2ed58cd0..ec0727847 100644 --- a/src/management/model_offline_processing.go +++ b/src/management/model_offline_processing.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OfflineProcessing type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *OfflineProcessing) SetOfflineSwipeLimits(v []MinorUnitsMonetaryValue) { } func (o OfflineProcessing) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableOfflineProcessing) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_opi.go b/src/management/model_opi.go index e487f6a4b..8e737ea8f 100644 --- a/src/management/model_opi.go +++ b/src/management/model_opi.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Opi type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Opi) SetPayAtTableURL(v string) { } func (o Opi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_order_item.go b/src/management/model_order_item.go index 44b701f76..831d39174 100644 --- a/src/management/model_order_item.go +++ b/src/management/model_order_item.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the OrderItem type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *OrderItem) SetQuantity(v int32) { } func (o OrderItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableOrderItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_pagination_links.go b/src/management/model_pagination_links.go index e53852838..9d8869599 100644 --- a/src/management/model_pagination_links.go +++ b/src/management/model_pagination_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaginationLinks type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &PaginationLinks{} // PaginationLinks struct for PaginationLinks type PaginationLinks struct { - First LinksElement `json:"first"` - Last LinksElement `json:"last"` - Next *LinksElement `json:"next,omitempty"` - Prev *LinksElement `json:"prev,omitempty"` - Self LinksElement `json:"self"` + First LinksElement `json:"first"` + Last LinksElement `json:"last"` + Next *LinksElement `json:"next,omitempty"` + Prev *LinksElement `json:"prev,omitempty"` + Self LinksElement `json:"self"` } // NewPaginationLinks instantiates a new PaginationLinks object @@ -183,7 +182,7 @@ func (o *PaginationLinks) SetSelf(v LinksElement) { } func (o PaginationLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,3 +238,6 @@ func (v *NullablePaginationLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_passcodes.go b/src/management/model_passcodes.go index 208010722..01d5e5f20 100644 --- a/src/management/model_passcodes.go +++ b/src/management/model_passcodes.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Passcodes type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Passcodes) SetTxMenuPin(v string) { } func (o Passcodes) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullablePasscodes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_pay_at_table.go b/src/management/model_pay_at_table.go index 98bee6701..da2777a55 100644 --- a/src/management/model_pay_at_table.go +++ b/src/management/model_pay_at_table.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayAtTable type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PayAtTable) SetEnablePayAtTable(v bool) { } func (o PayAtTable) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullablePayAtTable) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayAtTable) isValidAuthenticationMethod() bool { - var allowedEnumValues = []string{"MAGSWIPE", "MKE"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "MAGSWIPE", "MKE" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationMethod() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_pay_pal_info.go b/src/management/model_pay_pal_info.go index ee4024d56..5e9e6a728 100644 --- a/src/management/model_pay_pal_info.go +++ b/src/management/model_pay_pal_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayPalInfo type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *PayPalInfo) SetSubject(v string) { } func (o PayPalInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullablePayPalInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment.go b/src/management/model_payment.go index 5d4c5b8e6..0e2fc3451 100644 --- a/src/management/model_payment.go +++ b/src/management/model_payment.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Payment type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Payment) SetHideMinorUnitsInCurrencies(v []string) { } func (o Payment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment_method.go b/src/management/model_payment_method.go index 84d498a55..82a2fa26f 100644 --- a/src/management/model_payment_method.go +++ b/src/management/model_payment_method.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethod type satisfies the MappedNullable interface at compile time @@ -21,54 +20,54 @@ var _ common.MappedNullable = &PaymentMethod{} type PaymentMethod struct { AfterpayTouch *AfterpayTouchInfo `json:"afterpayTouch,omitempty"` // Indicates whether receiving payments is allowed. This value is set to **true** by Adyen after screening your merchant account. - Allowed *bool `json:"allowed,omitempty"` - Amex *AmexInfo `json:"amex,omitempty"` + Allowed *bool `json:"allowed,omitempty"` + Amex *AmexInfo `json:"amex,omitempty"` ApplePay *ApplePayInfo `json:"applePay,omitempty"` - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` // The unique identifier of the business line. - BusinessLineId *string `json:"businessLineId,omitempty"` + BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` - Clearpay *ClearpayInfo `json:"clearpay,omitempty"` + Clearpay *ClearpayInfo `json:"clearpay,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. - Countries []string `json:"countries,omitempty"` - Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. Currencies []string `json:"currencies,omitempty"` // The list of custom routing flags to route payment to the intended acquirer. - CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` - Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` - Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` - EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` + CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). - Enabled *bool `json:"enabled,omitempty"` - GiroPay *GiroPayInfo `json:"giroPay,omitempty"` - Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` - GooglePay *GooglePayInfo `json:"googlePay,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + GooglePay *GooglePayInfo `json:"googlePay,omitempty"` // The identifier of the resource. - Id string `json:"id"` - Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` - InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` - Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` - Klarna *KlarnaInfo `json:"klarna,omitempty"` - Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` - Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` - MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` - Paypal *PayPalInfo `json:"paypal,omitempty"` + Id string `json:"id"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` + MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` + Paypal *PayPalInfo `json:"paypal,omitempty"` // Your reference for the payment method. Supported characters a-z, A-Z, 0-9. Reference *string `json:"reference,omitempty"` // The sales channel. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - Sofort *SofortInfo `json:"sofort,omitempty"` + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + Sofort *SofortInfo `json:"sofort,omitempty"` // The unique identifier of the store for which to configure the payment method, if any. - StoreIds []string `json:"storeIds,omitempty"` - Swish *SwishInfo `json:"swish,omitempty"` - Twint *TwintInfo `json:"twint,omitempty"` + StoreIds []string `json:"storeIds,omitempty"` + Swish *SwishInfo `json:"swish,omitempty"` + Twint *TwintInfo `json:"twint,omitempty"` // Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). Type *string `json:"type,omitempty"` // Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** - VerificationStatus *string `json:"verificationStatus,omitempty"` - Vipps *VippsInfo `json:"vipps,omitempty"` - Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` + VerificationStatus *string `json:"verificationStatus,omitempty"` + Vipps *VippsInfo `json:"vipps,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewPaymentMethod instantiates a new PaymentMethod object @@ -1298,7 +1297,7 @@ func (o *PaymentMethod) SetVisa(v GenericPmWithTdiInfo) { } func (o PaymentMethod) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1458,12 +1457,14 @@ func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethod) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"valid", "pending", "invalid", "rejected"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "valid", "pending", "invalid", "rejected" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payment_method_response.go b/src/management/model_payment_method_response.go index 219631c4d..1548fb83c 100644 --- a/src/management/model_payment_method_response.go +++ b/src/management/model_payment_method_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodResponse type satisfies the MappedNullable interface at compile time @@ -194,7 +193,7 @@ func (o *PaymentMethodResponse) SetTypesWithErrors(v []string) { } func (o PaymentMethodResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -252,3 +251,6 @@ func (v *NullablePaymentMethodResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payment_method_setup_info.go b/src/management/model_payment_method_setup_info.go index 247bcffc3..d7c44c4a8 100644 --- a/src/management/model_payment_method_setup_info.go +++ b/src/management/model_payment_method_setup_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodSetupInfo type satisfies the MappedNullable interface at compile time @@ -20,47 +19,47 @@ var _ common.MappedNullable = &PaymentMethodSetupInfo{} // PaymentMethodSetupInfo struct for PaymentMethodSetupInfo type PaymentMethodSetupInfo struct { AfterpayTouch *AfterpayTouchInfo `json:"afterpayTouch,omitempty"` - Amex *AmexInfo `json:"amex,omitempty"` - ApplePay *ApplePayInfo `json:"applePay,omitempty"` - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + Amex *AmexInfo `json:"amex,omitempty"` + ApplePay *ApplePayInfo `json:"applePay,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` // The unique identifier of the business line. - BusinessLineId *string `json:"businessLineId,omitempty"` + BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` - Clearpay *ClearpayInfo `json:"clearpay,omitempty"` + Clearpay *ClearpayInfo `json:"clearpay,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. - Countries []string `json:"countries,omitempty"` - Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. Currencies []string `json:"currencies,omitempty"` // The list of custom routing flags to route payment to the intended acquirer. - CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` - Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` - Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` - EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` - GiroPay *GiroPayInfo `json:"giroPay,omitempty"` - Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` - GooglePay *GooglePayInfo `json:"googlePay,omitempty"` - Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` - InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` - Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` - Klarna *KlarnaInfo `json:"klarna,omitempty"` - Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` - Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` - MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` - Paypal *PayPalInfo `json:"paypal,omitempty"` + CustomRoutingFlags []string `json:"customRoutingFlags,omitempty"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` + GiroPay *GiroPayInfo `json:"giroPay,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + GooglePay *GooglePayInfo `json:"googlePay,omitempty"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Klarna *KlarnaInfo `json:"klarna,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` + MealVoucherFR *MealVoucherFRInfo `json:"mealVoucher_FR,omitempty"` + Paypal *PayPalInfo `json:"paypal,omitempty"` // Your reference for the payment method. Supported characters a-z, A-Z, 0-9. Reference *string `json:"reference,omitempty"` - // The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. - ShopperInteraction *string `json:"shopperInteraction,omitempty"` - Sofort *SofortInfo `json:"sofort,omitempty"` + // The sales channel. Required if the merchant account does not have a sales channel. When you provide this field, it overrides the default sales channel set on the merchant account. Possible values: **eCommerce**, **pos**, **contAuth**, and **moto**. + ShopperInteraction *string `json:"shopperInteraction,omitempty"` + Sofort *SofortInfo `json:"sofort,omitempty"` // The unique identifier of the store for which to configure the payment method, if any. - StoreIds []string `json:"storeIds,omitempty"` - Swish *SwishInfo `json:"swish,omitempty"` - Twint *TwintInfo `json:"twint,omitempty"` + StoreIds []string `json:"storeIds,omitempty"` + Swish *SwishInfo `json:"swish,omitempty"` + Twint *TwintInfo `json:"twint,omitempty"` // Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). - Type string `json:"type"` - Vipps *VippsInfo `json:"vipps,omitempty"` - Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` + Type string `json:"type"` + Vipps *VippsInfo `json:"vipps,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewPaymentMethodSetupInfo instantiates a new PaymentMethodSetupInfo object @@ -1162,7 +1161,7 @@ func (o *PaymentMethodSetupInfo) SetVisa(v GenericPmWithTdiInfo) { } func (o PaymentMethodSetupInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1310,21 +1309,23 @@ func (v *NullablePaymentMethodSetupInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodSetupInfo) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"eCommerce", "pos", "moto", "contAuth"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "eCommerce", "pos", "moto", "contAuth" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *PaymentMethodSetupInfo) isValidType() bool { - var allowedEnumValues = []string{"afterpaytouch", "alipay", "alipay_hk", "amex", "applepay", "bcmc", "blik", "cartebancaire", "clearpay", "cup", "diners", "directdebit_GB", "discover", "ebanking_FI", "eftpos_australia", "elo", "elocredit", "elodebit", "girocard", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paybybank", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "afterpaytouch", "alipay", "alipay_hk", "amex", "applepay", "bcmc", "blik", "cartebancaire", "clearpay", "cup", "diners", "directdebit_GB", "discover", "ebanking_FI", "eftpos_australia", "elo", "elocredit", "elodebit", "girocard", "googlepay", "hiper", "hipercard", "ideal", "interac_card", "jcb", "klarna", "klarna_account", "klarna_paynow", "maestro", "mbway", "mc", "mcdebit", "mealVoucher_FR", "mobilepay", "multibanco", "onlineBanking_PL", "paybybank", "paypal", "payshop", "swish", "trustly", "twint", "twint_pos", "vipps", "visa", "visadebit", "vpay", "wechatpay", "wechatpay_pos" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payout_settings.go b/src/management/model_payout_settings.go index 7b52731c9..5d49e1c7b 100644 --- a/src/management/model_payout_settings.go +++ b/src/management/model_payout_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayoutSettings type satisfies the MappedNullable interface at compile time @@ -263,7 +262,7 @@ func (o *PayoutSettings) SetVerificationStatus(v string) { } func (o PayoutSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -328,21 +327,23 @@ func (v *NullablePayoutSettings) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutSettings) isValidPriority() bool { - var allowedEnumValues = []string{"first", "normal", "urgent"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "first", "normal", "urgent" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } func (o *PayoutSettings) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"invalid", "pending", "rejected", "valid"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "invalid", "pending", "rejected", "valid" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_payout_settings_request.go b/src/management/model_payout_settings_request.go index 46db05efc..589d3bf47 100644 --- a/src/management/model_payout_settings_request.go +++ b/src/management/model_payout_settings_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayoutSettingsRequest type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *PayoutSettingsRequest) SetTransferInstrumentId(v string) { } func (o PayoutSettingsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullablePayoutSettingsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_payout_settings_response.go b/src/management/model_payout_settings_response.go index 183598b2e..a412b0fa8 100644 --- a/src/management/model_payout_settings_response.go +++ b/src/management/model_payout_settings_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayoutSettingsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *PayoutSettingsResponse) SetData(v []PayoutSettings) { } func (o PayoutSettingsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullablePayoutSettingsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_profile.go b/src/management/model_profile.go index 15ae48853..1c45d0c58 100644 --- a/src/management/model_profile.go +++ b/src/management/model_profile.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Profile type satisfies the MappedNullable interface at compile time @@ -30,15 +29,15 @@ type Profile struct { // Indicates whether this is your preferred wireless network. If **true**, the terminal will try connecting to this network first. DefaultProfile *bool `json:"defaultProfile,omitempty"` // For `authType` **wpa-eap** or **wpa2-eap**. Possible values: **tls**, **peap**, **leap**, **fast** - Eap *string `json:"eap,omitempty"` - EapCaCert *File `json:"eapCaCert,omitempty"` - EapClientCert *File `json:"eapClientCert,omitempty"` - EapClientKey *File `json:"eapClientKey,omitempty"` + Eap *string `json:"eap,omitempty"` + EapCaCert *File `json:"eapCaCert,omitempty"` + EapClientCert *File `json:"eapClientCert,omitempty"` + EapClientKey *File `json:"eapClientKey,omitempty"` // For `eap` **tls**. The password of the RSA key file, if that file is password-protected. EapClientPwd *string `json:"eapClientPwd,omitempty"` // For `authType` **wpa-eap** or **wpa2-eap**. The EAP-PEAP username from your MS-CHAP account. Must match the configuration of your RADIUS server. - EapIdentity *string `json:"eapIdentity,omitempty"` - EapIntermediateCert *File `json:"eapIntermediateCert,omitempty"` + EapIdentity *string `json:"eapIdentity,omitempty"` + EapIntermediateCert *File `json:"eapIntermediateCert,omitempty"` // For `eap` **peap**. The EAP-PEAP password from your MS-CHAP account. Must match the configuration of your RADIUS server. EapPwd *string `json:"eapPwd,omitempty"` // Indicates if the network doesn't broadcast its SSID. Mandatory for Android terminals, because these terminals rely on this setting to be able to connect to any network. @@ -619,7 +618,7 @@ func (o *Profile) SetWsec(v string) { } func (o Profile) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -712,3 +711,6 @@ func (v *NullableProfile) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_receipt_options.go b/src/management/model_receipt_options.go index 089e6ef52..642a8892a 100644 --- a/src/management/model_receipt_options.go +++ b/src/management/model_receipt_options.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ReceiptOptions type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ReceiptOptions) SetQrCodeData(v string) { } func (o ReceiptOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableReceiptOptions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_receipt_printing.go b/src/management/model_receipt_printing.go index f232ade81..47c0020db 100644 --- a/src/management/model_receipt_printing.go +++ b/src/management/model_receipt_printing.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ReceiptPrinting type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *ReceiptPrinting) SetShopperVoid(v bool) { } func (o ReceiptPrinting) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -678,3 +677,6 @@ func (v *NullableReceiptPrinting) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_release_update_details.go b/src/management/model_release_update_details.go index 07f7986f7..3214a4098 100644 --- a/src/management/model_release_update_details.go +++ b/src/management/model_release_update_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ReleaseUpdateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *ReleaseUpdateDetails) SetUpdateAtFirstMaintenanceCall(v bool) { } func (o ReleaseUpdateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableReleaseUpdateDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ReleaseUpdateDetails) isValidType() bool { - var allowedEnumValues = []string{"ReleaseUpdate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ReleaseUpdate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_request_activation_response.go b/src/management/model_request_activation_response.go index 7bcd76d59..185666dfa 100644 --- a/src/management/model_request_activation_response.go +++ b/src/management/model_request_activation_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RequestActivationResponse type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *RequestActivationResponse) SetMerchantId(v string) { } func (o RequestActivationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableRequestActivationResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_rest_service_error.go b/src/management/model_rest_service_error.go index c509ba7c2..8a49a706a 100644 --- a/src/management/model_rest_service_error.go +++ b/src/management/model_rest_service_error.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type RestServiceError struct { // Detailed explanation of each validation error, when applicable. InvalidFields []InvalidField `json:"invalidFields,omitempty"` // A unique reference for the request, essentially the same as `pspReference`. - RequestId *string `json:"requestId,omitempty"` - Response map[string]interface{} `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + Response map[string]interface{} `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -309,7 +308,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -373,3 +372,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_schedule_terminal_actions_request.go b/src/management/model_schedule_terminal_actions_request.go index 846822ffd..839066fd5 100644 --- a/src/management/model_schedule_terminal_actions_request.go +++ b/src/management/model_schedule_terminal_actions_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ScheduleTerminalActionsRequest type satisfies the MappedNullable interface at compile time @@ -174,7 +173,7 @@ func (o *ScheduleTerminalActionsRequest) SetTerminalIds(v []string) { } func (o ScheduleTerminalActionsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -233,3 +232,6 @@ func (v *NullableScheduleTerminalActionsRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_schedule_terminal_actions_request_action_details.go b/src/management/model_schedule_terminal_actions_request_action_details.go index aefc52294..c62dae08f 100644 --- a/src/management/model_schedule_terminal_actions_request_action_details.go +++ b/src/management/model_schedule_terminal_actions_request_action_details.go @@ -10,15 +10,16 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // ScheduleTerminalActionsRequestActionDetails - Information about the action to take. type ScheduleTerminalActionsRequestActionDetails struct { - InstallAndroidAppDetails *InstallAndroidAppDetails - InstallAndroidCertificateDetails *InstallAndroidCertificateDetails - ReleaseUpdateDetails *ReleaseUpdateDetails - UninstallAndroidAppDetails *UninstallAndroidAppDetails + InstallAndroidAppDetails *InstallAndroidAppDetails + InstallAndroidCertificateDetails *InstallAndroidCertificateDetails + ReleaseUpdateDetails *ReleaseUpdateDetails + UninstallAndroidAppDetails *UninstallAndroidAppDetails UninstallAndroidCertificateDetails *UninstallAndroidCertificateDetails } @@ -57,6 +58,7 @@ func UninstallAndroidCertificateDetailsAsScheduleTerminalActionsRequestActionDet } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byte) error { var err error @@ -67,7 +69,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonInstallAndroidAppDetails, _ := json.Marshal(dst.InstallAndroidAppDetails) if string(jsonInstallAndroidAppDetails) == "{}" || !dst.InstallAndroidAppDetails.isValidType() { // empty struct dst.InstallAndroidAppDetails = nil - } else { + } else { match++ } } else { @@ -80,7 +82,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonInstallAndroidCertificateDetails, _ := json.Marshal(dst.InstallAndroidCertificateDetails) if string(jsonInstallAndroidCertificateDetails) == "{}" || !dst.InstallAndroidCertificateDetails.isValidType() { // empty struct dst.InstallAndroidCertificateDetails = nil - } else { + } else { match++ } } else { @@ -93,7 +95,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonReleaseUpdateDetails, _ := json.Marshal(dst.ReleaseUpdateDetails) if string(jsonReleaseUpdateDetails) == "{}" || !dst.ReleaseUpdateDetails.isValidType() { // empty struct dst.ReleaseUpdateDetails = nil - } else { + } else { match++ } } else { @@ -106,7 +108,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonUninstallAndroidAppDetails, _ := json.Marshal(dst.UninstallAndroidAppDetails) if string(jsonUninstallAndroidAppDetails) == "{}" || !dst.UninstallAndroidAppDetails.isValidType() { // empty struct dst.UninstallAndroidAppDetails = nil - } else { + } else { match++ } } else { @@ -119,7 +121,7 @@ func (dst *ScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(data []byt jsonUninstallAndroidCertificateDetails, _ := json.Marshal(dst.UninstallAndroidCertificateDetails) if string(jsonUninstallAndroidCertificateDetails) == "{}" || !dst.UninstallAndroidCertificateDetails.isValidType() { // empty struct dst.UninstallAndroidCertificateDetails = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (src ScheduleTerminalActionsRequestActionDetails) MarshalJSON() ([]byte, er } // Get the actual instance -func (obj *ScheduleTerminalActionsRequestActionDetails) GetActualInstance() interface{} { +func (obj *ScheduleTerminalActionsRequestActionDetails) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -231,3 +233,5 @@ func (v *NullableScheduleTerminalActionsRequestActionDetails) UnmarshalJSON(src v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/management/model_schedule_terminal_actions_response.go b/src/management/model_schedule_terminal_actions_response.go index 157a8014e..7830bfdc8 100644 --- a/src/management/model_schedule_terminal_actions_response.go +++ b/src/management/model_schedule_terminal_actions_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ScheduleTerminalActionsResponse type satisfies the MappedNullable interface at compile time @@ -276,7 +275,7 @@ func (o *ScheduleTerminalActionsResponse) SetTotalScheduled(v int32) { } func (o ScheduleTerminalActionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableScheduleTerminalActionsResponse) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_settings.go b/src/management/model_settings.go index 6dda6c775..d8a3f64e8 100644 --- a/src/management/model_settings.go +++ b/src/management/model_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Settings type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Settings) SetTimeout(v int32) { } func (o Settings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_shipping_location.go b/src/management/model_shipping_location.go index ca8dd1ab2..42a1eff25 100644 --- a/src/management/model_shipping_location.go +++ b/src/management/model_shipping_location.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ShippingLocation type satisfies the MappedNullable interface at compile time @@ -173,7 +172,7 @@ func (o *ShippingLocation) SetName(v string) { } func (o ShippingLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,3 +231,6 @@ func (v *NullableShippingLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_shipping_locations_response.go b/src/management/model_shipping_locations_response.go index a8b8a60c9..3e7455fc8 100644 --- a/src/management/model_shipping_locations_response.go +++ b/src/management/model_shipping_locations_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ShippingLocationsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ShippingLocationsResponse) SetData(v []ShippingLocation) { } func (o ShippingLocationsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableShippingLocationsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_signature.go b/src/management/model_signature.go index b6d8aaae3..a349aaea3 100644 --- a/src/management/model_signature.go +++ b/src/management/model_signature.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Signature type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Signature) SetSkipSignature(v bool) { } func (o Signature) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSignature) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_sofort_info.go b/src/management/model_sofort_info.go index b80581a30..985c06786 100644 --- a/src/management/model_sofort_info.go +++ b/src/management/model_sofort_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SofortInfo type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *SofortInfo) SetLogo(v string) { } func (o SofortInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableSofortInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration.go b/src/management/model_split_configuration.go index 1b39ff815..6b813f43c 100644 --- a/src/management/model_split_configuration.go +++ b/src/management/model_split_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitConfiguration type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *SplitConfiguration) SetStores(v []string) { } func (o SplitConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableSplitConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration_list.go b/src/management/model_split_configuration_list.go index 4d7e95cd9..711156eac 100644 --- a/src/management/model_split_configuration_list.go +++ b/src/management/model_split_configuration_list.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitConfigurationList type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *SplitConfigurationList) SetData(v []SplitConfiguration) { } func (o SplitConfigurationList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableSplitConfigurationList) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_split_configuration_logic.go b/src/management/model_split_configuration_logic.go index f60899512..6e86ed038 100644 --- a/src/management/model_split_configuration_logic.go +++ b/src/management/model_split_configuration_logic.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitConfigurationLogic type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &SplitConfigurationLogic{} // SplitConfigurationLogic struct for SplitConfigurationLogic type SplitConfigurationLogic struct { // Specifies the logic to apply when booking the transaction fees. Should be combined with adyenFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. - AcquiringFees *string `json:"acquiringFees,omitempty"` + AcquiringFees *string `json:"acquiringFees,omitempty"` AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, interchange & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. AdyenCommission *string `json:"adyenCommission,omitempty"` @@ -31,8 +30,8 @@ type SplitConfigurationLogic struct { // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. Chargeback *string `json:"chargeback,omitempty"` // Specifies the logic to apply when allocating the chargeback costs. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount** - ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` - Commission Commission `json:"commission"` + ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` + Commission Commission `json:"commission"` // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. Interchange *string `json:"interchange,omitempty"` // Specifies the logic to apply when booking the transaction fees. Cannot be combined with other fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -540,7 +539,7 @@ func (o *SplitConfigurationLogic) SetTip(v string) { } func (o SplitConfigurationLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -631,111 +630,113 @@ func (v *NullableSplitConfigurationLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SplitConfigurationLogic) isValidAcquiringFees() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAcquiringFees() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAcquiringFees() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidAdyenCommission() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenCommission() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenCommission() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidAdyenFees() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenFees() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenFees() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidAdyenMarkup() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenMarkup() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenMarkup() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidChargeback() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} - for _, allowed := range allowedEnumValues { - if o.GetChargeback() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio" } + for _, allowed := range allowedEnumValues { + if o.GetChargeback() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidChargebackCostAllocation() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetChargebackCostAllocation() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetChargebackCostAllocation() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidInterchange() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetInterchange() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetInterchange() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidPaymentFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentFee() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidRemainder() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetRemainder() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetRemainder() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidSchemeFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSchemeFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSchemeFee() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidSurcharge() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSurcharge() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSurcharge() == allowed { + return true + } + } + return false } func (o *SplitConfigurationLogic) isValidTip() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetTip() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetTip() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_split_configuration_rule.go b/src/management/model_split_configuration_rule.go index c43f32bc9..d7b504c91 100644 --- a/src/management/model_split_configuration_rule.go +++ b/src/management/model_split_configuration_rule.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitConfigurationRule type satisfies the MappedNullable interface at compile time @@ -28,8 +27,8 @@ type SplitConfigurationRule struct { // The unique identifier of the split configuration rule. RuleId *string `json:"ruleId,omitempty"` // The sales channel condition that defines whether the split logic applies. Possible values: * **Ecommerce**: Online transactions where the cardholder is present. * **ContAuth**: Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). * **Moto**: Mail-order and telephone-order transactions where the customer is in contact with the merchant via email or telephone. * **POS**: Point-of-sale transactions where the customer is physically present to make a payment using a secure payment terminal. * **ANY**: All sales channels. - ShopperInteraction string `json:"shopperInteraction"` - SplitLogic SplitConfigurationLogic `json:"splitLogic"` + ShopperInteraction string `json:"shopperInteraction"` + SplitLogic SplitConfigurationLogic `json:"splitLogic"` } // NewSplitConfigurationRule instantiates a new SplitConfigurationRule object @@ -214,7 +213,7 @@ func (o *SplitConfigurationRule) SetSplitLogic(v SplitConfigurationLogic) { } func (o SplitConfigurationRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,21 +271,23 @@ func (v *NullableSplitConfigurationRule) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SplitConfigurationRule) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit", "ANY"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit", "ANY" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *SplitConfigurationRule) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS", "ANY"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS", "ANY" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_standalone.go b/src/management/model_standalone.go index a59ca01a1..4ab71f1bd 100644 --- a/src/management/model_standalone.go +++ b/src/management/model_standalone.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Standalone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Standalone) SetEnableStandalone(v bool) { } func (o Standalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store.go b/src/management/model_store.go index fd6e4eb9c..bb8ff6b45 100644 --- a/src/management/model_store.go +++ b/src/management/model_store.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Store type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Store{} // Store struct for Store type Store struct { - Links *Links `json:"_links,omitempty"` + Links *Links `json:"_links,omitempty"` Address *StoreLocation `json:"address,omitempty"` // The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. BusinessLineIds []string `json:"businessLineIds,omitempty"` @@ -31,12 +30,12 @@ type Store struct { Id *string `json:"id,omitempty"` // The unique identifier of the merchant account that the store belongs to. MerchantId *string `json:"merchantId,omitempty"` - // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. + // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. PhoneNumber *string `json:"phoneNumber,omitempty"` // A reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_) Reference *string `json:"reference,omitempty"` // The store name shown on the shopper's bank or credit card statement and on the shopper receipt. - ShopperStatement *string `json:"shopperStatement,omitempty"` + ShopperStatement *string `json:"shopperStatement,omitempty"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` // The status of the store. Possible values are: - **active**. This value is assigned automatically when a store is created. - **inactive**. The terminals under the store are blocked from accepting new transactions, but capturing outstanding transactions is still possible. - **closed**. This status is irreversible. The terminals under the store are reassigned to the merchant inventory. Status *string `json:"status,omitempty"` @@ -444,7 +443,7 @@ func (o *Store) SetStatus(v string) { } func (o Store) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -528,12 +527,14 @@ func (v *NullableStore) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Store) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_store_creation_request.go b/src/management/model_store_creation_request.go index 3d625aa91..13bf158b2 100644 --- a/src/management/model_store_creation_request.go +++ b/src/management/model_store_creation_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreCreationRequest type satisfies the MappedNullable interface at compile time @@ -24,14 +23,14 @@ type StoreCreationRequest struct { BusinessLineIds []string `json:"businessLineIds,omitempty"` // Your description of the store. Description string `json:"description"` - // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. + // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. ExternalReferenceId *string `json:"externalReferenceId,omitempty"` - // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. + // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. PhoneNumber string `json:"phoneNumber"` // Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). Reference *string `json:"reference,omitempty"` // The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. - ShopperStatement string `json:"shopperStatement"` + ShopperStatement string `json:"shopperStatement"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` } @@ -281,7 +280,7 @@ func (o *StoreCreationRequest) SetSplitConfiguration(v StoreSplitConfiguration) } func (o StoreCreationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableStoreCreationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_creation_with_merchant_code_request.go b/src/management/model_store_creation_with_merchant_code_request.go index f503b333c..2f73d4981 100644 --- a/src/management/model_store_creation_with_merchant_code_request.go +++ b/src/management/model_store_creation_with_merchant_code_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreCreationWithMerchantCodeRequest type satisfies the MappedNullable interface at compile time @@ -24,16 +23,16 @@ type StoreCreationWithMerchantCodeRequest struct { BusinessLineIds []string `json:"businessLineIds,omitempty"` // Your description of the store. Description string `json:"description"` - // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. + // The unique identifier of the store, used by certain payment methods and tax authorities. Accepts up to 14 digits. Required for CNPJ in Brazil, in the format 00.000.000/00git00-00 separated by dots, slashes, hyphens, or without separators. Optional for Zip in Australia and SIRET in France, required except for nonprofit organizations and incorporated associations. ExternalReferenceId *string `json:"externalReferenceId,omitempty"` // The unique identifier of the merchant account that the store belongs to. MerchantId string `json:"merchantId"` - // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. + // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. PhoneNumber string `json:"phoneNumber"` // Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). Reference *string `json:"reference,omitempty"` // The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers. - ShopperStatement string `json:"shopperStatement"` + ShopperStatement string `json:"shopperStatement"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` } @@ -308,7 +307,7 @@ func (o *StoreCreationWithMerchantCodeRequest) SetSplitConfiguration(v StoreSpli } func (o StoreCreationWithMerchantCodeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -372,3 +371,6 @@ func (v *NullableStoreCreationWithMerchantCodeRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_location.go b/src/management/model_store_location.go index 961763a44..10795b503 100644 --- a/src/management/model_store_location.go +++ b/src/management/model_store_location.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreLocation type satisfies the MappedNullable interface at compile time @@ -270,7 +269,7 @@ func (o *StoreLocation) SetStateOrProvince(v string) { } func (o StoreLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -336,3 +335,6 @@ func (v *NullableStoreLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_store_split_configuration.go b/src/management/model_store_split_configuration.go index 727e5fb4c..2dc18cfed 100644 --- a/src/management/model_store_split_configuration.go +++ b/src/management/model_store_split_configuration.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreSplitConfiguration type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *StoreSplitConfiguration) SetSplitConfigurationId(v string) { } func (o StoreSplitConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableStoreSplitConfiguration) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_surcharge.go b/src/management/model_surcharge.go index a4b626f4f..86db2df59 100644 --- a/src/management/model_surcharge.go +++ b/src/management/model_surcharge.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Surcharge type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Surcharge) SetConfigurations(v []Configuration) { } func (o Surcharge) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableSurcharge) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_swish_info.go b/src/management/model_swish_info.go index e137eb6f3..7bdb99f31 100644 --- a/src/management/model_swish_info.go +++ b/src/management/model_swish_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SwishInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *SwishInfo) SetSwishNumber(v string) { } func (o SwishInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableSwishInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal.go b/src/management/model_terminal.go index 126c42146..8445443f1 100644 --- a/src/management/model_terminal.go +++ b/src/management/model_terminal.go @@ -10,9 +10,8 @@ package management import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Terminal type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &Terminal{} // Terminal struct for Terminal type Terminal struct { - Assignment *TerminalAssignment `json:"assignment,omitempty"` + Assignment *TerminalAssignment `json:"assignment,omitempty"` Connectivity *TerminalConnectivity `json:"connectivity,omitempty"` // The software release currently in use on the terminal. FirmwareVersion *string `json:"firmwareVersion,omitempty"` @@ -310,7 +309,7 @@ func (o *Terminal) SetSerialNumber(v string) { } func (o Terminal) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,3 +380,6 @@ func (v *NullableTerminal) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_action_schedule_detail.go b/src/management/model_terminal_action_schedule_detail.go index a9dfdb75c..f408e4cdb 100644 --- a/src/management/model_terminal_action_schedule_detail.go +++ b/src/management/model_terminal_action_schedule_detail.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalActionScheduleDetail type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalActionScheduleDetail) SetTerminalId(v string) { } func (o TerminalActionScheduleDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTerminalActionScheduleDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_assignment.go b/src/management/model_terminal_assignment.go index b813eb28b..97f505273 100644 --- a/src/management/model_terminal_assignment.go +++ b/src/management/model_terminal_assignment.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalAssignment type satisfies the MappedNullable interface at compile time @@ -22,9 +21,9 @@ type TerminalAssignment struct { // The unique identifier of the company account to which terminal is assigned. CompanyId string `json:"companyId"` // The unique identifier of the merchant account to which terminal is assigned. - MerchantId *string `json:"merchantId,omitempty"` + MerchantId *string `json:"merchantId,omitempty"` ReassignmentTarget *TerminalReassignmentTarget `json:"reassignmentTarget,omitempty"` - // The status of the reassignment. Possible values: * `reassignmentInProgress`: the terminal was boarded and is now scheduled to remove the configuration. Wait for the terminal to synchronize with the Adyen platform. * `deployed`: the terminal is deployed and reassigned. * `inventory`: the terminal is in inventory and cannot process transactions. * `boarded`: the terminal is boarded to a store, or a merchant account representing a store, and can process transactions. + // The status of the reassignment. Possible values: * `reassignmentInProgress`: the terminal was boarded and is now scheduled to remove the configuration. Wait for the terminal to synchronize with the Adyen platform. * `deployed`: the terminal is deployed and reassigned. * `inventory`: the terminal is in inventory and cannot process transactions. * `boarded`: the terminal is boarded to a store, or a merchant account representing a store, and can process transactions. Status string `json:"status"` // The unique identifier of the store to which terminal is assigned. StoreId *string `json:"storeId,omitempty"` @@ -194,7 +193,7 @@ func (o *TerminalAssignment) SetStoreId(v string) { } func (o TerminalAssignment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,12 +252,14 @@ func (v *NullableTerminalAssignment) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TerminalAssignment) isValidStatus() bool { - var allowedEnumValues = []string{"boarded", "deployed", "inventory", "reassignmentInProgress"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "boarded", "deployed", "inventory", "reassignmentInProgress" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_terminal_connectivity.go b/src/management/model_terminal_connectivity.go index abc6d88d2..638dfe8bb 100644 --- a/src/management/model_terminal_connectivity.go +++ b/src/management/model_terminal_connectivity.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalConnectivity type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &TerminalConnectivity{} // TerminalConnectivity struct for TerminalConnectivity type TerminalConnectivity struct { Bluetooth *TerminalConnectivityBluetooth `json:"bluetooth,omitempty"` - Cellular *TerminalConnectivityCellular `json:"cellular,omitempty"` - Ethernet *TerminalConnectivityEthernet `json:"ethernet,omitempty"` - Wifi *TerminalConnectivityWifi `json:"wifi,omitempty"` + Cellular *TerminalConnectivityCellular `json:"cellular,omitempty"` + Ethernet *TerminalConnectivityEthernet `json:"ethernet,omitempty"` + Wifi *TerminalConnectivityWifi `json:"wifi,omitempty"` } // NewTerminalConnectivity instantiates a new TerminalConnectivity object @@ -171,7 +170,7 @@ func (o *TerminalConnectivity) SetWifi(v TerminalConnectivityWifi) { } func (o TerminalConnectivity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -230,3 +229,6 @@ func (v *NullableTerminalConnectivity) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_connectivity_bluetooth.go b/src/management/model_terminal_connectivity_bluetooth.go index 6fbae4644..4ab22430e 100644 --- a/src/management/model_terminal_connectivity_bluetooth.go +++ b/src/management/model_terminal_connectivity_bluetooth.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalConnectivityBluetooth type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalConnectivityBluetooth) SetMacAddress(v string) { } func (o TerminalConnectivityBluetooth) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTerminalConnectivityBluetooth) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_connectivity_cellular.go b/src/management/model_terminal_connectivity_cellular.go index ea0e71754..af308f3e7 100644 --- a/src/management/model_terminal_connectivity_cellular.go +++ b/src/management/model_terminal_connectivity_cellular.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalConnectivityCellular type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalConnectivityCellular) SetStatus(v string) { } func (o TerminalConnectivityCellular) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableTerminalConnectivityCellular) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TerminalConnectivityCellular) isValidStatus() bool { - var allowedEnumValues = []string{"activated", "deactivated", "deprecated", "inventory", "readyForActivation"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "activated", "deactivated", "deprecated", "inventory", "readyForActivation" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_terminal_connectivity_ethernet.go b/src/management/model_terminal_connectivity_ethernet.go index 9c58edf47..4c2dc88aa 100644 --- a/src/management/model_terminal_connectivity_ethernet.go +++ b/src/management/model_terminal_connectivity_ethernet.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalConnectivityEthernet type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *TerminalConnectivityEthernet) SetMacAddress(v string) { } func (o TerminalConnectivityEthernet) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableTerminalConnectivityEthernet) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_connectivity_wifi.go b/src/management/model_terminal_connectivity_wifi.go index 9ce9faf5a..f5ae3e31b 100644 --- a/src/management/model_terminal_connectivity_wifi.go +++ b/src/management/model_terminal_connectivity_wifi.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalConnectivityWifi type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *TerminalConnectivityWifi) SetSsid(v string) { } func (o TerminalConnectivityWifi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableTerminalConnectivityWifi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_models_response.go b/src/management/model_terminal_models_response.go index 96e853780..80d31aab0 100644 --- a/src/management/model_terminal_models_response.go +++ b/src/management/model_terminal_models_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalModelsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalModelsResponse) SetData(v []IdName) { } func (o TerminalModelsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalModelsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_order.go b/src/management/model_terminal_order.go index 2ad2d5dca..6f39f004c 100644 --- a/src/management/model_terminal_order.go +++ b/src/management/model_terminal_order.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalOrder type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type TerminalOrder struct { // The products included in the order. Items []OrderItem `json:"items,omitempty"` // The date and time that the order was placed, in UTC ISO 8601 format. For example, \"2011-12-03T10:15:30Z\". - OrderDate *string `json:"orderDate,omitempty"` + OrderDate *string `json:"orderDate,omitempty"` ShippingLocation *ShippingLocation `json:"shippingLocation,omitempty"` // The processing status of the order. Status *string `json:"status,omitempty"` @@ -309,7 +308,7 @@ func (o *TerminalOrder) SetTrackingUrl(v string) { } func (o TerminalOrder) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -380,3 +379,6 @@ func (v *NullableTerminalOrder) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_order_request.go b/src/management/model_terminal_order_request.go index 3fad0b54a..347c05214 100644 --- a/src/management/model_terminal_order_request.go +++ b/src/management/model_terminal_order_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalOrderRequest type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *TerminalOrderRequest) SetTaxId(v string) { } func (o TerminalOrderRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableTerminalOrderRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_orders_response.go b/src/management/model_terminal_orders_response.go index ee08bfa30..2f019eaca 100644 --- a/src/management/model_terminal_orders_response.go +++ b/src/management/model_terminal_orders_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalOrdersResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalOrdersResponse) SetData(v []TerminalOrder) { } func (o TerminalOrdersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalOrdersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_product.go b/src/management/model_terminal_product.go index 708f8513a..7f3486d4e 100644 --- a/src/management/model_terminal_product.go +++ b/src/management/model_terminal_product.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalProduct type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type TerminalProduct struct { // A list of parts included in the terminal package. ItemsIncluded []string `json:"itemsIncluded,omitempty"` // The descriptive name of the product. - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` Price *TerminalProductPrice `json:"price,omitempty"` } @@ -208,7 +207,7 @@ func (o *TerminalProduct) SetPrice(v TerminalProductPrice) { } func (o TerminalProduct) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableTerminalProduct) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_product_price.go b/src/management/model_terminal_product_price.go index 497c41418..c5fbda116 100644 --- a/src/management/model_terminal_product_price.go +++ b/src/management/model_terminal_product_price.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalProductPrice type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TerminalProductPrice) SetValue(v float64) { } func (o TerminalProductPrice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTerminalProductPrice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_products_response.go b/src/management/model_terminal_products_response.go index 5f100ad38..df8c48d74 100644 --- a/src/management/model_terminal_products_response.go +++ b/src/management/model_terminal_products_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalProductsResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TerminalProductsResponse) SetData(v []TerminalProduct) { } func (o TerminalProductsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTerminalProductsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_reassignment_request.go b/src/management/model_terminal_reassignment_request.go index c3012475a..6f7aa0450 100644 --- a/src/management/model_terminal_reassignment_request.go +++ b/src/management/model_terminal_reassignment_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalReassignmentRequest type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *TerminalReassignmentRequest) SetStoreId(v string) { } func (o TerminalReassignmentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableTerminalReassignmentRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_reassignment_target.go b/src/management/model_terminal_reassignment_target.go index 5f233efa4..a13d8461b 100644 --- a/src/management/model_terminal_reassignment_target.go +++ b/src/management/model_terminal_reassignment_target.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalReassignmentTarget type satisfies the MappedNullable interface at compile time @@ -168,7 +167,7 @@ func (o *TerminalReassignmentTarget) SetStoreId(v string) { } func (o TerminalReassignmentTarget) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -225,3 +224,6 @@ func (v *NullableTerminalReassignmentTarget) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_terminal_settings.go b/src/management/model_terminal_settings.go index c31f9dbe6..f04590f1c 100644 --- a/src/management/model_terminal_settings.go +++ b/src/management/model_terminal_settings.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TerminalSettings type satisfies the MappedNullable interface at compile time @@ -20,24 +19,24 @@ var _ common.MappedNullable = &TerminalSettings{} // TerminalSettings struct for TerminalSettings type TerminalSettings struct { CardholderReceipt *CardholderReceipt `json:"cardholderReceipt,omitempty"` - Connectivity *Connectivity `json:"connectivity,omitempty"` + Connectivity *Connectivity `json:"connectivity,omitempty"` // Settings for tipping with or without predefined options to choose from. The maximum number of predefined options is four, or three plus the option to enter a custom tip. - Gratuities []Gratuity `json:"gratuities,omitempty"` - Hardware *Hardware `json:"hardware,omitempty"` - Localization *Localization `json:"localization,omitempty"` - Nexo *Nexo `json:"nexo,omitempty"` + Gratuities []Gratuity `json:"gratuities,omitempty"` + Hardware *Hardware `json:"hardware,omitempty"` + Localization *Localization `json:"localization,omitempty"` + Nexo *Nexo `json:"nexo,omitempty"` OfflineProcessing *OfflineProcessing `json:"offlineProcessing,omitempty"` - Opi *Opi `json:"opi,omitempty"` - Passcodes *Passcodes `json:"passcodes,omitempty"` - PayAtTable *PayAtTable `json:"payAtTable,omitempty"` - Payment *Payment `json:"payment,omitempty"` - ReceiptOptions *ReceiptOptions `json:"receiptOptions,omitempty"` - ReceiptPrinting *ReceiptPrinting `json:"receiptPrinting,omitempty"` - Signature *Signature `json:"signature,omitempty"` - Standalone *Standalone `json:"standalone,omitempty"` - Surcharge *Surcharge `json:"surcharge,omitempty"` - Timeouts *Timeouts `json:"timeouts,omitempty"` - WifiProfiles *WifiProfiles `json:"wifiProfiles,omitempty"` + Opi *Opi `json:"opi,omitempty"` + Passcodes *Passcodes `json:"passcodes,omitempty"` + PayAtTable *PayAtTable `json:"payAtTable,omitempty"` + Payment *Payment `json:"payment,omitempty"` + ReceiptOptions *ReceiptOptions `json:"receiptOptions,omitempty"` + ReceiptPrinting *ReceiptPrinting `json:"receiptPrinting,omitempty"` + Signature *Signature `json:"signature,omitempty"` + Standalone *Standalone `json:"standalone,omitempty"` + Surcharge *Surcharge `json:"surcharge,omitempty"` + Timeouts *Timeouts `json:"timeouts,omitempty"` + WifiProfiles *WifiProfiles `json:"wifiProfiles,omitempty"` } // NewTerminalSettings instantiates a new TerminalSettings object @@ -634,7 +633,7 @@ func (o *TerminalSettings) SetWifiProfiles(v WifiProfiles) { } func (o TerminalSettings) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -735,3 +734,6 @@ func (v *NullableTerminalSettings) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_company_webhook_request.go b/src/management/model_test_company_webhook_request.go index 6068460df..068a2cf33 100644 --- a/src/management/model_test_company_webhook_request.go +++ b/src/management/model_test_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TestCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &TestCompanyWebhookRequest{} // TestCompanyWebhookRequest struct for TestCompanyWebhookRequest type TestCompanyWebhookRequest struct { // List of `merchantId` values for which test webhooks will be sent. The list can have a maximum of 20 `merchantId` values. If not specified, we send sample notifications to all the merchant accounts that the webhook is configured for. If this is more than 20 merchant accounts, use this list to specify a subset of the merchant accounts for which to send test notifications. - MerchantIds []string `json:"merchantIds,omitempty"` + MerchantIds []string `json:"merchantIds,omitempty"` Notification *CustomNotification `json:"notification,omitempty"` - // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** Types []string `json:"types,omitempty"` } @@ -140,7 +139,7 @@ func (o *TestCompanyWebhookRequest) SetTypes(v []string) { } func (o TestCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableTestCompanyWebhookRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_output.go b/src/management/model_test_output.go index 3dbbe6da2..9d573542e 100644 --- a/src/management/model_test_output.go +++ b/src/management/model_test_output.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TestOutput type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *TestOutput) SetStatus(v string) { } func (o TestOutput) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableTestOutput) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_webhook_request.go b/src/management/model_test_webhook_request.go index 3ef7c72f0..7d5648d5d 100644 --- a/src/management/model_test_webhook_request.go +++ b/src/management/model_test_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TestWebhookRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &TestWebhookRequest{} // TestWebhookRequest struct for TestWebhookRequest type TestWebhookRequest struct { Notification *CustomNotification `json:"notification,omitempty"` - // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** + // List of event codes for which to send test notifications. Only the webhook types below are supported. Possible values if webhook `type`: **standard**: * **AUTHORISATION** * **CHARGEBACK_REVERSED** * **ORDER_CLOSED** * **ORDER_OPENED** * **PAIDOUT_REVERSED** * **PAYOUT_THIRDPARTY** * **REFUNDED_REVERSED** * **REFUND_WITH_DATA** * **REPORT_AVAILABLE** * **CUSTOM** - set your custom notification fields in the [`notification`](https://docs.adyen.com/api-explorer/#/ManagementService/v1/post/companies/{companyId}/webhooks/{webhookId}/test__reqParam_notification) object. Possible values if webhook `type`: **banktransfer-notification**: * **PENDING** Possible values if webhook `type`: **report-notification**: * **REPORT_AVAILABLE** Possible values if webhook `type`: **ideal-notification**: * **AUTHORISATION** Possible values if webhook `type`: **pending-notification**: * **PENDING** Types []string `json:"types,omitempty"` } @@ -106,7 +105,7 @@ func (o *TestWebhookRequest) SetTypes(v []string) { } func (o TestWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableTestWebhookRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_test_webhook_response.go b/src/management/model_test_webhook_response.go index 91e7405f6..1fcbf6864 100644 --- a/src/management/model_test_webhook_response.go +++ b/src/management/model_test_webhook_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TestWebhookResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *TestWebhookResponse) SetData(v []TestOutput) { } func (o TestWebhookResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTestWebhookResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_timeouts.go b/src/management/model_timeouts.go index b22dda38d..f714a4711 100644 --- a/src/management/model_timeouts.go +++ b/src/management/model_timeouts.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Timeouts type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *Timeouts) SetFromActiveToSleep(v int32) { } func (o Timeouts) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableTimeouts) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_transaction_description_info.go b/src/management/model_transaction_description_info.go index 3c4454721..5d0354eb5 100644 --- a/src/management/model_transaction_description_info.go +++ b/src/management/model_transaction_description_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionDescriptionInfo type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *TransactionDescriptionInfo) SetType(v string) { } func (o TransactionDescriptionInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableTransactionDescriptionInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransactionDescriptionInfo) isValidType() bool { - var allowedEnumValues = []string{"append", "dynamic", "fixed"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "append", "dynamic", "fixed" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_twint_info.go b/src/management/model_twint_info.go index 9ed16507b..45ee672ef 100644 --- a/src/management/model_twint_info.go +++ b/src/management/model_twint_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TwintInfo type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *TwintInfo) SetLogo(v string) { } func (o TwintInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableTwintInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_uninstall_android_app_details.go b/src/management/model_uninstall_android_app_details.go index 3a7eb2568..61b739e57 100644 --- a/src/management/model_uninstall_android_app_details.go +++ b/src/management/model_uninstall_android_app_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UninstallAndroidAppDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *UninstallAndroidAppDetails) SetType(v string) { } func (o UninstallAndroidAppDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableUninstallAndroidAppDetails) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UninstallAndroidAppDetails) isValidType() bool { - var allowedEnumValues = []string{"UninstallAndroidApp"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "UninstallAndroidApp" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_uninstall_android_certificate_details.go b/src/management/model_uninstall_android_certificate_details.go index 4b9618310..7534767e1 100644 --- a/src/management/model_uninstall_android_certificate_details.go +++ b/src/management/model_uninstall_android_certificate_details.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UninstallAndroidCertificateDetails type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *UninstallAndroidCertificateDetails) SetType(v string) { } func (o UninstallAndroidCertificateDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableUninstallAndroidCertificateDetails) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *UninstallAndroidCertificateDetails) isValidType() bool { - var allowedEnumValues = []string{"UninstallAndroidCertificate"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "UninstallAndroidCertificate" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_updatable_address.go b/src/management/model_updatable_address.go index 1fce08cd0..804ac67ea 100644 --- a/src/management/model_updatable_address.go +++ b/src/management/model_updatable_address.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdatableAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *UpdatableAddress) SetStateOrProvince(v string) { } func (o UpdatableAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableUpdatableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_api_credential_request.go b/src/management/model_update_company_api_credential_request.go index 5061cf1d7..d36caad07 100644 --- a/src/management/model_update_company_api_credential_request.go +++ b/src/management/model_update_company_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateCompanyApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *UpdateCompanyApiCredentialRequest) SetRoles(v []string) { } func (o UpdateCompanyApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableUpdateCompanyApiCredentialRequest) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_user_request.go b/src/management/model_update_company_user_request.go index 127a220c3..841ac26d3 100644 --- a/src/management/model_update_company_user_request.go +++ b/src/management/model_update_company_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateCompanyUserRequest type satisfies the MappedNullable interface at compile time @@ -27,7 +26,7 @@ type UpdateCompanyUserRequest struct { AssociatedMerchantAccounts []string `json:"associatedMerchantAccounts,omitempty"` // The email address of the user. Email *string `json:"email,omitempty"` - Name *Name2 `json:"name,omitempty"` + Name *Name2 `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -276,7 +275,7 @@ func (o *UpdateCompanyUserRequest) SetTimeZoneCode(v string) { } func (o UpdateCompanyUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,3 +343,6 @@ func (v *NullableUpdateCompanyUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_company_webhook_request.go b/src/management/model_update_company_webhook_request.go index f76117252..f57fd828f 100644 --- a/src/management/model_update_company_webhook_request.go +++ b/src/management/model_update_company_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateCompanyWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type UpdateCompanyWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active *bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat *string `json:"communicationFormat,omitempty"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -548,7 +547,7 @@ func (o *UpdateCompanyWebhookRequest) SetUsername(v string) { } func (o UpdateCompanyWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,39 +640,41 @@ func (v *NullableUpdateCompanyWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateCompanyWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidEncryptionProtocol() bool { - var allowedEnumValues = []string{"HTTP", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetEncryptionProtocol() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetEncryptionProtocol() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *UpdateCompanyWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_merchant_api_credential_request.go b/src/management/model_update_merchant_api_credential_request.go index 44ead3891..5fe5bd03b 100644 --- a/src/management/model_update_merchant_api_credential_request.go +++ b/src/management/model_update_merchant_api_credential_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateMerchantApiCredentialRequest type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *UpdateMerchantApiCredentialRequest) SetRoles(v []string) { } func (o UpdateMerchantApiCredentialRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableUpdateMerchantApiCredentialRequest) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_merchant_user_request.go b/src/management/model_update_merchant_user_request.go index acc71bdaf..02bab1d12 100644 --- a/src/management/model_update_merchant_user_request.go +++ b/src/management/model_update_merchant_user_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateMerchantUserRequest type satisfies the MappedNullable interface at compile time @@ -25,7 +24,7 @@ type UpdateMerchantUserRequest struct { Active *bool `json:"active,omitempty"` // The email address of the user. Email *string `json:"email,omitempty"` - Name *Name2 `json:"name,omitempty"` + Name *Name2 `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles,omitempty"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -242,7 +241,7 @@ func (o *UpdateMerchantUserRequest) SetTimeZoneCode(v string) { } func (o UpdateMerchantUserRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -307,3 +306,6 @@ func (v *NullableUpdateMerchantUserRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_merchant_webhook_request.go b/src/management/model_update_merchant_webhook_request.go index cdc5569da..b84c8c83d 100644 --- a/src/management/model_update_merchant_webhook_request.go +++ b/src/management/model_update_merchant_webhook_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateMerchantWebhookRequest type satisfies the MappedNullable interface at compile time @@ -26,9 +25,9 @@ type UpdateMerchantWebhookRequest struct { // Indicates if untrusted SSL certificates are accepted. Default value: **false**. AcceptsUntrustedRootCertificate *bool `json:"acceptsUntrustedRootCertificate,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. - Active *bool `json:"active,omitempty"` + Active *bool `json:"active,omitempty"` AdditionalSettings *AdditionalSettings `json:"additionalSettings,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat *string `json:"communicationFormat,omitempty"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -480,7 +479,7 @@ func (o *UpdateMerchantWebhookRequest) SetUsername(v string) { } func (o UpdateMerchantWebhookRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -567,30 +566,32 @@ func (v *NullableUpdateMerchantWebhookRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateMerchantWebhookRequest) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *UpdateMerchantWebhookRequest) isValidEncryptionProtocol() bool { - var allowedEnumValues = []string{"HTTP", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetEncryptionProtocol() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetEncryptionProtocol() == allowed { + return true + } + } + return false } func (o *UpdateMerchantWebhookRequest) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_payment_method_info.go b/src/management/model_update_payment_method_info.go index 758a3ae53..f3a65c4f1 100644 --- a/src/management/model_update_payment_method_info.go +++ b/src/management/model_update_payment_method_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdatePaymentMethodInfo type satisfies the MappedNullable interface at compile time @@ -19,27 +18,27 @@ var _ common.MappedNullable = &UpdatePaymentMethodInfo{} // UpdatePaymentMethodInfo struct for UpdatePaymentMethodInfo type UpdatePaymentMethodInfo struct { - Bcmc *BcmcInfo `json:"bcmc,omitempty"` + Bcmc *BcmcInfo `json:"bcmc,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` // The list of countries where a payment method is available. By default, all countries supported by the payment method. - Countries []string `json:"countries,omitempty"` - Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` + Countries []string `json:"countries,omitempty"` + Cup *GenericPmWithTdiInfo `json:"cup,omitempty"` // The list of currencies that a payment method supports. By default, all currencies supported by the payment method. - Currencies []string `json:"currencies,omitempty"` - Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` - Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` + Currencies []string `json:"currencies,omitempty"` + Diners *GenericPmWithTdiInfo `json:"diners,omitempty"` + Discover *GenericPmWithTdiInfo `json:"discover,omitempty"` EftposAustralia *GenericPmWithTdiInfo `json:"eftpos_australia,omitempty"` // Indicates whether the payment method is enabled (**true**) or disabled (**false**). - Enabled *bool `json:"enabled,omitempty"` - Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` - Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Girocard *GenericPmWithTdiInfo `json:"girocard,omitempty"` + Ideal *GenericPmWithTdiInfo `json:"ideal,omitempty"` InteracCard *GenericPmWithTdiInfo `json:"interac_card,omitempty"` - Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` - Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` - Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` + Jcb *GenericPmWithTdiInfo `json:"jcb,omitempty"` + Maestro *GenericPmWithTdiInfo `json:"maestro,omitempty"` + Mc *GenericPmWithTdiInfo `json:"mc,omitempty"` // The list of stores for this payment method - StoreIds []string `json:"storeIds,omitempty"` - Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` + StoreIds []string `json:"storeIds,omitempty"` + Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } // NewUpdatePaymentMethodInfo instantiates a new UpdatePaymentMethodInfo object @@ -604,7 +603,7 @@ func (o *UpdatePaymentMethodInfo) SetVisa(v GenericPmWithTdiInfo) { } func (o UpdatePaymentMethodInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -702,3 +701,6 @@ func (v *NullableUpdatePaymentMethodInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_payout_settings_request.go b/src/management/model_update_payout_settings_request.go index 65c8094d4..090dc4a06 100644 --- a/src/management/model_update_payout_settings_request.go +++ b/src/management/model_update_payout_settings_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdatePayoutSettingsRequest type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *UpdatePayoutSettingsRequest) SetEnabled(v bool) { } func (o UpdatePayoutSettingsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableUpdatePayoutSettingsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_split_configuration_logic_request.go b/src/management/model_update_split_configuration_logic_request.go index 4bde5ffb0..8e0d7f0af 100644 --- a/src/management/model_update_split_configuration_logic_request.go +++ b/src/management/model_update_split_configuration_logic_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateSplitConfigurationLogicRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &UpdateSplitConfigurationLogicRequest{} // UpdateSplitConfigurationLogicRequest struct for UpdateSplitConfigurationLogicRequest type UpdateSplitConfigurationLogicRequest struct { // Specifies the logic to apply when booking the transaction fees. Should be combined with adyenFees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. - AcquiringFees *string `json:"acquiringFees,omitempty"` + AcquiringFees *string `json:"acquiringFees,omitempty"` AdditionalCommission *AdditionalCommission `json:"additionalCommission,omitempty"` // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, interchange & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. AdyenCommission *string `json:"adyenCommission,omitempty"` @@ -31,8 +30,8 @@ type UpdateSplitConfigurationLogicRequest struct { // Specifies the logic to apply when booking the chargeback amount. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. Chargeback *string `json:"chargeback,omitempty"` // Specifies the logic to apply when allocating the chargeback costs. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount** - ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` - Commission Commission `json:"commission"` + ChargebackCostAllocation *string `json:"chargebackCostAllocation,omitempty"` + Commission Commission `json:"commission"` // Specifies the logic to apply when booking the transaction fees. Should be combined with schemeFee, adyenCommission & adyenMarkup. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. Interchange *string `json:"interchange,omitempty"` // Specifies the logic to apply when booking the transaction fees. Cannot be combined with other fees. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -540,7 +539,7 @@ func (o *UpdateSplitConfigurationLogicRequest) SetTip(v string) { } func (o UpdateSplitConfigurationLogicRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -631,111 +630,113 @@ func (v *NullableUpdateSplitConfigurationLogicRequest) UnmarshalJSON(src []byte) return json.Unmarshal(src, &v.value) } + func (o *UpdateSplitConfigurationLogicRequest) isValidAcquiringFees() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAcquiringFees() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAcquiringFees() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenCommission() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenCommission() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenCommission() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenFees() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenFees() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenFees() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidAdyenMarkup() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetAdyenMarkup() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetAdyenMarkup() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidChargeback() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio"} - for _, allowed := range allowedEnumValues { - if o.GetChargeback() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount", "deductAccordingToSplitRatio" } + for _, allowed := range allowedEnumValues { + if o.GetChargeback() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidChargebackCostAllocation() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetChargebackCostAllocation() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetChargebackCostAllocation() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidInterchange() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetInterchange() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetInterchange() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidPaymentFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentFee() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidRemainder() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetRemainder() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetRemainder() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidSchemeFee() bool { - var allowedEnumValues = []string{"deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSchemeFee() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSchemeFee() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidSurcharge() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetSurcharge() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetSurcharge() == allowed { + return true + } + } + return false } func (o *UpdateSplitConfigurationLogicRequest) isValidTip() bool { - var allowedEnumValues = []string{"addToLiableAccount", "addToOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetTip() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "addToLiableAccount", "addToOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetTip() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_update_split_configuration_request.go b/src/management/model_update_split_configuration_request.go index d28fee236..e5f2c7736 100644 --- a/src/management/model_update_split_configuration_request.go +++ b/src/management/model_update_split_configuration_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateSplitConfigurationRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *UpdateSplitConfigurationRequest) SetDescription(v string) { } func (o UpdateSplitConfigurationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableUpdateSplitConfigurationRequest) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_split_configuration_rule_request.go b/src/management/model_update_split_configuration_rule_request.go index a14324368..4311a5669 100644 --- a/src/management/model_update_split_configuration_rule_request.go +++ b/src/management/model_update_split_configuration_rule_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateSplitConfigurationRuleRequest type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *UpdateSplitConfigurationRuleRequest) SetShopperInteraction(v string) { } func (o UpdateSplitConfigurationRuleRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -207,3 +206,6 @@ func (v *NullableUpdateSplitConfigurationRuleRequest) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_update_store_request.go b/src/management/model_update_store_request.go index 5a95fdf23..d6e4aad39 100644 --- a/src/management/model_update_store_request.go +++ b/src/management/model_update_store_request.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UpdateStoreRequest type satisfies the MappedNullable interface at compile time @@ -26,8 +25,8 @@ type UpdateStoreRequest struct { Description *string `json:"description,omitempty"` // When using the Zip payment method: The location ID that Zip has assigned to your store. ExternalReferenceId *string `json:"externalReferenceId,omitempty"` - // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. - PhoneNumber *string `json:"phoneNumber,omitempty"` + // The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164. + PhoneNumber *string `json:"phoneNumber,omitempty"` SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"` // The status of the store. Possible values are: - **active**: This value is assigned automatically when a store is created. - **inactive**: The maximum [transaction limits and number of Store-and-Forward transactions](https://docs.adyen.com/point-of-sale/determine-account-structure/configure-features#payment-features) for the store are set to 0. This blocks new transactions, but captures are still possible. - **closed**: The terminals of the store are reassigned to the merchant inventory, so they can't process payments. You can change the status from **active** to **inactive**, and from **inactive** to **active** or **closed**. Once **closed**, a store can't be reopened. Status *string `json:"status,omitempty"` @@ -275,7 +274,7 @@ func (o *UpdateStoreRequest) SetStatus(v string) { } func (o UpdateStoreRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -344,12 +343,14 @@ func (v *NullableUpdateStoreRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UpdateStoreRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "closed", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "closed", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_upload_android_app_response.go b/src/management/model_upload_android_app_response.go index 42eb0650e..6c8de734f 100644 --- a/src/management/model_upload_android_app_response.go +++ b/src/management/model_upload_android_app_response.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UploadAndroidAppResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *UploadAndroidAppResponse) SetId(v string) { } func (o UploadAndroidAppResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableUploadAndroidAppResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_url.go b/src/management/model_url.go index c93849f92..bbe8d8535 100644 --- a/src/management/model_url.go +++ b/src/management/model_url.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Url type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *Url) SetUsername(v string) { } func (o Url) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_user.go b/src/management/model_user.go index 1360f131f..174a4a7f7 100644 --- a/src/management/model_user.go +++ b/src/management/model_user.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the User type satisfies the MappedNullable interface at compile time @@ -29,8 +28,8 @@ type User struct { // The email address of the user. Email string `json:"email"` // The unique identifier of the user. - Id string `json:"id"` - Name *Name `json:"name,omitempty"` + Id string `json:"id"` + Name *Name `json:"name,omitempty"` // The list of [roles](https://docs.adyen.com/account/user-roles) for this user. Roles []string `json:"roles"` // The [tz database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time zone of the user. For example, **Europe/Amsterdam**. @@ -342,7 +341,7 @@ func (o *User) SetUsername(v string) { } func (o User) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -409,3 +408,6 @@ func (v *NullableUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_vipps_info.go b/src/management/model_vipps_info.go index f0d8d9938..e90627700 100644 --- a/src/management/model_vipps_info.go +++ b/src/management/model_vipps_info.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VippsInfo type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *VippsInfo) SetSubscriptionCancelUrl(v string) { } func (o VippsInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableVippsInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_webhook.go b/src/management/model_webhook.go index f7bd00049..8248c9bac 100644 --- a/src/management/model_webhook.go +++ b/src/management/model_webhook.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Webhook type satisfies the MappedNullable interface at compile time @@ -29,11 +28,11 @@ type Webhook struct { // Reference to the account the webook is set on. AccountReference *string `json:"accountReference,omitempty"` // Indicates if the webhook configuration is active. The field must be **true** for you to receive webhooks about events related an account. - Active bool `json:"active"` + Active bool `json:"active"` AdditionalSettings *AdditionalSettingsResponse `json:"additionalSettings,omitempty"` // The alias of our SSL certificate. When you receive a notification from us, the alias from the HMAC signature will match this alias. CertificateAlias *string `json:"certificateAlias,omitempty"` - // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** + // Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** CommunicationFormat string `json:"communicationFormat"` // Your description for this webhook configuration. Description *string `json:"description,omitempty"` @@ -757,7 +756,7 @@ func (o *Webhook) SetUsername(v string) { } func (o Webhook) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,39 +862,41 @@ func (v *NullableWebhook) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Webhook) isValidCommunicationFormat() bool { - var allowedEnumValues = []string{"http", "json", "soap"} - for _, allowed := range allowedEnumValues { - if o.GetCommunicationFormat() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "http", "json", "soap" } + for _, allowed := range allowedEnumValues { + if o.GetCommunicationFormat() == allowed { + return true + } + } + return false } func (o *Webhook) isValidEncryptionProtocol() bool { - var allowedEnumValues = []string{"HTTP", "TLSv1.2", "TLSv1.3"} - for _, allowed := range allowedEnumValues { - if o.GetEncryptionProtocol() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "HTTP", "TLSv1.2", "TLSv1.3" } + for _, allowed := range allowedEnumValues { + if o.GetEncryptionProtocol() == allowed { + return true + } + } + return false } func (o *Webhook) isValidFilterMerchantAccountType() bool { - var allowedEnumValues = []string{"allAccounts", "excludeAccounts", "includeAccounts"} - for _, allowed := range allowedEnumValues { - if o.GetFilterMerchantAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "allAccounts", "excludeAccounts", "includeAccounts" } + for _, allowed := range allowedEnumValues { + if o.GetFilterMerchantAccountType() == allowed { + return true + } + } + return false } func (o *Webhook) isValidNetworkType() bool { - var allowedEnumValues = []string{"local", "public"} - for _, allowed := range allowedEnumValues { - if o.GetNetworkType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "local", "public" } + for _, allowed := range allowedEnumValues { + if o.GetNetworkType() == allowed { + return true + } + } + return false } + diff --git a/src/management/model_webhook_links.go b/src/management/model_webhook_links.go index 02ceb05c4..6bb6af551 100644 --- a/src/management/model_webhook_links.go +++ b/src/management/model_webhook_links.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WebhookLinks type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &WebhookLinks{} // WebhookLinks struct for WebhookLinks type WebhookLinks struct { - Company *LinksElement `json:"company,omitempty"` - GenerateHmac LinksElement `json:"generateHmac"` - Merchant *LinksElement `json:"merchant,omitempty"` - Self LinksElement `json:"self"` - TestWebhook LinksElement `json:"testWebhook"` + Company *LinksElement `json:"company,omitempty"` + GenerateHmac LinksElement `json:"generateHmac"` + Merchant *LinksElement `json:"merchant,omitempty"` + Self LinksElement `json:"self"` + TestWebhook LinksElement `json:"testWebhook"` } // NewWebhookLinks instantiates a new WebhookLinks object @@ -183,7 +182,7 @@ func (o *WebhookLinks) SetTestWebhook(v LinksElement) { } func (o WebhookLinks) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -239,3 +238,6 @@ func (v *NullableWebhookLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/management/model_wifi_profiles.go b/src/management/model_wifi_profiles.go index b21faf977..30717a9ec 100644 --- a/src/management/model_wifi_profiles.go +++ b/src/management/model_wifi_profiles.go @@ -10,8 +10,7 @@ package management import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the WifiProfiles type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *WifiProfiles) SetSettings(v Settings) { } func (o WifiProfiles) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableWifiProfiles) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_account_capability_data.go b/src/managementwebhook/model_account_capability_data.go index a40059711..f6bcdf8f9 100644 --- a/src/managementwebhook/model_account_capability_data.go +++ b/src/managementwebhook/model_account_capability_data.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountCapabilityData type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type AccountCapabilityData struct { Requested bool `json:"requested"` // The level that you requested for the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may require additional checks and increased monitoring.Possible values: **notApplicable**, **low**, **medium**, **high**. RequestedLevel string `json:"requestedLevel"` - // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification was successful. * **rejected**: Adyen checked the information and found reasons to not allow the capability. + // The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification was successful. * **rejected**: Adyen checked the information and found reasons to not allow the capability. VerificationStatus *string `json:"verificationStatus,omitempty"` } @@ -263,7 +262,7 @@ func (o *AccountCapabilityData) SetVerificationStatus(v string) { } func (o AccountCapabilityData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -327,3 +326,6 @@ func (v *NullableAccountCapabilityData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_account_create_notification_data.go b/src/managementwebhook/model_account_create_notification_data.go index 8c91b19e6..93f351d49 100644 --- a/src/managementwebhook/model_account_create_notification_data.go +++ b/src/managementwebhook/model_account_create_notification_data.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountCreateNotificationData type satisfies the MappedNullable interface at compile time @@ -181,7 +180,7 @@ func (o *AccountCreateNotificationData) SetStatus(v string) { } func (o AccountCreateNotificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableAccountCreateNotificationData) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_account_notification_response.go b/src/managementwebhook/model_account_notification_response.go index debf7048b..1f0a2548f 100644 --- a/src/managementwebhook/model_account_notification_response.go +++ b/src/managementwebhook/model_account_notification_response.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountNotificationResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AccountNotificationResponse) SetNotificationResponse(v string) { } func (o AccountNotificationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAccountNotificationResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_account_update_notification_data.go b/src/managementwebhook/model_account_update_notification_data.go index 367b69a7b..d9756e179 100644 --- a/src/managementwebhook/model_account_update_notification_data.go +++ b/src/managementwebhook/model_account_update_notification_data.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountUpdateNotificationData type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *AccountUpdateNotificationData) SetStatus(v string) { } func (o AccountUpdateNotificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -207,3 +206,6 @@ func (v *NullableAccountUpdateNotificationData) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_capability_problem.go b/src/managementwebhook/model_capability_problem.go index 62674e1c7..100ad3df2 100644 --- a/src/managementwebhook/model_capability_problem.go +++ b/src/managementwebhook/model_capability_problem.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblem type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *CapabilityProblem) SetVerificationErrors(v []VerificationError) { } func (o CapabilityProblem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableCapabilityProblem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_capability_problem_entity.go b/src/managementwebhook/model_capability_problem_entity.go index 793aa2ee9..7e2ffecb7 100644 --- a/src/managementwebhook/model_capability_problem_entity.go +++ b/src/managementwebhook/model_capability_problem_entity.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntity type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type CapabilityProblemEntity struct { // List of document IDs to which the verification errors related to the capabilities correspond to. Documents []string `json:"documents,omitempty"` // The ID of the entity. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` Owner *CapabilityProblemEntityRecursive `json:"owner,omitempty"` // The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. Type *string `json:"type,omitempty"` @@ -174,7 +173,7 @@ func (o *CapabilityProblemEntity) SetType(v string) { } func (o CapabilityProblemEntity) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,12 +233,14 @@ func (v *NullableCapabilityProblemEntity) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntity) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_capability_problem_entity_recursive.go b/src/managementwebhook/model_capability_problem_entity_recursive.go index 533b3abf4..211c44e68 100644 --- a/src/managementwebhook/model_capability_problem_entity_recursive.go +++ b/src/managementwebhook/model_capability_problem_entity_recursive.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapabilityProblemEntityRecursive type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *CapabilityProblemEntityRecursive) SetType(v string) { } func (o CapabilityProblemEntityRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableCapabilityProblemEntityRecursive) UnmarshalJSON(src []byte) err return json.Unmarshal(src, &v.value) } + func (o *CapabilityProblemEntityRecursive) isValidType() bool { - var allowedEnumValues = []string{"BankAccount", "Document", "LegalEntity"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BankAccount", "Document", "LegalEntity" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_merchant_created_notification_request.go b/src/managementwebhook/model_merchant_created_notification_request.go index f29093bfc..19a40eff8 100644 --- a/src/managementwebhook/model_merchant_created_notification_request.go +++ b/src/managementwebhook/model_merchant_created_notification_request.go @@ -10,9 +10,8 @@ package managementwebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantCreatedNotificationRequest type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &MerchantCreatedNotificationRequest{} // MerchantCreatedNotificationRequest struct for MerchantCreatedNotificationRequest type MerchantCreatedNotificationRequest struct { // Timestamp for when the webhook was created. - CreatedAt time.Time `json:"createdAt"` - Data AccountCreateNotificationData `json:"data"` + CreatedAt time.Time `json:"createdAt"` + Data AccountCreateNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` // Type of notification. @@ -147,7 +146,7 @@ func (o *MerchantCreatedNotificationRequest) SetType(v string) { } func (o MerchantCreatedNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -199,12 +198,14 @@ func (v *NullableMerchantCreatedNotificationRequest) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *MerchantCreatedNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"merchant.created"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "merchant.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_merchant_updated_notification_request.go b/src/managementwebhook/model_merchant_updated_notification_request.go index b71a8814b..2b8fe6178 100644 --- a/src/managementwebhook/model_merchant_updated_notification_request.go +++ b/src/managementwebhook/model_merchant_updated_notification_request.go @@ -10,9 +10,8 @@ package managementwebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantUpdatedNotificationRequest type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &MerchantUpdatedNotificationRequest{} // MerchantUpdatedNotificationRequest struct for MerchantUpdatedNotificationRequest type MerchantUpdatedNotificationRequest struct { // Timestamp for when the webhook was created. - CreatedAt time.Time `json:"createdAt"` - Data AccountUpdateNotificationData `json:"data"` + CreatedAt time.Time `json:"createdAt"` + Data AccountUpdateNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` // Type of notification. @@ -147,7 +146,7 @@ func (o *MerchantUpdatedNotificationRequest) SetType(v string) { } func (o MerchantUpdatedNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -199,12 +198,14 @@ func (v *NullableMerchantUpdatedNotificationRequest) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *MerchantUpdatedNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"merchant.updated"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "merchant.updated" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_mid_service_notification_data.go b/src/managementwebhook/model_mid_service_notification_data.go index 67e3dc457..9886466f3 100644 --- a/src/managementwebhook/model_mid_service_notification_data.go +++ b/src/managementwebhook/model_mid_service_notification_data.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MidServiceNotificationData type satisfies the MappedNullable interface at compile time @@ -317,7 +316,7 @@ func (o *MidServiceNotificationData) SetVerificationStatus(v string) { } func (o MidServiceNotificationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -384,21 +383,23 @@ func (v *NullableMidServiceNotificationData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MidServiceNotificationData) isValidStatus() bool { - var allowedEnumValues = []string{"success", "failure", "capabilityPending", "dataRequired", "updatesExpected"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "success", "failure", "capabilityPending", "dataRequired", "updatesExpected" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } func (o *MidServiceNotificationData) isValidVerificationStatus() bool { - var allowedEnumValues = []string{"valid", "pending", "invalid", "rejected"} - for _, allowed := range allowedEnumValues { - if o.GetVerificationStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "valid", "pending", "invalid", "rejected" } + for _, allowed := range allowedEnumValues { + if o.GetVerificationStatus() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_payment_method_created_notification_request.go b/src/managementwebhook/model_payment_method_created_notification_request.go index 42085f236..797435fb2 100644 --- a/src/managementwebhook/model_payment_method_created_notification_request.go +++ b/src/managementwebhook/model_payment_method_created_notification_request.go @@ -10,9 +10,8 @@ package managementwebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodCreatedNotificationRequest type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &PaymentMethodCreatedNotificationRequest{} // PaymentMethodCreatedNotificationRequest struct for PaymentMethodCreatedNotificationRequest type PaymentMethodCreatedNotificationRequest struct { // Timestamp for when the webhook was created. - CreatedAt time.Time `json:"createdAt"` - Data MidServiceNotificationData `json:"data"` + CreatedAt time.Time `json:"createdAt"` + Data MidServiceNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` // Type of notification. @@ -147,7 +146,7 @@ func (o *PaymentMethodCreatedNotificationRequest) SetType(v string) { } func (o PaymentMethodCreatedNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -199,12 +198,14 @@ func (v *NullablePaymentMethodCreatedNotificationRequest) UnmarshalJSON(src []by return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodCreatedNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"paymentMethod.created"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentMethod.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_payment_method_notification_response.go b/src/managementwebhook/model_payment_method_notification_response.go index 0a744a5b9..35a871b4e 100644 --- a/src/managementwebhook/model_payment_method_notification_response.go +++ b/src/managementwebhook/model_payment_method_notification_response.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodNotificationResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *PaymentMethodNotificationResponse) SetNotificationResponse(v string) { } func (o PaymentMethodNotificationResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullablePaymentMethodNotificationResponse) UnmarshalJSON(src []byte) er v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_payment_method_request_removed_notification_request.go b/src/managementwebhook/model_payment_method_request_removed_notification_request.go index 33e31db83..c0288290f 100644 --- a/src/managementwebhook/model_payment_method_request_removed_notification_request.go +++ b/src/managementwebhook/model_payment_method_request_removed_notification_request.go @@ -10,9 +10,8 @@ package managementwebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodRequestRemovedNotificationRequest type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &PaymentMethodRequestRemovedNotificationRequest{} // PaymentMethodRequestRemovedNotificationRequest struct for PaymentMethodRequestRemovedNotificationRequest type PaymentMethodRequestRemovedNotificationRequest struct { // Timestamp for when the webhook was created. - CreatedAt time.Time `json:"createdAt"` - Data MidServiceNotificationData `json:"data"` + CreatedAt time.Time `json:"createdAt"` + Data MidServiceNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` // Type of notification. @@ -147,7 +146,7 @@ func (o *PaymentMethodRequestRemovedNotificationRequest) SetType(v string) { } func (o PaymentMethodRequestRemovedNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -199,12 +198,14 @@ func (v *NullablePaymentMethodRequestRemovedNotificationRequest) UnmarshalJSON(s return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodRequestRemovedNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"paymentMethod.requestRemoved"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentMethod.requestRemoved" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_payment_method_scheduled_for_removal_notification_request.go b/src/managementwebhook/model_payment_method_scheduled_for_removal_notification_request.go index 0ff529ba4..68edd96d7 100644 --- a/src/managementwebhook/model_payment_method_scheduled_for_removal_notification_request.go +++ b/src/managementwebhook/model_payment_method_scheduled_for_removal_notification_request.go @@ -10,9 +10,8 @@ package managementwebhook import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentMethodScheduledForRemovalNotificationRequest type satisfies the MappedNullable interface at compile time @@ -21,8 +20,8 @@ var _ common.MappedNullable = &PaymentMethodScheduledForRemovalNotificationReque // PaymentMethodScheduledForRemovalNotificationRequest struct for PaymentMethodScheduledForRemovalNotificationRequest type PaymentMethodScheduledForRemovalNotificationRequest struct { // Timestamp for when the webhook was created. - CreatedAt time.Time `json:"createdAt"` - Data MidServiceNotificationData `json:"data"` + CreatedAt time.Time `json:"createdAt"` + Data MidServiceNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` // Type of notification. @@ -147,7 +146,7 @@ func (o *PaymentMethodScheduledForRemovalNotificationRequest) SetType(v string) } func (o PaymentMethodScheduledForRemovalNotificationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -199,12 +198,14 @@ func (v *NullablePaymentMethodScheduledForRemovalNotificationRequest) UnmarshalJ return json.Unmarshal(src, &v.value) } + func (o *PaymentMethodScheduledForRemovalNotificationRequest) isValidType() bool { - var allowedEnumValues = []string{"paymentMethod.requestScheduledForRemoval"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "paymentMethod.requestScheduledForRemoval" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_remediating_action.go b/src/managementwebhook/model_remediating_action.go index b3e671a30..9d2f9f8c3 100644 --- a/src/managementwebhook/model_remediating_action.go +++ b/src/managementwebhook/model_remediating_action.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RemediatingAction type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *RemediatingAction) SetMessage(v string) { } func (o RemediatingAction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableRemediatingAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/managementwebhook/model_verification_error.go b/src/managementwebhook/model_verification_error.go index ca9132cd1..85f3c69d9 100644 --- a/src/managementwebhook/model_verification_error.go +++ b/src/managementwebhook/model_verification_error.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *VerificationError) SetType(v string) { } func (o VerificationError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -272,12 +271,14 @@ func (v *NullableVerificationError) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationError) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/managementwebhook/model_verification_error_recursive.go b/src/managementwebhook/model_verification_error_recursive.go index e3aaf25ad..557dba773 100644 --- a/src/managementwebhook/model_verification_error_recursive.go +++ b/src/managementwebhook/model_verification_error_recursive.go @@ -10,8 +10,7 @@ package managementwebhook import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VerificationErrorRecursive type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *VerificationErrorRecursive) SetRemediatingActions(v []RemediatingAction } func (o VerificationErrorRecursive) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableVerificationErrorRecursive) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *VerificationErrorRecursive) isValidType() bool { - var allowedEnumValues = []string{"dataMissing", "invalidInput", "pendingStatus"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dataMissing", "invalidInput", "pendingStatus" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/payments/api_modifications.go b/src/payments/api_modifications.go index dc9a977bd..46a572b8f 100644 --- a/src/payments/api_modifications.go +++ b/src/payments/api_modifications.go @@ -10,10 +10,10 @@ package payments import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ModificationsApi service @@ -29,13 +29,15 @@ func (r ModificationsApiAdjustAuthorisationInput) AdjustAuthorisationRequest(adj return r } + /* Prepare a request for AdjustAuthorisation @return ModificationsApiAdjustAuthorisationInput */ func (a *ModificationsApi) AdjustAuthorisationInput() ModificationsApiAdjustAuthorisationInput { - return ModificationsApiAdjustAuthorisationInput{} + return ModificationsApiAdjustAuthorisationInput{ + } } /* @@ -53,24 +55,26 @@ Allows you to increase or decrease the authorised amount after the initial autho @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) AdjustAuthorisation(ctx context.Context, r ModificationsApiAdjustAuthorisationInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/adjustAuthorisation" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.adjustAuthorisationRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.adjustAuthorisationRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.Cancel type ModificationsApiCancelInput struct { cancelRequest *CancelRequest @@ -81,13 +85,15 @@ func (r ModificationsApiCancelInput) CancelRequest(cancelRequest CancelRequest) return r } + /* Prepare a request for Cancel @return ModificationsApiCancelInput */ func (a *ModificationsApi) CancelInput() ModificationsApiCancelInput { - return ModificationsApiCancelInput{} + return ModificationsApiCancelInput{ + } } /* @@ -104,24 +110,26 @@ For more information, refer to [Cancel](https://docs.adyen.com/online-payments/c @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) Cancel(ctx context.Context, r ModificationsApiCancelInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/cancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.cancelRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.cancelRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.CancelOrRefund type ModificationsApiCancelOrRefundInput struct { cancelOrRefundRequest *CancelOrRefundRequest @@ -132,13 +140,15 @@ func (r ModificationsApiCancelOrRefundInput) CancelOrRefundRequest(cancelOrRefun return r } + /* Prepare a request for CancelOrRefund @return ModificationsApiCancelOrRefundInput */ func (a *ModificationsApi) CancelOrRefundInput() ModificationsApiCancelOrRefundInput { - return ModificationsApiCancelOrRefundInput{} + return ModificationsApiCancelOrRefundInput{ + } } /* @@ -161,24 +171,26 @@ For more information, refer to [Cancel or refund](https://docs.adyen.com/online- @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) CancelOrRefund(ctx context.Context, r ModificationsApiCancelOrRefundInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/cancelOrRefund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.cancelOrRefundRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.cancelOrRefundRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.Capture type ModificationsApiCaptureInput struct { captureRequest *CaptureRequest @@ -189,13 +201,15 @@ func (r ModificationsApiCaptureInput) CaptureRequest(captureRequest CaptureReque return r } + /* Prepare a request for Capture @return ModificationsApiCaptureInput */ func (a *ModificationsApi) CaptureInput() ModificationsApiCaptureInput { - return ModificationsApiCaptureInput{} + return ModificationsApiCaptureInput{ + } } /* @@ -216,24 +230,26 @@ For more information refer to [Capture](https://docs.adyen.com/online-payments/c @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) Capture(ctx context.Context, r ModificationsApiCaptureInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/capture" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.captureRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.captureRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.Donate type ModificationsApiDonateInput struct { donationRequest *DonationRequest @@ -244,13 +260,15 @@ func (r ModificationsApiDonateInput) DonationRequest(donationRequest DonationReq return r } + /* Prepare a request for Donate @return ModificationsApiDonateInput */ func (a *ModificationsApi) DonateInput() ModificationsApiDonateInput { - return ModificationsApiDonateInput{} + return ModificationsApiDonateInput{ + } } /* @@ -265,24 +283,26 @@ Schedules a new payment to be created (including a new authorisation request) fo @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) Donate(ctx context.Context, r ModificationsApiDonateInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/donate" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.donationRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.donationRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.Refund type ModificationsApiRefundInput struct { refundRequest *RefundRequest @@ -293,13 +313,15 @@ func (r ModificationsApiRefundInput) RefundRequest(refundRequest RefundRequest) return r } + /* Prepare a request for Refund @return ModificationsApiRefundInput */ func (a *ModificationsApi) RefundInput() ModificationsApiRefundInput { - return ModificationsApiRefundInput{} + return ModificationsApiRefundInput{ + } } /* @@ -319,24 +341,26 @@ For more information, refer to [Refund](https://docs.adyen.com/online-payments/c @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) Refund(ctx context.Context, r ModificationsApiRefundInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/refund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.refundRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.refundRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.TechnicalCancel type ModificationsApiTechnicalCancelInput struct { technicalCancelRequest *TechnicalCancelRequest @@ -347,13 +371,15 @@ func (r ModificationsApiTechnicalCancelInput) TechnicalCancelRequest(technicalCa return r } + /* Prepare a request for TechnicalCancel @return ModificationsApiTechnicalCancelInput */ func (a *ModificationsApi) TechnicalCancelInput() ModificationsApiTechnicalCancelInput { - return ModificationsApiTechnicalCancelInput{} + return ModificationsApiTechnicalCancelInput{ + } } /* @@ -363,7 +389,7 @@ This endpoint allows you to cancel a payment if you do not have the PSP referenc In your call, refer to the original payment by using the `reference` that you specified in your payment request. -For more information, see [Technical cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel#technical-cancel). +For more information, see [Technical cancel](https://docs.adyen.com/online-payments/classic-integrations/modify-payments/cancel#technical-cancel). > This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/cancels) endpoint under Checkout API instead. @@ -372,24 +398,26 @@ For more information, see [Technical cancel](https://docs.adyen.com/online-payme @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) TechnicalCancel(ctx context.Context, r ModificationsApiTechnicalCancelInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/technicalCancel" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.technicalCancelRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.technicalCancelRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ModificationsApi.VoidPendingRefund type ModificationsApiVoidPendingRefundInput struct { voidPendingRefundRequest *VoidPendingRefundRequest @@ -400,13 +428,15 @@ func (r ModificationsApiVoidPendingRefundInput) VoidPendingRefundRequest(voidPen return r } + /* Prepare a request for VoidPendingRefund @return ModificationsApiVoidPendingRefundInput */ func (a *ModificationsApi) VoidPendingRefundInput() ModificationsApiVoidPendingRefundInput { - return ModificationsApiVoidPendingRefundInput{} + return ModificationsApiVoidPendingRefundInput{ + } } /* @@ -423,20 +453,22 @@ For more information, refer to [Cancel an unreferenced refund](https://docs.adye @return ModificationResult, *http.Response, error */ func (a *ModificationsApi) VoidPendingRefund(ctx context.Context, r ModificationsApiVoidPendingRefundInput) (ModificationResult, *http.Response, error) { - res := &ModificationResult{} + res := &ModificationResult{} path := "/voidPendingRefund" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.voidPendingRefundRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.voidPendingRefundRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/payments/api_payments.go b/src/payments/api_payments.go index ba2cce245..3ff3526a1 100644 --- a/src/payments/api_payments.go +++ b/src/payments/api_payments.go @@ -10,10 +10,10 @@ package payments import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // PaymentsApi service @@ -29,13 +29,15 @@ func (r PaymentsApiAuthoriseInput) PaymentRequest(paymentRequest PaymentRequest) return r } + /* Prepare a request for Authorise @return PaymentsApiAuthoriseInput */ func (a *PaymentsApi) AuthoriseInput() PaymentsApiAuthoriseInput { - return PaymentsApiAuthoriseInput{} + return PaymentsApiAuthoriseInput{ + } } /* @@ -49,24 +51,26 @@ Creates a payment with a unique reference (`pspReference`) and attempts to obtai @return PaymentResult, *http.Response, error */ func (a *PaymentsApi) Authorise(ctx context.Context, r PaymentsApiAuthoriseInput) (PaymentResult, *http.Response, error) { - res := &PaymentResult{} + res := &PaymentResult{} path := "/authorise" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Authorise3d type PaymentsApiAuthorise3dInput struct { paymentRequest3d *PaymentRequest3d @@ -77,13 +81,15 @@ func (r PaymentsApiAuthorise3dInput) PaymentRequest3d(paymentRequest3d PaymentRe return r } + /* Prepare a request for Authorise3d @return PaymentsApiAuthorise3dInput */ func (a *PaymentsApi) Authorise3dInput() PaymentsApiAuthorise3dInput { - return PaymentsApiAuthorise3dInput{} + return PaymentsApiAuthorise3dInput{ + } } /* @@ -98,24 +104,26 @@ For an authenticated 3D Secure session, completes the payment authorisation. Thi @return PaymentResult, *http.Response, error */ func (a *PaymentsApi) Authorise3d(ctx context.Context, r PaymentsApiAuthorise3dInput) (PaymentResult, *http.Response, error) { - res := &PaymentResult{} + res := &PaymentResult{} path := "/authorise3d" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentRequest3d, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3d, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Authorise3ds2 type PaymentsApiAuthorise3ds2Input struct { paymentRequest3ds2 *PaymentRequest3ds2 @@ -126,13 +134,15 @@ func (r PaymentsApiAuthorise3ds2Input) PaymentRequest3ds2(paymentRequest3ds2 Pay return r } + /* Prepare a request for Authorise3ds2 @return PaymentsApiAuthorise3ds2Input */ func (a *PaymentsApi) Authorise3ds2Input() PaymentsApiAuthorise3ds2Input { - return PaymentsApiAuthorise3ds2Input{} + return PaymentsApiAuthorise3ds2Input{ + } } /* @@ -147,24 +157,26 @@ For an authenticated 3D Secure 2 session, completes the payment authorisation. T @return PaymentResult, *http.Response, error */ func (a *PaymentsApi) Authorise3ds2(ctx context.Context, r PaymentsApiAuthorise3ds2Input) (PaymentResult, *http.Response, error) { - res := &PaymentResult{} + res := &PaymentResult{} path := "/authorise3ds2" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.paymentRequest3ds2, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.paymentRequest3ds2, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.GetAuthenticationResult type PaymentsApiGetAuthenticationResultInput struct { authenticationResultRequest *AuthenticationResultRequest @@ -175,13 +187,15 @@ func (r PaymentsApiGetAuthenticationResultInput) AuthenticationResultRequest(aut return r } + /* Prepare a request for GetAuthenticationResult @return PaymentsApiGetAuthenticationResultInput */ func (a *PaymentsApi) GetAuthenticationResultInput() PaymentsApiGetAuthenticationResultInput { - return PaymentsApiGetAuthenticationResultInput{} + return PaymentsApiGetAuthenticationResultInput{ + } } /* @@ -194,24 +208,26 @@ Return the authentication result after doing a 3D Secure authentication only. @return AuthenticationResultResponse, *http.Response, error */ func (a *PaymentsApi) GetAuthenticationResult(ctx context.Context, r PaymentsApiGetAuthenticationResultInput) (AuthenticationResultResponse, *http.Response, error) { - res := &AuthenticationResultResponse{} + res := &AuthenticationResultResponse{} path := "/getAuthenticationResult" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.authenticationResultRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.authenticationResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by PaymentsApi.Retrieve3ds2Result type PaymentsApiRetrieve3ds2ResultInput struct { threeDS2ResultRequest *ThreeDS2ResultRequest @@ -222,13 +238,15 @@ func (r PaymentsApiRetrieve3ds2ResultInput) ThreeDS2ResultRequest(threeDS2Result return r } + /* Prepare a request for Retrieve3ds2Result @return PaymentsApiRetrieve3ds2ResultInput */ func (a *PaymentsApi) Retrieve3ds2ResultInput() PaymentsApiRetrieve3ds2ResultInput { - return PaymentsApiRetrieve3ds2ResultInput{} + return PaymentsApiRetrieve3ds2ResultInput{ + } } /* @@ -241,20 +259,22 @@ Retrieves the `threeDS2Result` after doing a 3D Secure 2 authentication only. @return ThreeDS2ResultResponse, *http.Response, error */ func (a *PaymentsApi) Retrieve3ds2Result(ctx context.Context, r PaymentsApiRetrieve3ds2ResultInput) (ThreeDS2ResultResponse, *http.Response, error) { - res := &ThreeDS2ResultResponse{} + res := &ThreeDS2ResultResponse{} path := "/retrieve3ds2Result" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.threeDS2ResultRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.threeDS2ResultRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/payments/model_account_info.go b/src/payments/model_account_info.go index 286430e2d..cbdfab3d9 100644 --- a/src/payments/model_account_info.go +++ b/src/payments/model_account_info.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AccountInfo type satisfies the MappedNullable interface at compile time @@ -698,7 +697,7 @@ func (o *AccountInfo) SetWorkPhone(v string) { } func (o AccountInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -803,57 +802,59 @@ func (v *NullableAccountInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AccountInfo) isValidAccountAgeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountAgeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountAgeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountChangeIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetAccountChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetAccountChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidAccountType() bool { - var allowedEnumValues = []string{"notApplicable", "credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidDeliveryAddressUsageIndicator() bool { - var allowedEnumValues = []string{"thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressUsageIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressUsageIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPasswordChangeIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPasswordChangeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPasswordChangeIndicator() == allowed { + return true + } + } + return false } func (o *AccountInfo) isValidPaymentAccountIndicator() bool { - var allowedEnumValues = []string{"notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccountIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "notApplicable", "thisTransaction", "lessThan30Days", "from30To60Days", "moreThan60Days" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccountIndicator() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_acct_info.go b/src/payments/model_acct_info.go index b6c9efb3b..6bc11152e 100644 --- a/src/payments/model_acct_info.go +++ b/src/payments/model_acct_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AcctInfo type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AcctInfo) SetTxnActivityYear(v string) { } func (o AcctInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,66 +678,68 @@ func (v *NullableAcctInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AcctInfo) isValidChAccAgeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccAgeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccAgeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetChAccChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetChAccChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidChAccPwChangeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChAccPwChangeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChAccPwChangeInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidPaymentAccInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetPaymentAccInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetPaymentAccInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipAddressUsageInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetShipAddressUsageInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetShipAddressUsageInd() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidShipNameIndicator() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetShipNameIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetShipNameIndicator() == allowed { + return true + } + } + return false } func (o *AcctInfo) isValidSuspiciousAccActivity() bool { - var allowedEnumValues = []string{"01", "02"} - for _, allowed := range allowedEnumValues { - if o.GetSuspiciousAccActivity() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02" } + for _, allowed := range allowedEnumValues { + if o.GetSuspiciousAccActivity() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data3_d_secure.go b/src/payments/model_additional_data3_d_secure.go index 6beb5c46e..45e4cb62d 100644 --- a/src/payments/model_additional_data3_d_secure.go +++ b/src/payments/model_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,17 +18,17 @@ var _ common.MappedNullable = &AdditionalData3DSecure{} // AdditionalData3DSecure struct for AdditionalData3DSecure type AdditionalData3DSecure struct { - // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. + // Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen still selects the version of 3D Secure based on configuration to optimize authorisation rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen will not offer 3D Secure 2 to your shopper regardless of your configuration. Allow3DS2 *string `json:"allow3DS2,omitempty"` // Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen ChallengeWindowSize *string `json:"challengeWindowSize,omitempty"` - // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + // Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. ExecuteThreeD *string `json:"executeThreeD,omitempty"` // In case of Secure+, this field must be set to **CUPSecurePlus**. MpiImplementationType *string `json:"mpiImplementationType,omitempty"` - // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemption *string `json:"scaExemption,omitempty"` - // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. + // Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **1.0.2**: Apply 3D Secure version 1.0.2. * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. For example, if the configuration is to fall back to 3D Secure 1, we will apply version 1.0.2. * If you prefer 2.1.0 or 2.2.0 but the BIN is not enrolled, you will receive an error. ThreeDSVersion *string `json:"threeDSVersion,omitempty"` } @@ -243,7 +242,7 @@ func (o *AdditionalData3DSecure) SetThreeDSVersion(v string) { } func (o AdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -309,12 +308,14 @@ func (v *NullableAdditionalData3DSecure) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalData3DSecure) isValidChallengeWindowSize() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeWindowSize() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeWindowSize() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data_airline.go b/src/payments/model_additional_data_airline.go index 9d9ee676c..95438e0fd 100644 --- a/src/payments/model_additional_data_airline.go +++ b/src/payments/model_additional_data_airline.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataAirline type satisfies the MappedNullable interface at compile time @@ -984,7 +983,7 @@ func (o *AdditionalDataAirline) SetAirlineTravelAgencyName(v string) { } func (o AdditionalDataAirline) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1113,3 +1112,6 @@ func (v *NullableAdditionalDataAirline) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_car_rental.go b/src/payments/model_additional_data_car_rental.go index ae3f5ee1b..982f56d16 100644 --- a/src/payments/model_additional_data_car_rental.go +++ b/src/payments/model_additional_data_car_rental.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataCarRental type satisfies the MappedNullable interface at compile time @@ -821,7 +820,7 @@ func (o *AdditionalDataCarRental) SetTravelEntertainmentAuthDataMarket(v string) } func (o AdditionalDataCarRental) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -937,3 +936,6 @@ func (v *NullableAdditionalDataCarRental) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_common.go b/src/payments/model_additional_data_common.go index 1cddcf880..ff7bd45fd 100644 --- a/src/payments/model_additional_data_common.go +++ b/src/payments/model_additional_data_common.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataCommon) SetSubMerchantTaxId(v string) { } func (o AdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -679,12 +678,14 @@ func (v *NullableAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalDataCommon) isValidIndustryUsage() bool { - var allowedEnumValues = []string{"NoShow", "DelayedCharge"} - for _, allowed := range allowedEnumValues { - if o.GetIndustryUsage() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NoShow", "DelayedCharge" } + for _, allowed := range allowedEnumValues { + if o.GetIndustryUsage() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_additional_data_level23.go b/src/payments/model_additional_data_level23.go index 879c31524..3ffc7df4a 100644 --- a/src/payments/model_additional_data_level23.go +++ b/src/payments/model_additional_data_level23.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataLevel23 type satisfies the MappedNullable interface at compile time @@ -39,7 +38,7 @@ type AdditionalDataLevel23 struct { EnhancedSchemeDataItemDetailLineItemNrDiscountAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].discountAmount,omitempty"` // The product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrProductCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].productCode,omitempty"` - // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces + // The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces EnhancedSchemeDataItemDetailLineItemNrQuantity *string `json:"enhancedSchemeData.itemDetailLine[itemNr].quantity,omitempty"` // The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrTotalAmount *string `json:"enhancedSchemeData.itemDetailLine[itemNr].totalAmount,omitempty"` @@ -617,7 +616,7 @@ func (o *AdditionalDataLevel23) SetEnhancedSchemeDataTotalTaxAmount(v string) { } func (o AdditionalDataLevel23) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -715,3 +714,6 @@ func (v *NullableAdditionalDataLevel23) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_lodging.go b/src/payments/model_additional_data_lodging.go index 6be62328c..38a3d559b 100644 --- a/src/payments/model_additional_data_lodging.go +++ b/src/payments/model_additional_data_lodging.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataLodging type satisfies the MappedNullable interface at compile time @@ -583,7 +582,7 @@ func (o *AdditionalDataLodging) SetTravelEntertainmentAuthDataMarket(v string) { } func (o AdditionalDataLodging) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -678,3 +677,6 @@ func (v *NullableAdditionalDataLodging) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_modifications.go b/src/payments/model_additional_data_modifications.go index bf8add520..4aee8095a 100644 --- a/src/payments/model_additional_data_modifications.go +++ b/src/payments/model_additional_data_modifications.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataModifications type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataModifications) SetInstallmentPaymentDataSelectedInstallme } func (o AdditionalDataModifications) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataModifications) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_open_invoice.go b/src/payments/model_additional_data_open_invoice.go index 67b312b29..ecac2b5d2 100644 --- a/src/payments/model_additional_data_open_invoice.go +++ b/src/payments/model_additional_data_open_invoice.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataOpenInvoice type satisfies the MappedNullable interface at compile time @@ -651,7 +650,7 @@ func (o *AdditionalDataOpenInvoice) SetOpeninvoicedataLineItemNrTrackingUri(v st } func (o AdditionalDataOpenInvoice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -752,3 +751,6 @@ func (v *NullableAdditionalDataOpenInvoice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_opi.go b/src/payments/model_additional_data_opi.go index 0b256d1f4..00594af83 100644 --- a/src/payments/model_additional_data_opi.go +++ b/src/payments/model_additional_data_opi.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *AdditionalDataOpi) SetOpiIncludeTransToken(v string) { } func (o AdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_ratepay.go b/src/payments/model_additional_data_ratepay.go index 6e3c5e3c4..77b495024 100644 --- a/src/payments/model_additional_data_ratepay.go +++ b/src/payments/model_additional_data_ratepay.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRatepay type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *AdditionalDataRatepay) SetRatepaydataInvoiceId(v string) { } func (o AdditionalDataRatepay) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableAdditionalDataRatepay) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_retry.go b/src/payments/model_additional_data_retry.go index 4f8aec95b..25bf8b77f 100644 --- a/src/payments/model_additional_data_retry.go +++ b/src/payments/model_additional_data_retry.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRetry type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *AdditionalDataRetry) SetRetrySkipRetry(v string) { } func (o AdditionalDataRetry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableAdditionalDataRetry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_risk.go b/src/payments/model_additional_data_risk.go index af2cffb35..cd8980086 100644 --- a/src/payments/model_additional_data_risk.go +++ b/src/payments/model_additional_data_risk.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRisk type satisfies the MappedNullable interface at compile time @@ -753,7 +752,7 @@ func (o *AdditionalDataRisk) SetRiskdataSkipRisk(v string) { } func (o AdditionalDataRisk) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -863,3 +862,6 @@ func (v *NullableAdditionalDataRisk) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_risk_standalone.go b/src/payments/model_additional_data_risk_standalone.go index c18763ff7..6e7af9ab2 100644 --- a/src/payments/model_additional_data_risk_standalone.go +++ b/src/payments/model_additional_data_risk_standalone.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataRiskStandalone type satisfies the MappedNullable interface at compile time @@ -549,7 +548,7 @@ func (o *AdditionalDataRiskStandalone) SetTokenDataType(v string) { } func (o AdditionalDataRiskStandalone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -641,3 +640,6 @@ func (v *NullableAdditionalDataRiskStandalone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_sub_merchant.go b/src/payments/model_additional_data_sub_merchant.go index f74369468..c2130085c 100644 --- a/src/payments/model_additional_data_sub_merchant.go +++ b/src/payments/model_additional_data_sub_merchant.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataSubMerchant type satisfies the MappedNullable interface at compile time @@ -379,7 +378,7 @@ func (o *AdditionalDataSubMerchant) SetSubMerchantSubSellerSubSellerNrTaxId(v st } func (o AdditionalDataSubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -456,3 +455,6 @@ func (v *NullableAdditionalDataSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_temporary_services.go b/src/payments/model_additional_data_temporary_services.go index 8532bece7..d0a56e117 100644 --- a/src/payments/model_additional_data_temporary_services.go +++ b/src/payments/model_additional_data_temporary_services.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataTemporaryServices type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *AdditionalDataTemporaryServices) SetEnhancedSchemeDataTotalTaxAmount(v } func (o AdditionalDataTemporaryServices) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableAdditionalDataTemporaryServices) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_additional_data_wallets.go b/src/payments/model_additional_data_wallets.go index 504e446fe..4333c8e56 100644 --- a/src/payments/model_additional_data_wallets.go +++ b/src/payments/model_additional_data_wallets.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalDataWallets type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *AdditionalDataWallets) SetVisacheckoutCallId(v string) { } func (o AdditionalDataWallets) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableAdditionalDataWallets) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_address.go b/src/payments/model_address.go index 4e20de581..353107b71 100644 --- a/src/payments/model_address.go +++ b/src/payments/model_address.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_adjust_authorisation_request.go b/src/payments/model_adjust_authorisation_request.go index ab579f25b..9f6aa5175 100644 --- a/src/payments/model_adjust_authorisation_request.go +++ b/src/payments/model_adjust_authorisation_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdjustAuthorisationRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type AdjustAuthorisationRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *AdjustAuthorisationRequest) SetUniqueTerminalId(v string) { } func (o AdjustAuthorisationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableAdjustAuthorisationRequest) 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 9c3a915a5..38427fa38 100644 --- a/src/payments/model_amount.go +++ b/src/payments/model_amount.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_application_info.go b/src/payments/model_application_info.go index 406dacb12..c793fe8af 100644 --- a/src/payments/model_application_info.go +++ b/src/payments/model_application_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ApplicationInfo type satisfies the MappedNullable interface at compile time @@ -19,11 +18,11 @@ var _ common.MappedNullable = &ApplicationInfo{} // ApplicationInfo struct for ApplicationInfo type ApplicationInfo struct { - AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` - AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` - ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` - MerchantApplication *CommonField `json:"merchantApplication,omitempty"` - MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` + AdyenLibrary *CommonField `json:"adyenLibrary,omitempty"` + AdyenPaymentSource *CommonField `json:"adyenPaymentSource,omitempty"` + ExternalPlatform *ExternalPlatform `json:"externalPlatform,omitempty"` + MerchantApplication *CommonField `json:"merchantApplication,omitempty"` + MerchantDevice *MerchantDevice `json:"merchantDevice,omitempty"` ShopperInteractionDevice *ShopperInteractionDevice `json:"shopperInteractionDevice,omitempty"` } @@ -237,7 +236,7 @@ func (o *ApplicationInfo) SetShopperInteractionDevice(v ShopperInteractionDevice } func (o ApplicationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableApplicationInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_authentication_result_request.go b/src/payments/model_authentication_result_request.go index dbb32f78d..1dee88cd9 100644 --- a/src/payments/model_authentication_result_request.go +++ b/src/payments/model_authentication_result_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationResultRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *AuthenticationResultRequest) SetPspReference(v string) { } func (o AuthenticationResultRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAuthenticationResultRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_authentication_result_response.go b/src/payments/model_authentication_result_response.go index b30ba1066..31600dc10 100644 --- a/src/payments/model_authentication_result_response.go +++ b/src/payments/model_authentication_result_response.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AuthenticationResultResponse type satisfies the MappedNullable interface at compile time @@ -105,7 +104,7 @@ func (o *AuthenticationResultResponse) SetThreeDS2Result(v ThreeDS2Result) { } func (o AuthenticationResultResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableAuthenticationResultResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_bank_account.go b/src/payments/model_bank_account.go index 1d30d5924..3e130f085 100644 --- a/src/payments/model_bank_account.go +++ b/src/payments/model_bank_account.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_browser_info.go b/src/payments/model_browser_info.go index 02d9d3112..654c55683 100644 --- a/src/payments/model_browser_info.go +++ b/src/payments/model_browser_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BrowserInfo type satisfies the MappedNullable interface at compile time @@ -293,7 +292,7 @@ func (o *BrowserInfo) SetUserAgent(v string) { } func (o BrowserInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -351,3 +350,6 @@ func (v *NullableBrowserInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_cancel_or_refund_request.go b/src/payments/model_cancel_or_refund_request.go index 7c49d8a19..8df90cfb0 100644 --- a/src/payments/model_cancel_or_refund_request.go +++ b/src/payments/model_cancel_or_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CancelOrRefundRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type CancelOrRefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -329,7 +328,7 @@ func (o *CancelOrRefundRequest) SetUniqueTerminalId(v string) { } func (o CancelOrRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -399,3 +398,6 @@ func (v *NullableCancelOrRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_cancel_request.go b/src/payments/model_cancel_request.go index 222043179..05c2dc21b 100644 --- a/src/payments/model_cancel_request.go +++ b/src/payments/model_cancel_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CancelRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type CancelRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -363,7 +362,7 @@ func (o *CancelRequest) SetUniqueTerminalId(v string) { } func (o CancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -436,3 +435,6 @@ func (v *NullableCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_capture_request.go b/src/payments/model_capture_request.go index f50d178d9..8e3cd3701 100644 --- a/src/payments/model_capture_request.go +++ b/src/payments/model_capture_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CaptureRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type CaptureRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *CaptureRequest) SetUniqueTerminalId(v string) { } func (o CaptureRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableCaptureRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_card.go b/src/payments/model_card.go index 25e611122..f20d52a5b 100644 --- a/src/payments/model_card.go +++ b/src/payments/model_card.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_common_field.go b/src/payments/model_common_field.go index e485d0e8b..a98d7f402 100644 --- a/src/payments/model_common_field.go +++ b/src/payments/model_common_field.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CommonField type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CommonField) SetVersion(v string) { } func (o CommonField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCommonField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_device_render_options.go b/src/payments/model_device_render_options.go index bd5572a94..a58b59de3 100644 --- a/src/payments/model_device_render_options.go +++ b/src/payments/model_device_render_options.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DeviceRenderOptions type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *DeviceRenderOptions) SetSdkUiType(v []string) { } func (o DeviceRenderOptions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,12 +164,14 @@ func (v *NullableDeviceRenderOptions) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DeviceRenderOptions) isValidSdkInterface() bool { - var allowedEnumValues = []string{"native", "html", "both"} - for _, allowed := range allowedEnumValues { - if o.GetSdkInterface() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "native", "html", "both" } + for _, allowed := range allowedEnumValues { + if o.GetSdkInterface() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_donation_request.go b/src/payments/model_donation_request.go index 5499fcdfc..34a3dd0a3 100644 --- a/src/payments/model_donation_request.go +++ b/src/payments/model_donation_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DonationRequest type satisfies the MappedNullable interface at compile time @@ -22,10 +21,10 @@ type DonationRequest struct { // The Adyen account name of the charity. DonationAccount string `json:"donationAccount"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` + MerchantAccount string `json:"merchantAccount"` ModificationAmount Amount `json:"modificationAmount"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference *string `json:"originalReference,omitempty"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference *string `json:"originalReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -220,7 +219,7 @@ func (o *DonationRequest) SetReference(v string) { } func (o DonationRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -279,3 +278,6 @@ func (v *NullableDonationRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_external_platform.go b/src/payments/model_external_platform.go index 9ead21d67..553f76e26 100644 --- a/src/payments/model_external_platform.go +++ b/src/payments/model_external_platform.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ExternalPlatform type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ExternalPlatform) SetVersion(v string) { } func (o ExternalPlatform) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableExternalPlatform) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_forex_quote.go b/src/payments/model_forex_quote.go index d4fb0d1e9..a266c0df8 100644 --- a/src/payments/model_forex_quote.go +++ b/src/payments/model_forex_quote.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ForexQuote type satisfies the MappedNullable interface at compile time @@ -24,14 +23,14 @@ type ForexQuote struct { Account *string `json:"account,omitempty"` // The account type. AccountType *string `json:"accountType,omitempty"` - BaseAmount *Amount `json:"baseAmount,omitempty"` + BaseAmount *Amount `json:"baseAmount,omitempty"` // The base points. - BasePoints int32 `json:"basePoints"` - Buy *Amount `json:"buy,omitempty"` - Interbank *Amount `json:"interbank,omitempty"` + BasePoints int32 `json:"basePoints"` + Buy *Amount `json:"buy,omitempty"` + Interbank *Amount `json:"interbank,omitempty"` // The reference assigned to the forex quote request. Reference *string `json:"reference,omitempty"` - Sell *Amount `json:"sell,omitempty"` + Sell *Amount `json:"sell,omitempty"` // The signature to validate the integrity. Signature *string `json:"signature,omitempty"` // The source of the forex quote. @@ -430,7 +429,7 @@ func (o *ForexQuote) SetValidTill(v time.Time) { } func (o ForexQuote) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -509,3 +508,6 @@ func (v *NullableForexQuote) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_check_result.go b/src/payments/model_fraud_check_result.go index 8edb21c47..9d20a6365 100644 --- a/src/payments/model_fraud_check_result.go +++ b/src/payments/model_fraud_check_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_check_result_wrapper.go b/src/payments/model_fraud_check_result_wrapper.go index 88cfe0e4f..3eaecfa52 100644 --- a/src/payments/model_fraud_check_result_wrapper.go +++ b/src/payments/model_fraud_check_result_wrapper.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudCheckResultWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *FraudCheckResultWrapper) SetFraudCheckResult(v FraudCheckResult) { } func (o FraudCheckResultWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableFraudCheckResultWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fraud_result.go b/src/payments/model_fraud_result.go index ec8ae2d05..bad3b06a9 100644 --- a/src/payments/model_fraud_result.go +++ b/src/payments/model_fraud_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResultWrapper) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fund_destination.go b/src/payments/model_fund_destination.go index d7494473d..81c19910f 100644 --- a/src/payments/model_fund_destination.go +++ b/src/payments/model_fund_destination.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FundDestination type satisfies the MappedNullable interface at compile time @@ -21,16 +20,16 @@ var _ common.MappedNullable = &FundDestination{} type FundDestination struct { // a map of name/value pairs for passing in additional/industry-specific data AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. SelectedRecurringDetailReference *string `json:"selectedRecurringDetailReference,omitempty"` // the email address of the person ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - ShopperReference *string `json:"shopperReference,omitempty"` - SubMerchant *SubMerchant `json:"subMerchant,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` + SubMerchant *SubMerchant `json:"subMerchant,omitempty"` // the telephone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -341,7 +340,7 @@ func (o *FundDestination) SetTelephoneNumber(v string) { } func (o FundDestination) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -415,3 +414,6 @@ func (v *NullableFundDestination) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_fund_source.go b/src/payments/model_fund_source.go index c924fc600..2fc7d0a41 100644 --- a/src/payments/model_fund_source.go +++ b/src/payments/model_fund_source.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FundSource type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &FundSource{} type FundSource struct { // A map of name-value pairs for passing additional or industry-specific data. AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Email address of the person. ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Phone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -240,7 +239,7 @@ func (o *FundSource) SetTelephoneNumber(v string) { } func (o FundSource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -305,3 +304,6 @@ func (v *NullableFundSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_installments.go b/src/payments/model_installments.go index a8f302602..03b9708d7 100644 --- a/src/payments/model_installments.go +++ b/src/payments/model_installments.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Installments type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &Installments{} // Installments struct for Installments type Installments struct { - // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** + // The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** Plan *string `json:"plan,omitempty"` // Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. Value int32 `json:"value"` @@ -100,7 +99,7 @@ func (o *Installments) SetValue(v int32) { } func (o Installments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -152,12 +151,14 @@ func (v *NullableInstallments) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Installments) isValidPlan() bool { - var allowedEnumValues = []string{"regular", "revolving"} - for _, allowed := range allowedEnumValues { - if o.GetPlan() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "regular", "revolving" } + for _, allowed := range allowedEnumValues { + if o.GetPlan() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_mandate.go b/src/payments/model_mandate.go index a264f0b35..47ab79b19 100644 --- a/src/payments/model_mandate.go +++ b/src/payments/model_mandate.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Mandate type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &Mandate{} type Mandate struct { // The billing amount (in minor units) of the recurring transactions. Amount string `json:"amount"` - // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + // The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. AmountRule *string `json:"amountRule,omitempty"` - // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + // The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. BillingAttemptsRule *string `json:"billingAttemptsRule,omitempty"` // The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. BillingDay *string `json:"billingDay,omitempty"` @@ -290,7 +289,7 @@ func (o *Mandate) SetStartsAt(v string) { } func (o Mandate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -356,30 +355,32 @@ func (v *NullableMandate) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Mandate) isValidAmountRule() bool { - var allowedEnumValues = []string{"max", "exact"} - for _, allowed := range allowedEnumValues { - if o.GetAmountRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "max", "exact" } + for _, allowed := range allowedEnumValues { + if o.GetAmountRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidBillingAttemptsRule() bool { - var allowedEnumValues = []string{"on", "before", "after"} - for _, allowed := range allowedEnumValues { - if o.GetBillingAttemptsRule() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "on", "before", "after" } + for _, allowed := range allowedEnumValues { + if o.GetBillingAttemptsRule() == allowed { + return true + } + } + return false } func (o *Mandate) isValidFrequency() bool { - var allowedEnumValues = []string{"adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly"} - for _, allowed := range allowedEnumValues { - if o.GetFrequency() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "adhoc", "daily", "weekly", "biWeekly", "monthly", "quarterly", "halfYearly", "yearly" } + for _, allowed := range allowedEnumValues { + if o.GetFrequency() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_merchant_device.go b/src/payments/model_merchant_device.go index 8b9c2f185..3b8d324e2 100644 --- a/src/payments/model_merchant_device.go +++ b/src/payments/model_merchant_device.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *MerchantDevice) SetReference(v string) { } func (o MerchantDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableMerchantDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_merchant_risk_indicator.go b/src/payments/model_merchant_risk_indicator.go index 68809f4d4..84aea89e1 100644 --- a/src/payments/model_merchant_risk_indicator.go +++ b/src/payments/model_merchant_risk_indicator.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantRiskIndicator type satisfies the MappedNullable interface at compile time @@ -31,7 +30,7 @@ type MerchantRiskIndicator struct { DeliveryEmailAddress *string `json:"deliveryEmailAddress,omitempty"` // The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` DeliveryTimeframe *string `json:"deliveryTimeframe,omitempty"` - GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` + GiftCardAmount *Amount `json:"giftCardAmount,omitempty"` // For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. GiftCardCount *int32 `json:"giftCardCount,omitempty"` // For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. @@ -519,7 +518,7 @@ func (o *MerchantRiskIndicator) SetShipIndicator(v string) { } func (o MerchantRiskIndicator) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -609,21 +608,23 @@ func (v *NullableMerchantRiskIndicator) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *MerchantRiskIndicator) isValidDeliveryAddressIndicator() bool { - var allowedEnumValues = []string{"shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryAddressIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "shipToBillingAddress", "shipToVerifiedAddress", "shipToNewAddress", "shipToStore", "digitalGoods", "goodsNotShipped", "other" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryAddressIndicator() == allowed { + return true + } + } + return false } func (o *MerchantRiskIndicator) isValidDeliveryTimeframe() bool { - var allowedEnumValues = []string{"electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping"} - for _, allowed := range allowedEnumValues { - if o.GetDeliveryTimeframe() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "electronicDelivery", "sameDayShipping", "overnightShipping", "twoOrMoreDaysShipping" } + for _, allowed := range allowedEnumValues { + if o.GetDeliveryTimeframe() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_modification_result.go b/src/payments/model_modification_result.go index d487858d3..46f967484 100644 --- a/src/payments/model_modification_result.go +++ b/src/payments/model_modification_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ModificationResult type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModificationResult) SetResponse(v string) { } func (o ModificationResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -180,12 +179,14 @@ func (v *NullableModificationResult) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ModificationResult) isValidResponse() bool { - var allowedEnumValues = []string{"[capture-received]", "[cancel-received]", "[refund-received]", "[cancelOrRefund-received]", "[adjustAuthorisation-received]", "[donation-received]", "[technical-cancel-received]", "[voidPendingRefund-received]"} - for _, allowed := range allowedEnumValues { - if o.GetResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "[capture-received]", "[cancel-received]", "[refund-received]", "[cancelOrRefund-received]", "[adjustAuthorisation-received]", "[donation-received]", "[technical-cancel-received]", "[voidPendingRefund-received]" } + for _, allowed := range allowedEnumValues { + if o.GetResponse() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_name.go b/src/payments/model_name.go index 97b3ed0ed..e25069ff7 100644 --- a/src/payments/model_name.go +++ b/src/payments/model_name.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_payment_request.go b/src/payments/model_payment_request.go index 220e4df96..674a8da26 100644 --- a/src/payments/model_payment_request.go +++ b/src/payments/model_payment_request.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRequest type satisfies the MappedNullable interface at compile time @@ -20,22 +19,22 @@ var _ common.MappedNullable = &PaymentRequest{} // PaymentRequest struct for PaymentRequest type PaymentRequest struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BankAccount *BankAccount `json:"bankAccount,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BankAccount *BankAccount `json:"bankAccount,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). @@ -43,32 +42,32 @@ type PaymentRequest struct { // The type of the entity the payment is processed for. EntityType *string `json:"entityType,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` FundDestination *FundDestination `json:"fundDestination,omitempty"` - FundSource *FundSource `json:"fundSource,omitempty"` + FundSource *FundSource `json:"fundSource,omitempty"` // The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - FundingSource *string `json:"fundingSource,omitempty"` - Installments *Installments `json:"installments,omitempty"` + FundingSource *string `json:"fundingSource,omitempty"` + Installments *Installments `json:"installments,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` - Mandate *Mandate `json:"mandate,omitempty"` + Mandate *Mandate `json:"mandate,omitempty"` // The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. Mcc *string `json:"mcc,omitempty"` // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The two-character country code of the shopper's nationality. Nationality *string `json:"nationality,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` + OrderReference *string `json:"orderReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` @@ -86,7 +85,7 @@ type PaymentRequest struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -98,7 +97,7 @@ type PaymentRequest struct { // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -1805,7 +1804,7 @@ func (o *PaymentRequest) SetTrustedShopper(v bool) { } func (o PaymentRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2006,39 +2005,41 @@ func (v *NullablePaymentRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "CompanyName"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "CompanyName" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidFundingSource() bool { - var allowedEnumValues = []string{"credit", "debit"} - for _, allowed := range allowedEnumValues { - if o.GetFundingSource() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "credit", "debit" } + for _, allowed := range allowedEnumValues { + if o.GetFundingSource() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_request3d.go b/src/payments/model_payment_request3d.go index 8cc660132..3b9cd2ca3 100644 --- a/src/payments/model_payment_request3d.go +++ b/src/payments/model_payment_request3d.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRequest3d type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &PaymentRequest3d{} // PaymentRequest3d struct for PaymentRequest3d type PaymentRequest3d struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount *Amount `json:"amount,omitempty"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount *Amount `json:"amount,omitempty"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -50,16 +49,16 @@ type PaymentRequest3d struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. OrderReference *string `json:"orderReference,omitempty"` // Payment authorisation response returned by the card issuer. The `paResponse` field holds the PaRes value received from the card issuer. - PaResponse string `json:"paResponse"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + PaResponse string `json:"paResponse"` + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -77,7 +76,7 @@ type PaymentRequest3d struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -89,7 +88,7 @@ type PaymentRequest3d struct { // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -1540,7 +1539,7 @@ func (o *PaymentRequest3d) SetTrustedShopper(v bool) { } func (o PaymentRequest3d) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1717,21 +1716,23 @@ func (v *NullablePaymentRequest3d) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest3d) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest3d) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_request3ds2.go b/src/payments/model_payment_request3ds2.go index 22ed13853..738d757db 100644 --- a/src/payments/model_payment_request3ds2.go +++ b/src/payments/model_payment_request3ds2.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentRequest3ds2 type satisfies the MappedNullable interface at compile time @@ -20,26 +19,26 @@ var _ common.MappedNullable = &PaymentRequest3ds2{} // PaymentRequest3ds2 struct for PaymentRequest3ds2 type PaymentRequest3ds2 struct { - AccountInfo *AccountInfo `json:"accountInfo,omitempty"` - AdditionalAmount *Amount `json:"additionalAmount,omitempty"` + AccountInfo *AccountInfo `json:"accountInfo,omitempty"` + AdditionalAmount *Amount `json:"additionalAmount,omitempty"` // This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` + AdditionalData *map[string]string `json:"additionalData,omitempty"` + Amount Amount `json:"amount"` + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // The delay between the authorisation and scheduled auto-capture, specified in hours. CaptureDelayHours *int32 `json:"captureDelayHours,omitempty"` // The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - DateOfBirth *string `json:"dateOfBirth,omitempty"` - DccQuote *ForexQuote `json:"dccQuote,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + DateOfBirth *string `json:"dateOfBirth,omitempty"` + DccQuote *ForexQuote `json:"dccQuote,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` // The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 DeliveryDate *time.Time `json:"deliveryDate,omitempty"` // A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). DeviceFingerprint *string `json:"deviceFingerprint,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` // The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. LocalizedShopperStatement *map[string]string `json:"localizedShopperStatement,omitempty"` @@ -48,14 +47,14 @@ type PaymentRequest3ds2 struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` - MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` - // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + MerchantOrderReference *string `json:"merchantOrderReference,omitempty"` + MerchantRiskIndicator *MerchantRiskIndicator `json:"merchantRiskIndicator,omitempty"` + // Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. Metadata *map[string]string `json:"metadata,omitempty"` // When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - OrderReference *string `json:"orderReference,omitempty"` - Recurring *Recurring `json:"recurring,omitempty"` - // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + OrderReference *string `json:"orderReference,omitempty"` + Recurring *Recurring `json:"recurring,omitempty"` + // Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. RecurringProcessingModel *string `json:"recurringProcessingModel,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` @@ -73,7 +72,7 @@ type PaymentRequest3ds2 struct { ShopperInteraction *string `json:"shopperInteraction,omitempty"` // The combination of a language code and a country code to specify the language to be used in the payment. ShopperLocale *string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. @@ -85,9 +84,9 @@ type PaymentRequest3ds2 struct { // The ecommerce or point-of-sale store that is processing the payment. Used in: * [Partner platform integrations](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners#route-payments) for the [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic). * [Platform setup integrations](https://docs.adyen.com/marketplaces-and-platforms/additional-for-platform-setup/route-payment-to-store) for the [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms). Store *string `json:"store,omitempty"` // The shopper's telephone number. - TelephoneNumber *string `json:"telephoneNumber,omitempty"` + TelephoneNumber *string `json:"telephoneNumber,omitempty"` ThreeDS2RequestData *ThreeDS2RequestData `json:"threeDS2RequestData,omitempty"` - ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` + ThreeDS2Result *ThreeDS2Result `json:"threeDS2Result,omitempty"` // The ThreeDS2Token that was returned in the /authorise call. ThreeDS2Token *string `json:"threeDS2Token,omitempty"` // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. @@ -1539,7 +1538,7 @@ func (o *PaymentRequest3ds2) SetTrustedShopper(v bool) { } func (o PaymentRequest3ds2) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1716,21 +1715,23 @@ func (v *NullablePaymentRequest3ds2) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentRequest3ds2) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } func (o *PaymentRequest3ds2) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_payment_result.go b/src/payments/model_payment_result.go index cc4fb6160..0e149dc97 100644 --- a/src/payments/model_payment_result.go +++ b/src/payments/model_payment_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentResult type satisfies the MappedNullable interface at compile time @@ -22,11 +21,11 @@ type PaymentResult struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` // Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` DccAmount *Amount `json:"dccAmount,omitempty"` // Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - DccSignature *string `json:"dccSignature,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DccSignature *string `json:"dccSignature,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. IssuerUrl *string `json:"issuerUrl,omitempty"` // The payment session. @@ -411,7 +410,7 @@ func (o *PaymentResult) SetResultCode(v string) { } func (o PaymentResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -492,12 +491,14 @@ func (v *NullablePaymentResult) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PaymentResult) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_phone.go b/src/payments/model_phone.go index af95849fb..427ca878c 100644 --- a/src/payments/model_phone.go +++ b/src/payments/model_phone.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Phone type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *Phone) SetSubscriber(v string) { } func (o Phone) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePhone) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_platform_chargeback_logic.go b/src/payments/model_platform_chargeback_logic.go index 90a09dd95..c41a20ff6 100644 --- a/src/payments/model_platform_chargeback_logic.go +++ b/src/payments/model_platform_chargeback_logic.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PlatformChargebackLogic type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *PlatformChargebackLogic) SetTargetAccount(v string) { } func (o PlatformChargebackLogic) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullablePlatformChargebackLogic) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PlatformChargebackLogic) isValidBehavior() bool { - var allowedEnumValues = []string{"deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount"} - for _, allowed := range allowedEnumValues { - if o.GetBehavior() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "deductAccordingToSplitRatio", "deductFromLiableAccount", "deductFromOneBalanceAccount" } + for _, allowed := range allowedEnumValues { + if o.GetBehavior() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_recurring.go b/src/payments/model_recurring.go index 77098553a..e521405a1 100644 --- a/src/payments/model_recurring.go +++ b/src/payments/model_recurring.go @@ -10,9 +10,8 @@ package payments import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_refund_request.go b/src/payments/model_refund_request.go index e7c6b0be8..daa64410a 100644 --- a/src/payments/model_refund_request.go +++ b/src/payments/model_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RefundRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type RefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount Amount `json:"modificationAmount"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount Amount `json:"modificationAmount"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference string `json:"originalReference"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference string `json:"originalReference"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -389,7 +388,7 @@ func (o *RefundRequest) SetUniqueTerminalId(v string) { } func (o RefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -463,3 +462,6 @@ func (v *NullableRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data3_d_secure.go b/src/payments/model_response_additional_data3_d_secure.go index 2d11c04b4..722ef25a8 100644 --- a/src/payments/model_response_additional_data3_d_secure.go +++ b/src/payments/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_billing_address.go b/src/payments/model_response_additional_data_billing_address.go index f908f1fd2..9bec049f7 100644 --- a/src/payments/model_response_additional_data_billing_address.go +++ b/src/payments/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_card.go b/src/payments/model_response_additional_data_card.go index 39187424a..21f500859 100644 --- a/src/payments/model_response_additional_data_card.go +++ b/src/payments/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_common.go b/src/payments/model_response_additional_data_common.go index 4ef59ae33..b0c3f440f 100644 --- a/src/payments/model_response_additional_data_common.go +++ b/src/payments/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_response_additional_data_domestic_error.go b/src/payments/model_response_additional_data_domestic_error.go index 31b6e8617..c7234e0ba 100644 --- a/src/payments/model_response_additional_data_domestic_error.go +++ b/src/payments/model_response_additional_data_domestic_error.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataDomesticError type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ResponseAdditionalDataDomesticError) SetDomesticShopperAdvice(v string) } func (o ResponseAdditionalDataDomesticError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableResponseAdditionalDataDomesticError) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_installments.go b/src/payments/model_response_additional_data_installments.go index 3094341fd..45ef6d45e 100644 --- a/src/payments/model_response_additional_data_installments.go +++ b/src/payments/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_network_tokens.go b/src/payments/model_response_additional_data_network_tokens.go index 15900407f..51a9766b6 100644 --- a/src/payments/model_response_additional_data_network_tokens.go +++ b/src/payments/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_opi.go b/src/payments/model_response_additional_data_opi.go index a0e1f8509..2af03f802 100644 --- a/src/payments/model_response_additional_data_opi.go +++ b/src/payments/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_response_additional_data_sepa.go b/src/payments/model_response_additional_data_sepa.go index 7493113bf..5b5d51e69 100644 --- a/src/payments/model_response_additional_data_sepa.go +++ b/src/payments/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_sdk_ephem_pub_key.go b/src/payments/model_sdk_ephem_pub_key.go index 522433390..9ba252f0f 100644 --- a/src/payments/model_sdk_ephem_pub_key.go +++ b/src/payments/model_sdk_ephem_pub_key.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SDKEphemPubKey type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *SDKEphemPubKey) SetY(v string) { } func (o SDKEphemPubKey) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullableSDKEphemPubKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_service_error.go b/src/payments/model_service_error.go index a93a7f371..fdd99e3e3 100644 --- a/src/payments/model_service_error.go +++ b/src/payments/model_service_error.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_shopper_interaction_device.go b/src/payments/model_shopper_interaction_device.go index 3c875ca47..dc927306f 100644 --- a/src/payments/model_shopper_interaction_device.go +++ b/src/payments/model_shopper_interaction_device.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ShopperInteractionDevice type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ShopperInteractionDevice) SetOsVersion(v string) { } func (o ShopperInteractionDevice) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableShopperInteractionDevice) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_split.go b/src/payments/model_split.go index d1fa93acf..ad084e3d3 100644 --- a/src/payments/model_split.go +++ b/src/payments/model_split.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Split type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { // The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. - Account *string `json:"account,omitempty"` - Amount *SplitAmount `json:"amount,omitempty"` + Account *string `json:"account,omitempty"` + Amount *SplitAmount `json:"amount,omitempty"` // Your description for the split item. Description *string `json:"description,omitempty"` // Your unique reference for the split item. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/marketplaces-and-platforms)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. @@ -201,7 +200,7 @@ func (o *Split) SetType(v string) { } func (o Split) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -262,12 +261,14 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_split_amount.go b/src/payments/model_split_amount.go index ae2fd262f..3d2b0d794 100644 --- a/src/payments/model_split_amount.go +++ b/src/payments/model_split_amount.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SplitAmount type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *SplitAmount) SetValue(v int64) { } func (o SplitAmount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableSplitAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_sub_merchant.go b/src/payments/model_sub_merchant.go index a8bceee0e..2bc8a6a93 100644 --- a/src/payments/model_sub_merchant.go +++ b/src/payments/model_sub_merchant.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubMerchant type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *SubMerchant) SetTaxId(v string) { } func (o SubMerchant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableSubMerchant) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_technical_cancel_request.go b/src/payments/model_technical_cancel_request.go index 1e03b43fe..187ce2c1f 100644 --- a/src/payments/model_technical_cancel_request.go +++ b/src/payments/model_technical_cancel_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TechnicalCancelRequest type satisfies the MappedNullable interface at compile time @@ -22,12 +21,12 @@ type TechnicalCancelRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount *Amount `json:"modificationAmount,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount *Amount `json:"modificationAmount,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. - OriginalMerchantReference string `json:"originalMerchantReference"` - PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` + OriginalMerchantReference string `json:"originalMerchantReference"` + PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` // An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). @@ -362,7 +361,7 @@ func (o *TechnicalCancelRequest) SetUniqueTerminalId(v string) { } func (o TechnicalCancelRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -435,3 +434,6 @@ func (v *NullableTechnicalCancelRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_d_secure_data.go b/src/payments/model_three_d_secure_data.go index 7437bff14..1063029a0 100644 --- a/src/payments/model_three_d_secure_data.go +++ b/src/payments/model_three_d_secure_data.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSecureData type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ThreeDSecureData) SetXid(v string) { } func (o ThreeDSecureData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -531,30 +530,32 @@ func (v *NullableThreeDSecureData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDSecureData) isValidAuthenticationResponse() bool { - var allowedEnumValues = []string{"Y", "N", "U", "A"} - for _, allowed := range allowedEnumValues { - if o.GetAuthenticationResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N", "U", "A" } + for _, allowed := range allowedEnumValues { + if o.GetAuthenticationResponse() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDSecureData) isValidDirectoryResponse() bool { - var allowedEnumValues = []string{"A", "C", "D", "I", "N", "R", "U", "Y"} - for _, allowed := range allowedEnumValues { - if o.GetDirectoryResponse() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "A", "C", "D", "I", "N", "R", "U", "Y" } + for _, allowed := range allowedEnumValues { + if o.GetDirectoryResponse() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds1_result.go b/src/payments/model_three_ds1_result.go index 7773de662..fc95706e1 100644 --- a/src/payments/model_three_ds1_result.go +++ b/src/payments/model_three_ds1_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS1Result type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ThreeDS1Result) SetXid(v string) { } func (o ThreeDS1Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableThreeDS1Result) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds2_request_data.go b/src/payments/model_three_ds2_request_data.go index fd1f6e02b..1ccca099e 100644 --- a/src/payments/model_three_ds2_request_data.go +++ b/src/payments/model_three_ds2_request_data.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2RequestData type satisfies the MappedNullable interface at compile time @@ -31,20 +30,20 @@ type ThreeDS2RequestData struct { // If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. // Deprecated AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` - // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` // Deprecated ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The environment of the shopper. Allowed values: * `app` * `browser` - DeviceChannel string `json:"deviceChannel"` + DeviceChannel string `json:"deviceChannel"` DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,omitempty"` - HomePhone *Phone `json:"homePhone,omitempty"` + HomePhone *Phone `json:"homePhone,omitempty"` // Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. Mcc *string `json:"mcc,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. MerchantName *string `json:"merchantName,omitempty"` // The `messageVersion` value indicating the 3D Secure 2 protocol version. MessageVersion *string `json:"messageVersion,omitempty"` - MobilePhone *Phone `json:"mobilePhone,omitempty"` + MobilePhone *Phone `json:"mobilePhone,omitempty"` // URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. NotificationURL *string `json:"notificationURL,omitempty"` // Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. @@ -60,7 +59,7 @@ type ThreeDS2RequestData struct { // The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. SdkAppID *string `json:"sdkAppID,omitempty"` // The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - SdkEncData *string `json:"sdkEncData,omitempty"` + SdkEncData *string `json:"sdkEncData,omitempty"` SdkEphemPubKey *SDKEphemPubKey `json:"sdkEphemPubKey,omitempty"` // The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. SdkMaxTimeout *int32 `json:"sdkMaxTimeout,omitempty"` @@ -73,14 +72,14 @@ type ThreeDS2RequestData struct { // Completion indicator for the device fingerprinting. ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` // Indicates the type of Authentication request. - ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` + ThreeDSRequestorAuthenticationInd *string `json:"threeDSRequestorAuthenticationInd,omitempty"` ThreeDSRequestorAuthenticationInfo *ThreeDSRequestorAuthenticationInfo `json:"threeDSRequestorAuthenticationInfo,omitempty"` // Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only ThreeDSRequestorChallengeInd *string `json:"threeDSRequestorChallengeInd,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. ThreeDSRequestorID *string `json:"threeDSRequestorID,omitempty"` // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` + ThreeDSRequestorName *string `json:"threeDSRequestorName,omitempty"` ThreeDSRequestorPriorAuthenticationInfo *ThreeDSRequestorPriorAuthenticationInfo `json:"threeDSRequestorPriorAuthenticationInfo,omitempty"` // URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. ThreeDSRequestorURL *string `json:"threeDSRequestorURL,omitempty"` @@ -90,7 +89,7 @@ type ThreeDS2RequestData struct { TransactionType *string `json:"transactionType,omitempty"` // The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. WhiteListStatus *string `json:"whiteListStatus,omitempty"` - WorkPhone *Phone `json:"workPhone,omitempty"` + WorkPhone *Phone `json:"workPhone,omitempty"` } // NewThreeDS2RequestData instantiates a new ThreeDS2RequestData object @@ -1366,7 +1365,7 @@ func (o *ThreeDS2RequestData) SetWorkPhone(v Phone) { } func (o ThreeDS2RequestData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -1529,57 +1528,59 @@ func (v *NullableThreeDS2RequestData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2RequestData) isValidAcctType() bool { - var allowedEnumValues = []string{"01", "02", "03"} - for _, allowed := range allowedEnumValues { - if o.GetAcctType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03" } + for _, allowed := range allowedEnumValues { + if o.GetAcctType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidAddrMatch() bool { - var allowedEnumValues = []string{"Y", "N"} - for _, allowed := range allowedEnumValues { - if o.GetAddrMatch() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Y", "N" } + for _, allowed := range allowedEnumValues { + if o.GetAddrMatch() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransType() bool { - var allowedEnumValues = []string{"01", "03", "10", "11", "28"} - for _, allowed := range allowedEnumValues { - if o.GetTransType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "03", "10", "11", "28" } + for _, allowed := range allowedEnumValues { + if o.GetTransType() == allowed { + return true + } + } + return false } func (o *ThreeDS2RequestData) isValidTransactionType() bool { - var allowedEnumValues = []string{"goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad"} - for _, allowed := range allowedEnumValues { - if o.GetTransactionType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "goodsOrServicePurchase", "checkAcceptance", "accountFunding", "quasiCashTransaction", "prepaidActivationAndLoad" } + for _, allowed := range allowedEnumValues { + if o.GetTransactionType() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds2_result.go b/src/payments/model_three_ds2_result.go index af9e41568..cb4c045fd 100644 --- a/src/payments/model_three_ds2_result.go +++ b/src/payments/model_three_ds2_result.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2Result type satisfies the MappedNullable interface at compile time @@ -29,7 +28,7 @@ type ThreeDS2Result struct { DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. Eci *string `json:"eci,omitempty"` - // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + // Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` ExemptionIndicator *string `json:"exemptionIndicator,omitempty"` // The `messageVersion` value as defined in the 3D Secure 2 specification. MessageVersion *string `json:"messageVersion,omitempty"` @@ -515,7 +514,7 @@ func (o *ThreeDS2Result) SetWhiteListStatus(v string) { } func (o ThreeDS2Result) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -605,30 +604,32 @@ func (v *NullableThreeDS2Result) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ThreeDS2Result) isValidChallengeCancel() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06", "07"} - for _, allowed := range allowedEnumValues { - if o.GetChallengeCancel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06", "07" } + for _, allowed := range allowedEnumValues { + if o.GetChallengeCancel() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} - for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis" } + for _, allowed := range allowedEnumValues { + if o.GetExemptionIndicator() == allowed { + return true + } + } + return false } func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSRequestorChallengeInd() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSRequestorChallengeInd() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds2_result_request.go b/src/payments/model_three_ds2_result_request.go index e52902fc4..cd8390d04 100644 --- a/src/payments/model_three_ds2_result_request.go +++ b/src/payments/model_three_ds2_result_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2ResultRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *ThreeDS2ResultRequest) SetPspReference(v string) { } func (o ThreeDS2ResultRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableThreeDS2ResultRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds2_result_response.go b/src/payments/model_three_ds2_result_response.go index ce57133a7..66f51d50e 100644 --- a/src/payments/model_three_ds2_result_response.go +++ b/src/payments/model_three_ds2_result_response.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDS2ResultResponse type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *ThreeDS2ResultResponse) SetThreeDS2Result(v ThreeDS2Result) { } func (o ThreeDS2ResultResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableThreeDS2ResultResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payments/model_three_ds_requestor_authentication_info.go b/src/payments/model_three_ds_requestor_authentication_info.go index d92a2e1dd..ba05fa3c7 100644 --- a/src/payments/model_three_ds_requestor_authentication_info.go +++ b/src/payments/model_three_ds_requestor_authentication_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSRequestorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ThreeDSRequestorAuthenticationInfo) SetThreeDSReqAuthTimestamp(v string } func (o ThreeDSRequestorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,12 +197,14 @@ func (v *NullableThreeDSRequestorAuthenticationInfo) UnmarshalJSON(src []byte) e return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorAuthenticationInfo) isValidThreeDSReqAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04", "05", "06" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_three_ds_requestor_prior_authentication_info.go b/src/payments/model_three_ds_requestor_prior_authentication_info.go index 7d4f38b78..d4df541d3 100644 --- a/src/payments/model_three_ds_requestor_prior_authentication_info.go +++ b/src/payments/model_three_ds_requestor_prior_authentication_info.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThreeDSRequestorPriorAuthenticationInfo type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ThreeDSRequestorPriorAuthenticationInfo) SetThreeDSReqPriorRef(v string } func (o ThreeDSRequestorPriorAuthenticationInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableThreeDSRequestorPriorAuthenticationInfo) UnmarshalJSON(src []by return json.Unmarshal(src, &v.value) } + func (o *ThreeDSRequestorPriorAuthenticationInfo) isValidThreeDSReqPriorAuthMethod() bool { - var allowedEnumValues = []string{"01", "02", "03", "04"} - for _, allowed := range allowedEnumValues { - if o.GetThreeDSReqPriorAuthMethod() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "01", "02", "03", "04" } + for _, allowed := range allowedEnumValues { + if o.GetThreeDSReqPriorAuthMethod() == allowed { + return true + } + } + return false } + diff --git a/src/payments/model_void_pending_refund_request.go b/src/payments/model_void_pending_refund_request.go index b3a8db278..296c0a434 100644 --- a/src/payments/model_void_pending_refund_request.go +++ b/src/payments/model_void_pending_refund_request.go @@ -10,8 +10,7 @@ package payments import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the VoidPendingRefundRequest type satisfies the MappedNullable interface at compile time @@ -22,13 +21,13 @@ type VoidPendingRefundRequest struct { // This field contains additional data, which may be required for a particular modification request. The additionalData object consists of entries, each of which includes the key and value. AdditionalData *map[string]string `json:"additionalData,omitempty"` // The merchant account that is used to process the payment. - MerchantAccount string `json:"merchantAccount"` - ModificationAmount *Amount `json:"modificationAmount,omitempty"` - MpiData *ThreeDSecureData `json:"mpiData,omitempty"` + MerchantAccount string `json:"merchantAccount"` + ModificationAmount *Amount `json:"modificationAmount,omitempty"` + MpiData *ThreeDSecureData `json:"mpiData,omitempty"` // The original merchant reference to cancel. OriginalMerchantReference *string `json:"originalMerchantReference,omitempty"` - // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification - OriginalReference *string `json:"originalReference,omitempty"` + // The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + OriginalReference *string `json:"originalReference,omitempty"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. Reference *string `json:"reference,omitempty"` @@ -403,7 +402,7 @@ func (o *VoidPendingRefundRequest) SetUniqueTerminalId(v string) { } func (o VoidPendingRefundRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -481,3 +480,6 @@ func (v *NullableVoidPendingRefundRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/api_initialization.go b/src/payout/api_initialization.go index 51ae46e32..5fa9aed4f 100644 --- a/src/payout/api_initialization.go +++ b/src/payout/api_initialization.go @@ -10,10 +10,10 @@ package payout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // InitializationApi service @@ -29,13 +29,15 @@ func (r InitializationApiStoreDetailInput) StoreDetailRequest(storeDetailRequest return r } + /* Prepare a request for StoreDetail @return InitializationApiStoreDetailInput */ func (a *InitializationApi) StoreDetailInput() InitializationApiStoreDetailInput { - return InitializationApiStoreDetailInput{} + return InitializationApiStoreDetailInput{ + } } /* @@ -48,24 +50,26 @@ Stores payment details under the `PAYOUT` recurring contract. These payment deta @return StoreDetailResponse, *http.Response, error */ func (a *InitializationApi) StoreDetail(ctx context.Context, r InitializationApiStoreDetailInput) (StoreDetailResponse, *http.Response, error) { - res := &StoreDetailResponse{} + res := &StoreDetailResponse{} path := "/storeDetail" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storeDetailRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storeDetailRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by InitializationApi.StoreDetailAndSubmitThirdParty type InitializationApiStoreDetailAndSubmitThirdPartyInput struct { storeDetailAndSubmitRequest *StoreDetailAndSubmitRequest @@ -76,13 +80,15 @@ func (r InitializationApiStoreDetailAndSubmitThirdPartyInput) StoreDetailAndSubm return r } + /* Prepare a request for StoreDetailAndSubmitThirdParty @return InitializationApiStoreDetailAndSubmitThirdPartyInput */ func (a *InitializationApi) StoreDetailAndSubmitThirdPartyInput() InitializationApiStoreDetailAndSubmitThirdPartyInput { - return InitializationApiStoreDetailAndSubmitThirdPartyInput{} + return InitializationApiStoreDetailAndSubmitThirdPartyInput{ + } } /* @@ -97,24 +103,26 @@ The submitted payout must be confirmed or declined either by a reviewer or via ` @return StoreDetailAndSubmitResponse, *http.Response, error */ func (a *InitializationApi) StoreDetailAndSubmitThirdParty(ctx context.Context, r InitializationApiStoreDetailAndSubmitThirdPartyInput) (StoreDetailAndSubmitResponse, *http.Response, error) { - res := &StoreDetailAndSubmitResponse{} + res := &StoreDetailAndSubmitResponse{} path := "/storeDetailAndSubmitThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storeDetailAndSubmitRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storeDetailAndSubmitRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by InitializationApi.SubmitThirdParty type InitializationApiSubmitThirdPartyInput struct { submitRequest *SubmitRequest @@ -125,13 +133,15 @@ func (r InitializationApiSubmitThirdPartyInput) SubmitRequest(submitRequest Subm return r } + /* Prepare a request for SubmitThirdParty @return InitializationApiSubmitThirdPartyInput */ func (a *InitializationApi) SubmitThirdPartyInput() InitializationApiSubmitThirdPartyInput { - return InitializationApiSubmitThirdPartyInput{} + return InitializationApiSubmitThirdPartyInput{ + } } /* @@ -146,20 +156,22 @@ The submitted payout must be confirmed or declined either by a reviewer or via ` @return SubmitResponse, *http.Response, error */ func (a *InitializationApi) SubmitThirdParty(ctx context.Context, r InitializationApiSubmitThirdPartyInput) (SubmitResponse, *http.Response, error) { - res := &SubmitResponse{} + res := &SubmitResponse{} path := "/submitThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.submitRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.submitRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/payout/api_instant_payouts.go b/src/payout/api_instant_payouts.go index 5994891d1..c935640f5 100644 --- a/src/payout/api_instant_payouts.go +++ b/src/payout/api_instant_payouts.go @@ -10,10 +10,10 @@ package payout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // InstantPayoutsApi service @@ -29,13 +29,15 @@ func (r InstantPayoutsApiPayoutInput) PayoutRequest(payoutRequest PayoutRequest) return r } + /* Prepare a request for Payout @return InstantPayoutsApiPayoutInput */ func (a *InstantPayoutsApi) PayoutInput() InstantPayoutsApiPayoutInput { - return InstantPayoutsApiPayoutInput{} + return InstantPayoutsApiPayoutInput{ + } } /* @@ -48,20 +50,22 @@ With this call, you can pay out to your customers, and funds will be made availa @return PayoutResponse, *http.Response, error */ func (a *InstantPayoutsApi) Payout(ctx context.Context, r InstantPayoutsApiPayoutInput) (PayoutResponse, *http.Response, error) { - res := &PayoutResponse{} + res := &PayoutResponse{} path := "/payout" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.payoutRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.payoutRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/payout/api_reviewing.go b/src/payout/api_reviewing.go index 5997e3017..a6c2151d0 100644 --- a/src/payout/api_reviewing.go +++ b/src/payout/api_reviewing.go @@ -10,10 +10,10 @@ package payout import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // ReviewingApi service @@ -29,13 +29,15 @@ func (r ReviewingApiConfirmThirdPartyInput) ModifyRequest(modifyRequest ModifyRe return r } + /* Prepare a request for ConfirmThirdParty @return ReviewingApiConfirmThirdPartyInput */ func (a *ReviewingApi) ConfirmThirdPartyInput() ReviewingApiConfirmThirdPartyInput { - return ReviewingApiConfirmThirdPartyInput{} + return ReviewingApiConfirmThirdPartyInput{ + } } /* @@ -50,24 +52,26 @@ To cancel a payout, use the `/declineThirdParty` endpoint. @return ModifyResponse, *http.Response, error */ func (a *ReviewingApi) ConfirmThirdParty(ctx context.Context, r ReviewingApiConfirmThirdPartyInput) (ModifyResponse, *http.Response, error) { - res := &ModifyResponse{} + res := &ModifyResponse{} path := "/confirmThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.modifyRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.modifyRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by ReviewingApi.DeclineThirdParty type ReviewingApiDeclineThirdPartyInput struct { modifyRequest *ModifyRequest @@ -78,13 +82,15 @@ func (r ReviewingApiDeclineThirdPartyInput) ModifyRequest(modifyRequest ModifyRe return r } + /* Prepare a request for DeclineThirdParty @return ReviewingApiDeclineThirdPartyInput */ func (a *ReviewingApi) DeclineThirdPartyInput() ReviewingApiDeclineThirdPartyInput { - return ReviewingApiDeclineThirdPartyInput{} + return ReviewingApiDeclineThirdPartyInput{ + } } /* @@ -99,20 +105,22 @@ To confirm and send a payout, use the `/confirmThirdParty` endpoint. @return ModifyResponse, *http.Response, error */ func (a *ReviewingApi) DeclineThirdParty(ctx context.Context, r ReviewingApiDeclineThirdPartyInput) (ModifyResponse, *http.Response, error) { - res := &ModifyResponse{} + res := &ModifyResponse{} path := "/declineThirdParty" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.modifyRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.modifyRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/payout/client.go b/src/payout/client.go index 8e5c147a2..8ec237c01 100644 --- a/src/payout/client.go +++ b/src/payout/client.go @@ -31,7 +31,7 @@ func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} c.common.Client = client c.common.BasePath = func() string { - return client.Cfg.Endpoint + return client.Cfg.PayoutEndpoint } // API Services diff --git a/src/payout/model_address.go b/src/payout/model_address.go index 9629f3d4a..844a0f3dc 100644 --- a/src/payout/model_address.go +++ b/src/payout/model_address.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_amount.go b/src/payout/model_amount.go index dbbead9d3..9dc1f22ca 100644 --- a/src/payout/model_amount.go +++ b/src/payout/model_amount.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_bank_account.go b/src/payout/model_bank_account.go index 0a801a298..627ece6d2 100644 --- a/src/payout/model_bank_account.go +++ b/src/payout/model_bank_account.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_card.go b/src/payout/model_card.go index b4059e4b2..cbef6889b 100644 --- a/src/payout/model_card.go +++ b/src/payout/model_card.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_check_result.go b/src/payout/model_fraud_check_result.go index 3ea042cfa..d774733c2 100644 --- a/src/payout/model_fraud_check_result.go +++ b/src/payout/model_fraud_check_result.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudCheckResult type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *FraudCheckResult) SetName(v string) { } func (o FraudCheckResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableFraudCheckResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_check_result_wrapper.go b/src/payout/model_fraud_check_result_wrapper.go index 850404f42..beaebcf0d 100644 --- a/src/payout/model_fraud_check_result_wrapper.go +++ b/src/payout/model_fraud_check_result_wrapper.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudCheckResultWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *FraudCheckResultWrapper) SetFraudCheckResult(v FraudCheckResult) { } func (o FraudCheckResultWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableFraudCheckResultWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fraud_result.go b/src/payout/model_fraud_result.go index df7232432..8459b278b 100644 --- a/src/payout/model_fraud_result.go +++ b/src/payout/model_fraud_result.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FraudResult type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *FraudResult) SetResults(v []FraudCheckResultWrapper) { } func (o FraudResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableFraudResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_fund_source.go b/src/payout/model_fund_source.go index c3d0f2d6c..264ed3d4d 100644 --- a/src/payout/model_fund_source.go +++ b/src/payout/model_fund_source.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FundSource type satisfies the MappedNullable interface at compile time @@ -21,11 +20,11 @@ var _ common.MappedNullable = &FundSource{} type FundSource struct { // A map of name-value pairs for passing additional or industry-specific data. AdditionalData *map[string]string `json:"additionalData,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Email address of the person. ShopperEmail *string `json:"shopperEmail,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Phone number of the person TelephoneNumber *string `json:"telephoneNumber,omitempty"` } @@ -240,7 +239,7 @@ func (o *FundSource) SetTelephoneNumber(v string) { } func (o FundSource) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -305,3 +304,6 @@ func (v *NullableFundSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_modify_request.go b/src/payout/model_modify_request.go index fb8b29f0e..e4c4db6e6 100644 --- a/src/payout/model_modify_request.go +++ b/src/payout/model_modify_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ModifyRequest type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModifyRequest) SetOriginalReference(v string) { } func (o ModifyRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableModifyRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_modify_response.go b/src/payout/model_modify_response.go index 5cac51b6a..043e95fa3 100644 --- a/src/payout/model_modify_response.go +++ b/src/payout/model_modify_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ModifyResponse type satisfies the MappedNullable interface at compile time @@ -127,7 +126,7 @@ func (o *ModifyResponse) SetResponse(v string) { } func (o ModifyResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -179,3 +178,6 @@ func (v *NullableModifyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_name.go b/src/payout/model_name.go index abb32fdb6..4c75d1c71 100644 --- a/src/payout/model_name.go +++ b/src/payout/model_name.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_payout_request.go b/src/payout/model_payout_request.go index 16aae42cb..b22b1cf87 100644 --- a/src/payout/model_payout_request.go +++ b/src/payout/model_payout_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayoutRequest type satisfies the MappedNullable interface at compile time @@ -19,15 +18,15 @@ var _ common.MappedNullable = &PayoutRequest{} // PayoutRequest struct for PayoutRequest type PayoutRequest struct { - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // An integer value that is added to the normal fraud score. The value can be either positive or negative. - FraudOffset *int32 `json:"fraudOffset,omitempty"` - FundSource *FundSource `json:"fundSource,omitempty"` + FraudOffset *int32 `json:"fraudOffset,omitempty"` + FundSource *FundSource `json:"fundSource,omitempty"` // The merchant account identifier, with which you want to process the transaction. - MerchantAccount string `json:"merchantAccount"` - Recurring *Recurring `json:"recurring,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Recurring *Recurring `json:"recurring,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. @@ -36,7 +35,7 @@ type PayoutRequest struct { ShopperEmail *string `json:"shopperEmail,omitempty"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. ShopperReference *string `json:"shopperReference,omitempty"` // The shopper's telephone number. @@ -488,7 +487,7 @@ func (o *PayoutRequest) SetTelephoneNumber(v string) { } func (o PayoutRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -572,12 +571,14 @@ func (v *NullablePayoutRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_payout_response.go b/src/payout/model_payout_response.go index 99a350ee0..3c80dd734 100644 --- a/src/payout/model_payout_response.go +++ b/src/payout/model_payout_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PayoutResponse type satisfies the MappedNullable interface at compile time @@ -22,11 +21,11 @@ type PayoutResponse struct { // Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. AdditionalData *map[string]string `json:"additionalData,omitempty"` // Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` DccAmount *Amount `json:"dccAmount,omitempty"` // Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - DccSignature *string `json:"dccSignature,omitempty"` - FraudResult *FraudResult `json:"fraudResult,omitempty"` + DccSignature *string `json:"dccSignature,omitempty"` + FraudResult *FraudResult `json:"fraudResult,omitempty"` // The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. IssuerUrl *string `json:"issuerUrl,omitempty"` // The payment session. @@ -411,7 +410,7 @@ func (o *PayoutResponse) SetResultCode(v string) { } func (o PayoutResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -492,12 +491,14 @@ func (v *NullablePayoutResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PayoutResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_recurring.go b/src/payout/model_recurring.go index b9b76c070..bed15771d 100644 --- a/src/payout/model_recurring.go +++ b/src/payout/model_recurring.go @@ -10,9 +10,8 @@ package payout import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_response_additional_data3_d_secure.go b/src/payout/model_response_additional_data3_d_secure.go index a827b6219..e265cbfea 100644 --- a/src/payout/model_response_additional_data3_d_secure.go +++ b/src/payout/model_response_additional_data3_d_secure.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalData3DSecure type satisfies the MappedNullable interface at compile time @@ -19,13 +18,13 @@ var _ common.MappedNullable = &ResponseAdditionalData3DSecure{} // ResponseAdditionalData3DSecure struct for ResponseAdditionalData3DSecure type ResponseAdditionalData3DSecure struct { - // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + // Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. CardHolderInfo *string `json:"cardHolderInfo,omitempty"` // The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. Cavv *string `json:"cavv,omitempty"` // The CAVV algorithm used. CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` - // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + // Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** ScaExemptionRequested *string `json:"scaExemptionRequested,omitempty"` // Indicates whether a card is enrolled for 3D Secure 2. Threeds2CardEnrolled *bool `json:"threeds2.cardEnrolled,omitempty"` @@ -209,7 +208,7 @@ func (o *ResponseAdditionalData3DSecure) SetThreeds2CardEnrolled(v bool) { } func (o ResponseAdditionalData3DSecure) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableResponseAdditionalData3DSecure) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_billing_address.go b/src/payout/model_response_additional_data_billing_address.go index de740e253..b4f3fd92e 100644 --- a/src/payout/model_response_additional_data_billing_address.go +++ b/src/payout/model_response_additional_data_billing_address.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataBillingAddress type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ResponseAdditionalDataBillingAddress) SetBillingAddressStreet(v string) } func (o ResponseAdditionalDataBillingAddress) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableResponseAdditionalDataBillingAddress) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_card.go b/src/payout/model_response_additional_data_card.go index 7702ae1c1..2640e89ba 100644 --- a/src/payout/model_response_additional_data_card.go +++ b/src/payout/model_response_additional_data_card.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCard type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *ResponseAdditionalDataCard) SetIssuerBin(v string) { } func (o ResponseAdditionalDataCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_common.go b/src/payout/model_response_additional_data_common.go index 91b051b4d..6a81bfab4 100644 --- a/src/payout/model_response_additional_data_common.go +++ b/src/payout/model_response_additional_data_common.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataCommon type satisfies the MappedNullable interface at compile time @@ -2045,7 +2044,7 @@ func (o *ResponseAdditionalDataCommon) SetXid(v string) { } func (o ResponseAdditionalDataCommon) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -2270,21 +2269,23 @@ func (v *NullableResponseAdditionalDataCommon) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ResponseAdditionalDataCommon) isValidFraudResultType() bool { - var allowedEnumValues = []string{"GREEN", "FRAUD"} - for _, allowed := range allowedEnumValues { - if o.GetFraudResultType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "GREEN", "FRAUD" } + for _, allowed := range allowedEnumValues { + if o.GetFraudResultType() == allowed { + return true + } + } + return false } func (o *ResponseAdditionalDataCommon) isValidRecurringProcessingModel() bool { - var allowedEnumValues = []string{"CardOnFile", "Subscription", "UnscheduledCardOnFile"} - for _, allowed := range allowedEnumValues { - if o.GetRecurringProcessingModel() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "CardOnFile", "Subscription", "UnscheduledCardOnFile" } + for _, allowed := range allowedEnumValues { + if o.GetRecurringProcessingModel() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_response_additional_data_domestic_error.go b/src/payout/model_response_additional_data_domestic_error.go index 60bd60bd8..c11722167 100644 --- a/src/payout/model_response_additional_data_domestic_error.go +++ b/src/payout/model_response_additional_data_domestic_error.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataDomesticError type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *ResponseAdditionalDataDomesticError) SetDomesticShopperAdvice(v string) } func (o ResponseAdditionalDataDomesticError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableResponseAdditionalDataDomesticError) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_installments.go b/src/payout/model_response_additional_data_installments.go index 0729fe60a..bcd2a699c 100644 --- a/src/payout/model_response_additional_data_installments.go +++ b/src/payout/model_response_additional_data_installments.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataInstallments type satisfies the MappedNullable interface at compile time @@ -447,7 +446,7 @@ func (o *ResponseAdditionalDataInstallments) SetInstallmentsValue(v string) { } func (o ResponseAdditionalDataInstallments) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -530,3 +529,6 @@ func (v *NullableResponseAdditionalDataInstallments) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_network_tokens.go b/src/payout/model_response_additional_data_network_tokens.go index 79dcd2b00..235ce54eb 100644 --- a/src/payout/model_response_additional_data_network_tokens.go +++ b/src/payout/model_response_additional_data_network_tokens.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataNetworkTokens type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataNetworkTokens) SetNetworkTokenTokenSummary(v stri } func (o ResponseAdditionalDataNetworkTokens) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataNetworkTokens) UnmarshalJSON(src []byte) v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_opi.go b/src/payout/model_response_additional_data_opi.go index ebef7775d..2376d5777 100644 --- a/src/payout/model_response_additional_data_opi.go +++ b/src/payout/model_response_additional_data_opi.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataOpi type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *ResponseAdditionalDataOpi) SetOpiTransToken(v string) { } func (o ResponseAdditionalDataOpi) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableResponseAdditionalDataOpi) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_response_additional_data_sepa.go b/src/payout/model_response_additional_data_sepa.go index 223f947e5..83f82b77a 100644 --- a/src/payout/model_response_additional_data_sepa.go +++ b/src/payout/model_response_additional_data_sepa.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResponseAdditionalDataSepa type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResponseAdditionalDataSepa) SetSepadirectdebitSequenceType(v string) { } func (o ResponseAdditionalDataSepa) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResponseAdditionalDataSepa) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_service_error.go b/src/payout/model_service_error.go index e08547e87..6dc21b4f3 100644 --- a/src/payout/model_service_error.go +++ b/src/payout/model_service_error.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_store_detail_and_submit_request.go b/src/payout/model_store_detail_and_submit_request.go index 3ccc70ed5..9dc484cc3 100644 --- a/src/payout/model_store_detail_and_submit_request.go +++ b/src/payout/model_store_detail_and_submit_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreDetailAndSubmitRequest type satisfies the MappedNullable interface at compile time @@ -21,10 +20,10 @@ var _ common.MappedNullable = &StoreDetailAndSubmitRequest{} type StoreDetailAndSubmitRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Amount Amount `json:"amount"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. DateOfBirth string `json:"dateOfBirth"` // The type of the entity the payout is processed for. @@ -34,15 +33,15 @@ type StoreDetailAndSubmitRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). - Nationality string `json:"nationality"` - Recurring Recurring `json:"recurring"` + Nationality string `json:"nationality"` + Recurring Recurring `json:"recurring"` // The merchant reference for this payment. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. Reference string `json:"reference"` // The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. SelectedBrand *string `json:"selectedBrand,omitempty"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payment transaction. ShopperReference string `json:"shopperReference"` // The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). @@ -616,7 +615,7 @@ func (o *StoreDetailAndSubmitRequest) SetTelephoneNumber(v string) { } func (o StoreDetailAndSubmitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -703,12 +702,14 @@ func (v *NullableStoreDetailAndSubmitRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoreDetailAndSubmitRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_store_detail_and_submit_response.go b/src/payout/model_store_detail_and_submit_response.go index 821e6880d..b1ce97d88 100644 --- a/src/payout/model_store_detail_and_submit_response.go +++ b/src/payout/model_store_detail_and_submit_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreDetailAndSubmitResponse type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *StoreDetailAndSubmitResponse) SetResultCode(v string) { } func (o StoreDetailAndSubmitResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableStoreDetailAndSubmitResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_store_detail_request.go b/src/payout/model_store_detail_request.go index 13642e1c7..e507224ab 100644 --- a/src/payout/model_store_detail_request.go +++ b/src/payout/model_store_detail_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreDetailRequest type satisfies the MappedNullable interface at compile time @@ -21,9 +20,9 @@ var _ common.MappedNullable = &StoreDetailRequest{} type StoreDetailRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. DateOfBirth string `json:"dateOfBirth"` // The type of the entity the payout is processed for. @@ -33,13 +32,13 @@ type StoreDetailRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). - Nationality string `json:"nationality"` - Recurring Recurring `json:"recurring"` + Nationality string `json:"nationality"` + Recurring Recurring `json:"recurring"` // The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. SelectedBrand *string `json:"selectedBrand,omitempty"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payment transaction. ShopperReference string `json:"shopperReference"` // The shopper's social security number. @@ -529,7 +528,7 @@ func (o *StoreDetailRequest) SetTelephoneNumber(v string) { } func (o StoreDetailRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -611,12 +610,14 @@ func (v *NullableStoreDetailRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoreDetailRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_store_detail_response.go b/src/payout/model_store_detail_response.go index 9f9fff63a..1e7ca1a81 100644 --- a/src/payout/model_store_detail_response.go +++ b/src/payout/model_store_detail_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoreDetailResponse type satisfies the MappedNullable interface at compile time @@ -154,7 +153,7 @@ func (o *StoreDetailResponse) SetResultCode(v string) { } func (o StoreDetailResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -207,3 +206,6 @@ func (v *NullableStoreDetailResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/payout/model_submit_request.go b/src/payout/model_submit_request.go index eea3ff37d..90005c8d0 100644 --- a/src/payout/model_submit_request.go +++ b/src/payout/model_submit_request.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubmitRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &SubmitRequest{} type SubmitRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Amount Amount `json:"amount"` + Amount Amount `json:"amount"` // The date of birth. Format: ISO-8601; example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. > This field is required to update the existing `dateOfBirth` that is associated with this recurring contract. DateOfBirth *string `json:"dateOfBirth,omitempty"` // The type of the entity the payout is processed for. Allowed values: * NaturalPerson * Company > This field is required to update the existing `entityType` that is associated with this recurring contract. @@ -31,15 +30,15 @@ type SubmitRequest struct { // The merchant account identifier you want to process the transaction request with. MerchantAccount string `json:"merchantAccount"` // The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). > This field is required to update the existing nationality that is associated with this recurring contract. - Nationality *string `json:"nationality,omitempty"` - Recurring Recurring `json:"recurring"` + Nationality *string `json:"nationality,omitempty"` + Recurring Recurring `json:"recurring"` // The merchant reference for this payout. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. Reference string `json:"reference"` // This is the `recurringDetailReference` you want to use for this payout. You can use the value LATEST to select the most recently used recurring detail. SelectedRecurringDetailReference string `json:"selectedRecurringDetailReference"` // The shopper's email address. ShopperEmail string `json:"shopperEmail"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // The shopper's reference for the payout transaction. ShopperReference string `json:"shopperReference"` // The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). @@ -497,7 +496,7 @@ func (o *SubmitRequest) SetSocialSecurityNumber(v string) { } func (o SubmitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -576,12 +575,14 @@ func (v *NullableSubmitRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SubmitRequest) isValidEntityType() bool { - var allowedEnumValues = []string{"NaturalPerson", "Company"} - for _, allowed := range allowedEnumValues { - if o.GetEntityType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "NaturalPerson", "Company" } + for _, allowed := range allowedEnumValues { + if o.GetEntityType() == allowed { + return true + } + } + return false } + diff --git a/src/payout/model_submit_response.go b/src/payout/model_submit_response.go index c57bf3217..05ba88dc9 100644 --- a/src/payout/model_submit_response.go +++ b/src/payout/model_submit_response.go @@ -10,8 +10,7 @@ package payout import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SubmitResponse type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *SubmitResponse) SetResultCode(v string) { } func (o SubmitResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableSubmitResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/api_general.go b/src/posterminalmanagement/api_general.go index a33e6ae51..855e57c68 100644 --- a/src/posterminalmanagement/api_general.go +++ b/src/posterminalmanagement/api_general.go @@ -10,10 +10,10 @@ package posterminalmanagement import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiAssignTerminalsInput) AssignTerminalsRequest(assignTerminalsRe return r } + /* Prepare a request for AssignTerminals @return GeneralApiAssignTerminalsInput */ func (a *GeneralApi) AssignTerminalsInput() GeneralApiAssignTerminalsInput { - return GeneralApiAssignTerminalsInput{} + return GeneralApiAssignTerminalsInput{ + } } /* @@ -48,24 +50,26 @@ Assigns one or more payment terminals to a merchant account or a store. You can @return AssignTerminalsResponse, *http.Response, error */ func (a *GeneralApi) AssignTerminals(ctx context.Context, r GeneralApiAssignTerminalsInput) (AssignTerminalsResponse, *http.Response, error) { - res := &AssignTerminalsResponse{} + res := &AssignTerminalsResponse{} path := "/assignTerminals" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.assignTerminalsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.assignTerminalsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.FindTerminal type GeneralApiFindTerminalInput struct { findTerminalRequest *FindTerminalRequest @@ -76,13 +80,15 @@ func (r GeneralApiFindTerminalInput) FindTerminalRequest(findTerminalRequest Fin return r } + /* Prepare a request for FindTerminal @return GeneralApiFindTerminalInput */ func (a *GeneralApi) FindTerminalInput() GeneralApiFindTerminalInput { - return GeneralApiFindTerminalInput{} + return GeneralApiFindTerminalInput{ + } } /* @@ -95,24 +101,26 @@ Returns the company account, merchant account, or store that a payment terminal @return FindTerminalResponse, *http.Response, error */ func (a *GeneralApi) FindTerminal(ctx context.Context, r GeneralApiFindTerminalInput) (FindTerminalResponse, *http.Response, error) { - res := &FindTerminalResponse{} + res := &FindTerminalResponse{} path := "/findTerminal" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.findTerminalRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.findTerminalRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.GetStoresUnderAccount type GeneralApiGetStoresUnderAccountInput struct { getStoresUnderAccountRequest *GetStoresUnderAccountRequest @@ -123,13 +131,15 @@ func (r GeneralApiGetStoresUnderAccountInput) GetStoresUnderAccountRequest(getSt return r } + /* Prepare a request for GetStoresUnderAccount @return GeneralApiGetStoresUnderAccountInput */ func (a *GeneralApi) GetStoresUnderAccountInput() GeneralApiGetStoresUnderAccountInput { - return GeneralApiGetStoresUnderAccountInput{} + return GeneralApiGetStoresUnderAccountInput{ + } } /* @@ -142,24 +152,26 @@ Returns a list of stores associated with a company account or a merchant account @return GetStoresUnderAccountResponse, *http.Response, error */ func (a *GeneralApi) GetStoresUnderAccount(ctx context.Context, r GeneralApiGetStoresUnderAccountInput) (GetStoresUnderAccountResponse, *http.Response, error) { - res := &GetStoresUnderAccountResponse{} + res := &GetStoresUnderAccountResponse{} path := "/getStoresUnderAccount" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.getStoresUnderAccountRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.getStoresUnderAccountRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.GetTerminalDetails type GeneralApiGetTerminalDetailsInput struct { getTerminalDetailsRequest *GetTerminalDetailsRequest @@ -170,13 +182,15 @@ func (r GeneralApiGetTerminalDetailsInput) GetTerminalDetailsRequest(getTerminal return r } + /* Prepare a request for GetTerminalDetails @return GeneralApiGetTerminalDetailsInput */ func (a *GeneralApi) GetTerminalDetailsInput() GeneralApiGetTerminalDetailsInput { - return GeneralApiGetTerminalDetailsInput{} + return GeneralApiGetTerminalDetailsInput{ + } } /* @@ -189,24 +203,26 @@ Returns the details of a payment terminal, including where the terminal is assig @return GetTerminalDetailsResponse, *http.Response, error */ func (a *GeneralApi) GetTerminalDetails(ctx context.Context, r GeneralApiGetTerminalDetailsInput) (GetTerminalDetailsResponse, *http.Response, error) { - res := &GetTerminalDetailsResponse{} + res := &GetTerminalDetailsResponse{} path := "/getTerminalDetails" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.getTerminalDetailsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.getTerminalDetailsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.GetTerminalsUnderAccount type GeneralApiGetTerminalsUnderAccountInput struct { getTerminalsUnderAccountRequest *GetTerminalsUnderAccountRequest @@ -217,13 +233,15 @@ func (r GeneralApiGetTerminalsUnderAccountInput) GetTerminalsUnderAccountRequest return r } + /* Prepare a request for GetTerminalsUnderAccount @return GeneralApiGetTerminalsUnderAccountInput */ func (a *GeneralApi) GetTerminalsUnderAccountInput() GeneralApiGetTerminalsUnderAccountInput { - return GeneralApiGetTerminalsUnderAccountInput{} + return GeneralApiGetTerminalsUnderAccountInput{ + } } /* @@ -236,20 +254,22 @@ Returns a list of payment terminals associated with a company account, merchant @return GetTerminalsUnderAccountResponse, *http.Response, error */ func (a *GeneralApi) GetTerminalsUnderAccount(ctx context.Context, r GeneralApiGetTerminalsUnderAccountInput) (GetTerminalsUnderAccountResponse, *http.Response, error) { - res := &GetTerminalsUnderAccountResponse{} + res := &GetTerminalsUnderAccountResponse{} path := "/getTerminalsUnderAccount" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.getTerminalsUnderAccountRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.getTerminalsUnderAccountRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/posterminalmanagement/model_address.go b/src/posterminalmanagement/model_address.go index d66f6c5db..0dff88d52 100644 --- a/src/posterminalmanagement/model_address.go +++ b/src/posterminalmanagement/model_address.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -19,12 +18,12 @@ var _ common.MappedNullable = &Address{} // Address struct for Address type Address struct { - City *string `json:"city,omitempty"` - CountryCode *string `json:"countryCode,omitempty"` - PostalCode *string `json:"postalCode,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + PostalCode *string `json:"postalCode,omitempty"` StateOrProvince *string `json:"stateOrProvince,omitempty"` - StreetAddress *string `json:"streetAddress,omitempty"` - StreetAddress2 *string `json:"streetAddress2,omitempty"` + StreetAddress *string `json:"streetAddress,omitempty"` + StreetAddress2 *string `json:"streetAddress2,omitempty"` } // NewAddress instantiates a new Address object @@ -237,7 +236,7 @@ func (o *Address) SetStreetAddress2(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -302,3 +301,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_assign_terminals_request.go b/src/posterminalmanagement/model_assign_terminals_request.go index 61807ee18..2544ae800 100644 --- a/src/posterminalmanagement/model_assign_terminals_request.go +++ b/src/posterminalmanagement/model_assign_terminals_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AssignTerminalsRequest type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *AssignTerminalsRequest) SetTerminals(v []string) { } func (o AssignTerminalsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableAssignTerminalsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_assign_terminals_response.go b/src/posterminalmanagement/model_assign_terminals_response.go index d828d984b..5542efbcd 100644 --- a/src/posterminalmanagement/model_assign_terminals_response.go +++ b/src/posterminalmanagement/model_assign_terminals_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AssignTerminalsResponse type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &AssignTerminalsResponse{} // AssignTerminalsResponse struct for AssignTerminalsResponse type AssignTerminalsResponse struct { - // Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. + // Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. Results map[string]string `json:"results"` } @@ -66,7 +65,7 @@ func (o *AssignTerminalsResponse) SetResults(v map[string]string) { } func (o AssignTerminalsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableAssignTerminalsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_find_terminal_request.go b/src/posterminalmanagement/model_find_terminal_request.go index 97d197cc8..8d1597612 100644 --- a/src/posterminalmanagement/model_find_terminal_request.go +++ b/src/posterminalmanagement/model_find_terminal_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FindTerminalRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *FindTerminalRequest) SetTerminal(v string) { } func (o FindTerminalRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableFindTerminalRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_find_terminal_response.go b/src/posterminalmanagement/model_find_terminal_response.go index 56c21257a..02dafb86a 100644 --- a/src/posterminalmanagement/model_find_terminal_response.go +++ b/src/posterminalmanagement/model_find_terminal_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the FindTerminalResponse type satisfies the MappedNullable interface at compile time @@ -195,7 +194,7 @@ func (o *FindTerminalResponse) SetTerminal(v string) { } func (o FindTerminalResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -253,3 +252,6 @@ func (v *NullableFindTerminalResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_stores_under_account_request.go b/src/posterminalmanagement/model_get_stores_under_account_request.go index f434ba73f..5e780bc63 100644 --- a/src/posterminalmanagement/model_get_stores_under_account_request.go +++ b/src/posterminalmanagement/model_get_stores_under_account_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetStoresUnderAccountRequest type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *GetStoresUnderAccountRequest) SetMerchantAccount(v string) { } func (o GetStoresUnderAccountRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableGetStoresUnderAccountRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_stores_under_account_response.go b/src/posterminalmanagement/model_get_stores_under_account_response.go index 635ab48ca..84e764af4 100644 --- a/src/posterminalmanagement/model_get_stores_under_account_response.go +++ b/src/posterminalmanagement/model_get_stores_under_account_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetStoresUnderAccountResponse type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *GetStoresUnderAccountResponse) SetStores(v []Store) { } func (o GetStoresUnderAccountResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableGetStoresUnderAccountResponse) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminal_details_request.go b/src/posterminalmanagement/model_get_terminal_details_request.go index 89dc0fc7e..e5963d705 100644 --- a/src/posterminalmanagement/model_get_terminal_details_request.go +++ b/src/posterminalmanagement/model_get_terminal_details_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTerminalDetailsRequest type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *GetTerminalDetailsRequest) SetTerminal(v string) { } func (o GetTerminalDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableGetTerminalDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminal_details_response.go b/src/posterminalmanagement/model_get_terminal_details_response.go index 867ebefa6..0cffd6ef7 100644 --- a/src/posterminalmanagement/model_get_terminal_details_response.go +++ b/src/posterminalmanagement/model_get_terminal_details_response.go @@ -10,9 +10,8 @@ package posterminalmanagement import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTerminalDetailsResponse type satisfies the MappedNullable interface at compile time @@ -59,8 +58,8 @@ type GetTerminalDetailsResponse struct { // On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. SimStatus *string `json:"simStatus,omitempty"` // The store code of the store that the terminal is assigned to. - Store *string `json:"store,omitempty"` - StoreDetails *Store `json:"storeDetails,omitempty"` + Store *string `json:"store,omitempty"` + StoreDetails *Store `json:"storeDetails,omitempty"` // The unique terminal ID. Terminal string `json:"terminal"` // The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. @@ -875,7 +874,7 @@ func (o *GetTerminalDetailsResponse) SetWifiMac(v string) { } func (o GetTerminalDetailsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -994,12 +993,14 @@ func (v *NullableGetTerminalDetailsResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *GetTerminalDetailsResponse) isValidTerminalStatus() bool { - var allowedEnumValues = []string{"OnlineLast1Day", "OnlineLast2Days", "OnlineLast3Days", "OnlineLast4Days", "OnlineLast5Days", "OnlineLast6Days", "OnlineLast7Days", "OnlineToday", "ReAssignToInventoryPending", "ReAssignToMerchantInventoryPending", "ReAssignToStorePending", "SwitchedOff"} - for _, allowed := range allowedEnumValues { - if o.GetTerminalStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "OnlineLast1Day", "OnlineLast2Days", "OnlineLast3Days", "OnlineLast4Days", "OnlineLast5Days", "OnlineLast6Days", "OnlineLast7Days", "OnlineToday", "ReAssignToInventoryPending", "ReAssignToMerchantInventoryPending", "ReAssignToStorePending", "SwitchedOff" } + for _, allowed := range allowedEnumValues { + if o.GetTerminalStatus() == allowed { + return true + } + } + return false } + diff --git a/src/posterminalmanagement/model_get_terminals_under_account_request.go b/src/posterminalmanagement/model_get_terminals_under_account_request.go index 775f0fc33..fc6849ab0 100644 --- a/src/posterminalmanagement/model_get_terminals_under_account_request.go +++ b/src/posterminalmanagement/model_get_terminals_under_account_request.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTerminalsUnderAccountRequest type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *GetTerminalsUnderAccountRequest) SetStore(v string) { } func (o GetTerminalsUnderAccountRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableGetTerminalsUnderAccountRequest) UnmarshalJSON(src []byte) erro v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_get_terminals_under_account_response.go b/src/posterminalmanagement/model_get_terminals_under_account_response.go index 974e50eaa..14fb3b217 100644 --- a/src/posterminalmanagement/model_get_terminals_under_account_response.go +++ b/src/posterminalmanagement/model_get_terminals_under_account_response.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the GetTerminalsUnderAccountResponse type satisfies the MappedNullable interface at compile time @@ -134,7 +133,7 @@ func (o *GetTerminalsUnderAccountResponse) SetMerchantAccounts(v []MerchantAccou } func (o GetTerminalsUnderAccountResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -188,3 +187,6 @@ func (v *NullableGetTerminalsUnderAccountResponse) UnmarshalJSON(src []byte) err v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_merchant_account.go b/src/posterminalmanagement/model_merchant_account.go index e6668f9e8..0193efcd4 100644 --- a/src/posterminalmanagement/model_merchant_account.go +++ b/src/posterminalmanagement/model_merchant_account.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantAccount type satisfies the MappedNullable interface at compile time @@ -168,7 +167,7 @@ func (o *MerchantAccount) SetStores(v []Store) { } func (o MerchantAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -225,3 +224,6 @@ func (v *NullableMerchantAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_service_error.go b/src/posterminalmanagement/model_service_error.go index aecea83c8..ac421d639 100644 --- a/src/posterminalmanagement/model_service_error.go +++ b/src/posterminalmanagement/model_service_error.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/posterminalmanagement/model_store.go b/src/posterminalmanagement/model_store.go index b0646a3cd..eb9bbc766 100644 --- a/src/posterminalmanagement/model_store.go +++ b/src/posterminalmanagement/model_store.go @@ -10,8 +10,7 @@ package posterminalmanagement import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Store type satisfies the MappedNullable interface at compile time @@ -26,7 +25,7 @@ type Store struct { InStoreTerminals []string `json:"inStoreTerminals,omitempty"` // The code of the merchant account. MerchantAccountCode *string `json:"merchantAccountCode,omitempty"` - // The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. + // The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. Status *string `json:"status,omitempty"` // The code of the store. Store string `json:"store"` @@ -235,7 +234,7 @@ func (o *Store) SetStore(v string) { } func (o Store) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -298,3 +297,6 @@ func (v *NullableStore) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/api_general.go b/src/recurring/api_general.go index b5aa68a40..dea3e3ea9 100644 --- a/src/recurring/api_general.go +++ b/src/recurring/api_general.go @@ -10,10 +10,10 @@ package recurring import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiCreatePermitInput) CreatePermitRequest(createPermitRequest Cre return r } + /* Prepare a request for CreatePermit @return GeneralApiCreatePermitInput */ func (a *GeneralApi) CreatePermitInput() GeneralApiCreatePermitInput { - return GeneralApiCreatePermitInput{} + return GeneralApiCreatePermitInput{ + } } /* @@ -48,24 +50,26 @@ Create permits for a recurring contract, including support for defining restrict @return CreatePermitResult, *http.Response, error */ func (a *GeneralApi) CreatePermit(ctx context.Context, r GeneralApiCreatePermitInput) (CreatePermitResult, *http.Response, error) { - res := &CreatePermitResult{} + res := &CreatePermitResult{} path := "/createPermit" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.createPermitRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.createPermitRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.Disable type GeneralApiDisableInput struct { disableRequest *DisableRequest @@ -76,13 +80,15 @@ func (r GeneralApiDisableInput) DisableRequest(disableRequest DisableRequest) Ge return r } + /* Prepare a request for Disable @return GeneralApiDisableInput */ func (a *GeneralApi) DisableInput() GeneralApiDisableInput { - return GeneralApiDisableInput{} + return GeneralApiDisableInput{ + } } /* @@ -97,24 +103,26 @@ For more information, refer to [Disable stored details](https://docs.adyen.com/c @return DisableResult, *http.Response, error */ func (a *GeneralApi) Disable(ctx context.Context, r GeneralApiDisableInput) (DisableResult, *http.Response, error) { - res := &DisableResult{} + res := &DisableResult{} path := "/disable" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.disableRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.disableRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.DisablePermit type GeneralApiDisablePermitInput struct { disablePermitRequest *DisablePermitRequest @@ -125,13 +133,15 @@ func (r GeneralApiDisablePermitInput) DisablePermitRequest(disablePermitRequest return r } + /* Prepare a request for DisablePermit @return GeneralApiDisablePermitInput */ func (a *GeneralApi) DisablePermitInput() GeneralApiDisablePermitInput { - return GeneralApiDisablePermitInput{} + return GeneralApiDisablePermitInput{ + } } /* @@ -144,24 +154,26 @@ Disable a permit that was previously linked to a recurringDetailReference. @return DisablePermitResult, *http.Response, error */ func (a *GeneralApi) DisablePermit(ctx context.Context, r GeneralApiDisablePermitInput) (DisablePermitResult, *http.Response, error) { - res := &DisablePermitResult{} + res := &DisablePermitResult{} path := "/disablePermit" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.disablePermitRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.disablePermitRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.ListRecurringDetails type GeneralApiListRecurringDetailsInput struct { recurringDetailsRequest *RecurringDetailsRequest @@ -172,13 +184,15 @@ func (r GeneralApiListRecurringDetailsInput) RecurringDetailsRequest(recurringDe return r } + /* Prepare a request for ListRecurringDetails @return GeneralApiListRecurringDetailsInput */ func (a *GeneralApi) ListRecurringDetailsInput() GeneralApiListRecurringDetailsInput { - return GeneralApiListRecurringDetailsInput{} + return GeneralApiListRecurringDetailsInput{ + } } /* @@ -193,24 +207,26 @@ For more information, refer to [Retrieve stored details](https://docs.adyen.com/ @return RecurringDetailsResult, *http.Response, error */ func (a *GeneralApi) ListRecurringDetails(ctx context.Context, r GeneralApiListRecurringDetailsInput) (RecurringDetailsResult, *http.Response, error) { - res := &RecurringDetailsResult{} + res := &RecurringDetailsResult{} path := "/listRecurringDetails" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.recurringDetailsRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.recurringDetailsRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.NotifyShopper type GeneralApiNotifyShopperInput struct { notifyShopperRequest *NotifyShopperRequest @@ -221,13 +237,15 @@ func (r GeneralApiNotifyShopperInput) NotifyShopperRequest(notifyShopperRequest return r } + /* Prepare a request for NotifyShopper @return GeneralApiNotifyShopperInput */ func (a *GeneralApi) NotifyShopperInput() GeneralApiNotifyShopperInput { - return GeneralApiNotifyShopperInput{} + return GeneralApiNotifyShopperInput{ + } } /* @@ -240,24 +258,26 @@ Sends a request to the issuer so they can inform the shopper about the upcoming @return NotifyShopperResult, *http.Response, error */ func (a *GeneralApi) NotifyShopper(ctx context.Context, r GeneralApiNotifyShopperInput) (NotifyShopperResult, *http.Response, error) { - res := &NotifyShopperResult{} + res := &NotifyShopperResult{} path := "/notifyShopper" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.notifyShopperRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.notifyShopperRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.ScheduleAccountUpdater type GeneralApiScheduleAccountUpdaterInput struct { scheduleAccountUpdaterRequest *ScheduleAccountUpdaterRequest @@ -268,13 +288,15 @@ func (r GeneralApiScheduleAccountUpdaterInput) ScheduleAccountUpdaterRequest(sch return r } + /* Prepare a request for ScheduleAccountUpdater @return GeneralApiScheduleAccountUpdaterInput */ func (a *GeneralApi) ScheduleAccountUpdaterInput() GeneralApiScheduleAccountUpdaterInput { - return GeneralApiScheduleAccountUpdaterInput{} + return GeneralApiScheduleAccountUpdaterInput{ + } } /* @@ -289,20 +311,22 @@ When making the API call, you can submit either the credit card information, or @return ScheduleAccountUpdaterResult, *http.Response, error */ func (a *GeneralApi) ScheduleAccountUpdater(ctx context.Context, r GeneralApiScheduleAccountUpdaterInput) (ScheduleAccountUpdaterResult, *http.Response, error) { - res := &ScheduleAccountUpdaterResult{} + res := &ScheduleAccountUpdaterResult{} path := "/scheduleAccountUpdater" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.scheduleAccountUpdaterRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.scheduleAccountUpdaterRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/recurring/model_address.go b/src/recurring/model_address.go index ceea18373..dfd5bf5a7 100644 --- a/src/recurring/model_address.go +++ b/src/recurring/model_address.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -208,7 +207,7 @@ func (o *Address) SetStreet(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -263,3 +262,6 @@ func (v *NullableAddress) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_amount.go b/src/recurring/model_amount.go index bca4b8a45..a1a4a10c3 100644 --- a/src/recurring/model_amount.go +++ b/src/recurring/model_amount.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_bank_account.go b/src/recurring/model_bank_account.go index 4769b37d5..194b86a22 100644 --- a/src/recurring/model_bank_account.go +++ b/src/recurring/model_bank_account.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccount type satisfies the MappedNullable interface at compile time @@ -345,7 +344,7 @@ func (o *BankAccount) SetTaxId(v string) { } func (o BankAccount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -419,3 +418,6 @@ func (v *NullableBankAccount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_card.go b/src/recurring/model_card.go index 01c68d229..0303f1cf4 100644 --- a/src/recurring/model_card.go +++ b/src/recurring/model_card.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Card type satisfies the MappedNullable interface at compile time @@ -311,7 +310,7 @@ func (o *Card) SetStartYear(v string) { } func (o Card) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_create_permit_request.go b/src/recurring/model_create_permit_request.go index 412f9f898..2b20ff51e 100644 --- a/src/recurring/model_create_permit_request.go +++ b/src/recurring/model_create_permit_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreatePermitRequest type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *CreatePermitRequest) SetShopperReference(v string) { } func (o CreatePermitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableCreatePermitRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_create_permit_result.go b/src/recurring/model_create_permit_result.go index b8bc1413a..75ecdf23a 100644 --- a/src/recurring/model_create_permit_result.go +++ b/src/recurring/model_create_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CreatePermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *CreatePermitResult) SetPspReference(v string) { } func (o CreatePermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableCreatePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_permit_request.go b/src/recurring/model_disable_permit_request.go index 3ff017425..7920ba423 100644 --- a/src/recurring/model_disable_permit_request.go +++ b/src/recurring/model_disable_permit_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DisablePermitRequest type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *DisablePermitRequest) SetToken(v string) { } func (o DisablePermitRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableDisablePermitRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_permit_result.go b/src/recurring/model_disable_permit_result.go index af146a379..04f15ee82 100644 --- a/src/recurring/model_disable_permit_result.go +++ b/src/recurring/model_disable_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DisablePermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *DisablePermitResult) SetStatus(v string) { } func (o DisablePermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableDisablePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_request.go b/src/recurring/model_disable_request.go index 4711b265f..e55b3789b 100644 --- a/src/recurring/model_disable_request.go +++ b/src/recurring/model_disable_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DisableRequest type satisfies the MappedNullable interface at compile time @@ -161,7 +160,7 @@ func (o *DisableRequest) SetShopperReference(v string) { } func (o DisableRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -216,3 +215,6 @@ func (v *NullableDisableRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_disable_result.go b/src/recurring/model_disable_result.go index c94a9849c..b484f3d3b 100644 --- a/src/recurring/model_disable_result.go +++ b/src/recurring/model_disable_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DisableResult type satisfies the MappedNullable interface at compile time @@ -73,7 +72,7 @@ func (o *DisableResult) SetResponse(v string) { } func (o DisableResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -123,3 +122,6 @@ func (v *NullableDisableResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_name.go b/src/recurring/model_name.go index 64814ec32..f15208723 100644 --- a/src/recurring/model_name.go +++ b/src/recurring/model_name.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Name type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Name) SetLastName(v string) { } func (o Name) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableName) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_notify_shopper_request.go b/src/recurring/model_notify_shopper_request.go index ec1c67267..ab364e1a2 100644 --- a/src/recurring/model_notify_shopper_request.go +++ b/src/recurring/model_notify_shopper_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NotifyShopperRequest type satisfies the MappedNullable interface at compile time @@ -316,7 +315,7 @@ func (o *NotifyShopperRequest) SetStoredPaymentMethodId(v string) { } func (o NotifyShopperRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,3 +381,6 @@ func (v *NullableNotifyShopperRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_notify_shopper_result.go b/src/recurring/model_notify_shopper_result.go index 5474e6b00..7d062e488 100644 --- a/src/recurring/model_notify_shopper_result.go +++ b/src/recurring/model_notify_shopper_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NotifyShopperResult type satisfies the MappedNullable interface at compile time @@ -277,7 +276,7 @@ func (o *NotifyShopperResult) SetStoredPaymentMethodId(v string) { } func (o NotifyShopperResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,3 +344,6 @@ func (v *NullableNotifyShopperResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit.go b/src/recurring/model_permit.go index 09cb83097..4ae858ae4 100644 --- a/src/recurring/model_permit.go +++ b/src/recurring/model_permit.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Permit type satisfies the MappedNullable interface at compile time @@ -23,8 +22,8 @@ type Permit struct { // Partner ID (when using the permit-per-partner token sharing model). PartnerId *string `json:"partnerId,omitempty"` // The profile to apply to this permit (when using the shared permits model). - ProfileReference *string `json:"profileReference,omitempty"` - Restriction *PermitRestriction `json:"restriction,omitempty"` + ProfileReference *string `json:"profileReference,omitempty"` + Restriction *PermitRestriction `json:"restriction,omitempty"` // The key to link permit requests to permit results. ResultKey *string `json:"resultKey,omitempty"` // The expiry date for this permit. @@ -209,7 +208,7 @@ func (o *Permit) SetValidTillDate(v time.Time) { } func (o Permit) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullablePermit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit_restriction.go b/src/recurring/model_permit_restriction.go index 5dbbc98fa..396ed721d 100644 --- a/src/recurring/model_permit_restriction.go +++ b/src/recurring/model_permit_restriction.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PermitRestriction type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &PermitRestriction{} // PermitRestriction struct for PermitRestriction type PermitRestriction struct { - MaxAmount *Amount `json:"maxAmount,omitempty"` + MaxAmount *Amount `json:"maxAmount,omitempty"` SingleTransactionLimit *Amount `json:"singleTransactionLimit,omitempty"` // Only a single payment can be made using this permit if set to true, otherwise multiple payments are allowed. SingleUse *bool `json:"singleUse,omitempty"` @@ -139,7 +138,7 @@ func (o *PermitRestriction) SetSingleUse(v bool) { } func (o PermitRestriction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -195,3 +194,6 @@ func (v *NullablePermitRestriction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_permit_result.go b/src/recurring/model_permit_result.go index dffe0cf7c..00a34bb11 100644 --- a/src/recurring/model_permit_result.go +++ b/src/recurring/model_permit_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PermitResult type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *PermitResult) SetToken(v string) { } func (o PermitResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullablePermitResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring.go b/src/recurring/model_recurring.go index 548b0838f..0b8c78112 100644 --- a/src/recurring/model_recurring.go +++ b/src/recurring/model_recurring.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Recurring type satisfies the MappedNullable interface at compile time @@ -210,7 +209,7 @@ func (o *Recurring) SetTokenService(v string) { } func (o Recurring) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -273,21 +272,23 @@ func (v *NullableRecurring) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Recurring) isValidContract() bool { - var allowedEnumValues = []string{"ONECLICK", "RECURRING", "PAYOUT"} - for _, allowed := range allowedEnumValues { - if o.GetContract() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ONECLICK", "RECURRING", "PAYOUT" } + for _, allowed := range allowedEnumValues { + if o.GetContract() == allowed { + return true + } + } + return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} - for _, allowed := range allowedEnumValues { - if o.GetTokenService() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING" } + for _, allowed := range allowedEnumValues { + if o.GetTokenService() == allowed { + return true + } + } + return false } + diff --git a/src/recurring/model_recurring_detail.go b/src/recurring/model_recurring_detail.go index 5882174ff..63a7dcba7 100644 --- a/src/recurring/model_recurring_detail.go +++ b/src/recurring/model_recurring_detail.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RecurringDetail type satisfies the MappedNullable interface at compile time @@ -25,10 +24,10 @@ type RecurringDetail struct { // The alias of the credit card number. Applies only to recurring contracts storing credit card details Alias *string `json:"alias,omitempty"` // The alias type of the credit card number. Applies only to recurring contracts storing credit card details. - AliasType *string `json:"aliasType,omitempty"` - Bank *BankAccount `json:"bank,omitempty"` - BillingAddress *Address `json:"billingAddress,omitempty"` - Card *Card `json:"card,omitempty"` + AliasType *string `json:"aliasType,omitempty"` + Bank *BankAccount `json:"bank,omitempty"` + BillingAddress *Address `json:"billingAddress,omitempty"` + Card *Card `json:"card,omitempty"` // Types of recurring contracts. ContractTypes []string `json:"contractTypes,omitempty"` // The date when the recurring details were created. @@ -43,10 +42,10 @@ type RecurringDetail struct { PaymentMethodVariant *string `json:"paymentMethodVariant,omitempty"` // The reference that uniquely identifies the recurring detail. RecurringDetailReference string `json:"recurringDetailReference"` - ShopperName *Name `json:"shopperName,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` // A shopper's social security number (only in countries where it is legal to collect). - SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` - TokenDetails *TokenDetails `json:"tokenDetails,omitempty"` + SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` + TokenDetails *TokenDetails `json:"tokenDetails,omitempty"` // The payment method, such as “mc\", \"visa\", \"ideal\", \"paypal\". Variant string `json:"variant"` } @@ -599,7 +598,7 @@ func (o *RecurringDetail) SetVariant(v string) { } func (o RecurringDetail) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -693,3 +692,6 @@ func (v *NullableRecurringDetail) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_detail_wrapper.go b/src/recurring/model_recurring_detail_wrapper.go index 2a3b08480..b7d1ece52 100644 --- a/src/recurring/model_recurring_detail_wrapper.go +++ b/src/recurring/model_recurring_detail_wrapper.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RecurringDetailWrapper type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *RecurringDetailWrapper) SetRecurringDetail(v RecurringDetail) { } func (o RecurringDetailWrapper) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableRecurringDetailWrapper) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_details_request.go b/src/recurring/model_recurring_details_request.go index 743534dfd..dc060dfd0 100644 --- a/src/recurring/model_recurring_details_request.go +++ b/src/recurring/model_recurring_details_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RecurringDetailsRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &RecurringDetailsRequest{} // RecurringDetailsRequest struct for RecurringDetailsRequest type RecurringDetailsRequest struct { // The merchant account identifier you want to process the (transaction) request with. - MerchantAccount string `json:"merchantAccount"` - Recurring *Recurring `json:"recurring,omitempty"` + MerchantAccount string `json:"merchantAccount"` + Recurring *Recurring `json:"recurring,omitempty"` // The reference you use to uniquely identify the shopper (e.g. user ID or account ID). ShopperReference string `json:"shopperReference"` } @@ -126,7 +125,7 @@ func (o *RecurringDetailsRequest) SetShopperReference(v string) { } func (o RecurringDetailsRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -178,3 +177,6 @@ func (v *NullableRecurringDetailsRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_recurring_details_result.go b/src/recurring/model_recurring_details_result.go index 785595248..ddb4e4911 100644 --- a/src/recurring/model_recurring_details_result.go +++ b/src/recurring/model_recurring_details_result.go @@ -10,9 +10,8 @@ package recurring import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RecurringDetailsResult type satisfies the MappedNullable interface at compile time @@ -176,7 +175,7 @@ func (o *RecurringDetailsResult) SetShopperReference(v string) { } func (o RecurringDetailsResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,3 +234,6 @@ func (v *NullableRecurringDetailsResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_schedule_account_updater_request.go b/src/recurring/model_schedule_account_updater_request.go index 850a303d5..3d314f246 100644 --- a/src/recurring/model_schedule_account_updater_request.go +++ b/src/recurring/model_schedule_account_updater_request.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ScheduleAccountUpdaterRequest type satisfies the MappedNullable interface at compile time @@ -21,7 +20,7 @@ var _ common.MappedNullable = &ScheduleAccountUpdaterRequest{} type ScheduleAccountUpdaterRequest struct { // This field contains additional data, which may be required for a particular request. AdditionalData *map[string]string `json:"additionalData,omitempty"` - Card *Card `json:"card,omitempty"` + Card *Card `json:"card,omitempty"` // Account of the merchant. MerchantAccount string `json:"merchantAccount"` // A reference that merchants can apply for the call. @@ -228,7 +227,7 @@ func (o *ScheduleAccountUpdaterRequest) SetShopperReference(v string) { } func (o ScheduleAccountUpdaterRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -289,3 +288,6 @@ func (v *NullableScheduleAccountUpdaterRequest) UnmarshalJSON(src []byte) error v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_schedule_account_updater_result.go b/src/recurring/model_schedule_account_updater_result.go index cc43ed293..ed3cfb701 100644 --- a/src/recurring/model_schedule_account_updater_result.go +++ b/src/recurring/model_schedule_account_updater_result.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ScheduleAccountUpdaterResult type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *ScheduleAccountUpdaterResult) SetResult(v string) { } func (o ScheduleAccountUpdaterResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableScheduleAccountUpdaterResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_service_error.go b/src/recurring/model_service_error.go index 59adf3f08..e1e3b100c 100644 --- a/src/recurring/model_service_error.go +++ b/src/recurring/model_service_error.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/recurring/model_token_details.go b/src/recurring/model_token_details.go index 7e5bfb89a..6f1e480cc 100644 --- a/src/recurring/model_token_details.go +++ b/src/recurring/model_token_details.go @@ -10,8 +10,7 @@ package recurring import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TokenDetails type satisfies the MappedNullable interface at compile time @@ -19,8 +18,8 @@ var _ common.MappedNullable = &TokenDetails{} // TokenDetails struct for TokenDetails type TokenDetails struct { - TokenData *map[string]string `json:"tokenData,omitempty"` - TokenDataType *string `json:"tokenDataType,omitempty"` + TokenData *map[string]string `json:"tokenData,omitempty"` + TokenDataType *string `json:"tokenDataType,omitempty"` } // NewTokenDetails instantiates a new TokenDetails object @@ -105,7 +104,7 @@ func (o *TokenDetails) SetTokenDataType(v string) { } func (o TokenDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableTokenDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/reportwebhooks/model_balance_platform_notification_response.go b/src/reportwebhooks/model_balance_platform_notification_response.go new file mode 100644 index 000000000..fb613e8b1 --- /dev/null +++ b/src/reportwebhooks/model_balance_platform_notification_response.go @@ -0,0 +1,127 @@ +/* +Report webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package reportwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalancePlatformNotificationResponse{} + +// BalancePlatformNotificationResponse struct for BalancePlatformNotificationResponse +type BalancePlatformNotificationResponse struct { + // Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewBalancePlatformNotificationResponse instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponse() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// NewBalancePlatformNotificationResponseWithDefaults instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponseWithDefaults() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalancePlatformNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableBalancePlatformNotificationResponse struct { + value *BalancePlatformNotificationResponse + isSet bool +} + +func (v NullableBalancePlatformNotificationResponse) Get() *BalancePlatformNotificationResponse { + return v.value +} + +func (v *NullableBalancePlatformNotificationResponse) Set(val *BalancePlatformNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBalancePlatformNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBalancePlatformNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalancePlatformNotificationResponse(val *BalancePlatformNotificationResponse) *NullableBalancePlatformNotificationResponse { + return &NullableBalancePlatformNotificationResponse{value: val, isSet: true} +} + +func (v NullableBalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/reportwebhooks/model_report_notification_data.go b/src/reportwebhooks/model_report_notification_data.go new file mode 100644 index 000000000..5d9a46c32 --- /dev/null +++ b/src/reportwebhooks/model_report_notification_data.go @@ -0,0 +1,321 @@ +/* +Report webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package reportwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the ReportNotificationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ReportNotificationData{} + +// ReportNotificationData struct for ReportNotificationData +type ReportNotificationData struct { + AccountHolder *ResourceReference `json:"accountHolder,omitempty"` + BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The URL at which you can download the report. To download, you must authenticate your GET request with your [API credentials](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview). + DownloadUrl string `json:"downloadUrl"` + // The filename of the report. + FileName string `json:"fileName"` + // Type of report. + ReportType string `json:"reportType"` +} + +// NewReportNotificationData instantiates a new ReportNotificationData 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 NewReportNotificationData(downloadUrl string, fileName string, reportType string) *ReportNotificationData { + this := ReportNotificationData{} + this.DownloadUrl = downloadUrl + this.FileName = fileName + this.ReportType = reportType + return &this +} + +// NewReportNotificationDataWithDefaults instantiates a new ReportNotificationData 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 NewReportNotificationDataWithDefaults() *ReportNotificationData { + this := ReportNotificationData{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value if set, zero value otherwise. +func (o *ReportNotificationData) GetAccountHolder() ResourceReference { + if o == nil || common.IsNil(o.AccountHolder) { + var ret ResourceReference + return ret + } + return *o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetAccountHolderOk() (*ResourceReference, bool) { + if o == nil || common.IsNil(o.AccountHolder) { + return nil, false + } + return o.AccountHolder, true +} + +// HasAccountHolder returns a boolean if a field has been set. +func (o *ReportNotificationData) HasAccountHolder() bool { + if o != nil && !common.IsNil(o.AccountHolder) { + return true + } + + return false +} + +// SetAccountHolder gets a reference to the given ResourceReference and assigns it to the AccountHolder field. +func (o *ReportNotificationData) SetAccountHolder(v ResourceReference) { + o.AccountHolder = &v +} + +// GetBalanceAccount returns the BalanceAccount field value if set, zero value otherwise. +func (o *ReportNotificationData) GetBalanceAccount() ResourceReference { + if o == nil || common.IsNil(o.BalanceAccount) { + var ret ResourceReference + return ret + } + return *o.BalanceAccount +} + +// GetBalanceAccountOk returns a tuple with the BalanceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetBalanceAccountOk() (*ResourceReference, bool) { + if o == nil || common.IsNil(o.BalanceAccount) { + return nil, false + } + return o.BalanceAccount, true +} + +// HasBalanceAccount returns a boolean if a field has been set. +func (o *ReportNotificationData) HasBalanceAccount() bool { + if o != nil && !common.IsNil(o.BalanceAccount) { + return true + } + + return false +} + +// SetBalanceAccount gets a reference to the given ResourceReference and assigns it to the BalanceAccount field. +func (o *ReportNotificationData) SetBalanceAccount(v ResourceReference) { + o.BalanceAccount = &v +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *ReportNotificationData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *ReportNotificationData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *ReportNotificationData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *ReportNotificationData) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *ReportNotificationData) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *ReportNotificationData) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetDownloadUrl returns the DownloadUrl field value +func (o *ReportNotificationData) GetDownloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DownloadUrl +} + +// GetDownloadUrlOk returns a tuple with the DownloadUrl field value +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetDownloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DownloadUrl, true +} + +// SetDownloadUrl sets field value +func (o *ReportNotificationData) SetDownloadUrl(v string) { + o.DownloadUrl = v +} + +// GetFileName returns the FileName field value +func (o *ReportNotificationData) GetFileName() string { + if o == nil { + var ret string + return ret + } + + return o.FileName +} + +// GetFileNameOk returns a tuple with the FileName field value +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetFileNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FileName, true +} + +// SetFileName sets field value +func (o *ReportNotificationData) SetFileName(v string) { + o.FileName = v +} + +// GetReportType returns the ReportType field value +func (o *ReportNotificationData) GetReportType() string { + if o == nil { + var ret string + return ret + } + + return o.ReportType +} + +// GetReportTypeOk returns a tuple with the ReportType field value +// and a boolean to check if the value has been set. +func (o *ReportNotificationData) GetReportTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReportType, true +} + +// SetReportType sets field value +func (o *ReportNotificationData) SetReportType(v string) { + o.ReportType = v +} + +func (o ReportNotificationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReportNotificationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountHolder) { + toSerialize["accountHolder"] = o.AccountHolder + } + if !common.IsNil(o.BalanceAccount) { + toSerialize["balanceAccount"] = o.BalanceAccount + } + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + toSerialize["downloadUrl"] = o.DownloadUrl + toSerialize["fileName"] = o.FileName + toSerialize["reportType"] = o.ReportType + return toSerialize, nil +} + +type NullableReportNotificationData struct { + value *ReportNotificationData + isSet bool +} + +func (v NullableReportNotificationData) Get() *ReportNotificationData { + return v.value +} + +func (v *NullableReportNotificationData) Set(val *ReportNotificationData) { + v.value = val + v.isSet = true +} + +func (v NullableReportNotificationData) IsSet() bool { + return v.isSet +} + +func (v *NullableReportNotificationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReportNotificationData(val *ReportNotificationData) *NullableReportNotificationData { + return &NullableReportNotificationData{value: val, isSet: true} +} + +func (v NullableReportNotificationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReportNotificationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/reportwebhooks/model_report_notification_request.go b/src/reportwebhooks/model_report_notification_request.go new file mode 100644 index 000000000..01db13d78 --- /dev/null +++ b/src/reportwebhooks/model_report_notification_request.go @@ -0,0 +1,182 @@ +/* +Report webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package reportwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ReportNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ReportNotificationRequest{} + +// ReportNotificationRequest struct for ReportNotificationRequest +type ReportNotificationRequest struct { + Data ReportNotificationData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of webhook. + Type string `json:"type"` +} + +// NewReportNotificationRequest instantiates a new ReportNotificationRequest 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 NewReportNotificationRequest(data ReportNotificationData, environment string, type_ string) *ReportNotificationRequest { + this := ReportNotificationRequest{} + this.Data = data + this.Environment = environment + this.Type = type_ + return &this +} + +// NewReportNotificationRequestWithDefaults instantiates a new ReportNotificationRequest 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 NewReportNotificationRequestWithDefaults() *ReportNotificationRequest { + this := ReportNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *ReportNotificationRequest) GetData() ReportNotificationData { + if o == nil { + var ret ReportNotificationData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ReportNotificationRequest) GetDataOk() (*ReportNotificationData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ReportNotificationRequest) SetData(v ReportNotificationData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *ReportNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *ReportNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *ReportNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *ReportNotificationRequest) 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 *ReportNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ReportNotificationRequest) SetType(v string) { + o.Type = v +} + +func (o ReportNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReportNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableReportNotificationRequest struct { + value *ReportNotificationRequest + isSet bool +} + +func (v NullableReportNotificationRequest) Get() *ReportNotificationRequest { + return v.value +} + +func (v *NullableReportNotificationRequest) Set(val *ReportNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableReportNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableReportNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReportNotificationRequest(val *ReportNotificationRequest) *NullableReportNotificationRequest { + return &NullableReportNotificationRequest{value: val, isSet: true} +} + +func (v NullableReportNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReportNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *ReportNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.report.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/reportwebhooks/model_resource.go b/src/reportwebhooks/model_resource.go new file mode 100644 index 000000000..05e870bc9 --- /dev/null +++ b/src/reportwebhooks/model_resource.go @@ -0,0 +1,202 @@ +/* +Report webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package reportwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` +} + +// NewResource instantiates a new Resource 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 NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *Resource) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *Resource) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *Resource) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Resource) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Resource) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Resource) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Resource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Resource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Resource) SetId(v string) { + o.Id = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/reportwebhooks/model_resource_reference.go b/src/reportwebhooks/model_resource_reference.go new file mode 100644 index 000000000..318ca3b24 --- /dev/null +++ b/src/reportwebhooks/model_resource_reference.go @@ -0,0 +1,201 @@ +/* +Report webhooks + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package reportwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ResourceReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ResourceReference{} + +// ResourceReference struct for ResourceReference +type ResourceReference struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` +} + +// NewResourceReference instantiates a new ResourceReference 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 NewResourceReference() *ResourceReference { + this := ResourceReference{} + return &this +} + +// NewResourceReferenceWithDefaults instantiates a new ResourceReference 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 NewResourceReferenceWithDefaults() *ResourceReference { + this := ResourceReference{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ResourceReference) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ResourceReference) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ResourceReference) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourceReference) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ResourceReference) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourceReference) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *ResourceReference) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *ResourceReference) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *ResourceReference) SetReference(v string) { + o.Reference = &v +} + +func (o ResourceReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableResourceReference struct { + value *ResourceReference + isSet bool +} + +func (v NullableResourceReference) Get() *ResourceReference { + return v.value +} + +func (v *NullableResourceReference) Set(val *ResourceReference) { + v.value = val + v.isSet = true +} + +func (v NullableResourceReference) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceReference(val *ResourceReference) *NullableResourceReference { + return &NullableResourceReference{value: val, isSet: true} +} + +func (v NullableResourceReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/storedvalue/api_general.go b/src/storedvalue/api_general.go index a5a95d05d..f75ceb75c 100644 --- a/src/storedvalue/api_general.go +++ b/src/storedvalue/api_general.go @@ -10,10 +10,10 @@ package storedvalue import ( "context" - "net/http" - "net/url" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // GeneralApi service @@ -29,13 +29,15 @@ func (r GeneralApiChangeStatusInput) StoredValueStatusChangeRequest(storedValueS return r } + /* Prepare a request for ChangeStatus @return GeneralApiChangeStatusInput */ func (a *GeneralApi) ChangeStatusInput() GeneralApiChangeStatusInput { - return GeneralApiChangeStatusInput{} + return GeneralApiChangeStatusInput{ + } } /* @@ -48,24 +50,26 @@ Changes the status of the provided payment method to the specified status. @return StoredValueStatusChangeResponse, *http.Response, error */ func (a *GeneralApi) ChangeStatus(ctx context.Context, r GeneralApiChangeStatusInput) (StoredValueStatusChangeResponse, *http.Response, error) { - res := &StoredValueStatusChangeResponse{} + res := &StoredValueStatusChangeResponse{} path := "/changeStatus" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueStatusChangeRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueStatusChangeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.CheckBalance type GeneralApiCheckBalanceInput struct { storedValueBalanceCheckRequest *StoredValueBalanceCheckRequest @@ -76,13 +80,15 @@ func (r GeneralApiCheckBalanceInput) StoredValueBalanceCheckRequest(storedValueB return r } + /* Prepare a request for CheckBalance @return GeneralApiCheckBalanceInput */ func (a *GeneralApi) CheckBalanceInput() GeneralApiCheckBalanceInput { - return GeneralApiCheckBalanceInput{} + return GeneralApiCheckBalanceInput{ + } } /* @@ -95,24 +101,26 @@ Checks the balance of the provided payment method. @return StoredValueBalanceCheckResponse, *http.Response, error */ func (a *GeneralApi) CheckBalance(ctx context.Context, r GeneralApiCheckBalanceInput) (StoredValueBalanceCheckResponse, *http.Response, error) { - res := &StoredValueBalanceCheckResponse{} + res := &StoredValueBalanceCheckResponse{} path := "/checkBalance" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueBalanceCheckRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueBalanceCheckRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.Issue type GeneralApiIssueInput struct { storedValueIssueRequest *StoredValueIssueRequest @@ -123,13 +131,15 @@ func (r GeneralApiIssueInput) StoredValueIssueRequest(storedValueIssueRequest St return r } + /* Prepare a request for Issue @return GeneralApiIssueInput */ func (a *GeneralApi) IssueInput() GeneralApiIssueInput { - return GeneralApiIssueInput{} + return GeneralApiIssueInput{ + } } /* @@ -142,24 +152,26 @@ Issues a new card of the given payment method. @return StoredValueIssueResponse, *http.Response, error */ func (a *GeneralApi) Issue(ctx context.Context, r GeneralApiIssueInput) (StoredValueIssueResponse, *http.Response, error) { - res := &StoredValueIssueResponse{} + res := &StoredValueIssueResponse{} path := "/issue" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueIssueRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueIssueRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.Load type GeneralApiLoadInput struct { storedValueLoadRequest *StoredValueLoadRequest @@ -170,13 +182,15 @@ func (r GeneralApiLoadInput) StoredValueLoadRequest(storedValueLoadRequest Store return r } + /* Prepare a request for Load @return GeneralApiLoadInput */ func (a *GeneralApi) LoadInput() GeneralApiLoadInput { - return GeneralApiLoadInput{} + return GeneralApiLoadInput{ + } } /* @@ -189,24 +203,26 @@ Loads the payment method with the specified funds. @return StoredValueLoadResponse, *http.Response, error */ func (a *GeneralApi) Load(ctx context.Context, r GeneralApiLoadInput) (StoredValueLoadResponse, *http.Response, error) { - res := &StoredValueLoadResponse{} + res := &StoredValueLoadResponse{} path := "/load" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueLoadRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueLoadRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.MergeBalance type GeneralApiMergeBalanceInput struct { storedValueBalanceMergeRequest *StoredValueBalanceMergeRequest @@ -217,13 +233,15 @@ func (r GeneralApiMergeBalanceInput) StoredValueBalanceMergeRequest(storedValueB return r } + /* Prepare a request for MergeBalance @return GeneralApiMergeBalanceInput */ func (a *GeneralApi) MergeBalanceInput() GeneralApiMergeBalanceInput { - return GeneralApiMergeBalanceInput{} + return GeneralApiMergeBalanceInput{ + } } /* @@ -236,24 +254,26 @@ Increases the balance of the paymentmethod by the full amount left on the source @return StoredValueBalanceMergeResponse, *http.Response, error */ func (a *GeneralApi) MergeBalance(ctx context.Context, r GeneralApiMergeBalanceInput) (StoredValueBalanceMergeResponse, *http.Response, error) { - res := &StoredValueBalanceMergeResponse{} + res := &StoredValueBalanceMergeResponse{} path := "/mergeBalance" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueBalanceMergeRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueBalanceMergeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + // All parameters accepted by GeneralApi.VoidTransaction type GeneralApiVoidTransactionInput struct { storedValueVoidRequest *StoredValueVoidRequest @@ -264,13 +284,15 @@ func (r GeneralApiVoidTransactionInput) StoredValueVoidRequest(storedValueVoidRe return r } + /* Prepare a request for VoidTransaction @return GeneralApiVoidTransactionInput */ func (a *GeneralApi) VoidTransactionInput() GeneralApiVoidTransactionInput { - return GeneralApiVoidTransactionInput{} + return GeneralApiVoidTransactionInput{ + } } /* @@ -283,20 +305,22 @@ Voids the referenced stored value transaction. @return StoredValueVoidResponse, *http.Response, error */ func (a *GeneralApi) VoidTransaction(ctx context.Context, r GeneralApiVoidTransactionInput) (StoredValueVoidResponse, *http.Response, error) { - res := &StoredValueVoidResponse{} + res := &StoredValueVoidResponse{} path := "/voidTransaction" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.storedValueVoidRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.storedValueVoidRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + + return *res, httpRes, err } + diff --git a/src/storedvalue/model_amount.go b/src/storedvalue/model_amount.go index b6c19f190..7fbe877bf 100644 --- a/src/storedvalue/model_amount.go +++ b/src/storedvalue/model_amount.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_service_error.go b/src/storedvalue/model_service_error.go index 5fd66688c..8d726fe82 100644 --- a/src/storedvalue/model_service_error.go +++ b/src/storedvalue/model_service_error.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_stored_value_balance_check_request.go b/src/storedvalue/model_stored_value_balance_check_request.go index f492e89ec..503202f5d 100644 --- a/src/storedvalue/model_stored_value_balance_check_request.go +++ b/src/storedvalue/model_stored_value_balance_check_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueBalanceCheckRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueBalanceCheckRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -287,7 +286,7 @@ func (o *StoredValueBalanceCheckRequest) SetStore(v string) { } func (o StoredValueBalanceCheckRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -353,12 +352,14 @@ func (v *NullableStoredValueBalanceCheckRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceCheckRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_check_response.go b/src/storedvalue/model_stored_value_balance_check_response.go index 306555c9e..2ad981132 100644 --- a/src/storedvalue/model_stored_value_balance_check_response.go +++ b/src/storedvalue/model_stored_value_balance_check_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueBalanceCheckResponse type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type StoredValueBalanceCheckResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -208,7 +207,7 @@ func (o *StoredValueBalanceCheckResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueBalanceCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableStoredValueBalanceCheckResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceCheckResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_merge_request.go b/src/storedvalue/model_stored_value_balance_merge_request.go index 2e325920a..643a299fc 100644 --- a/src/storedvalue/model_stored_value_balance_merge_request.go +++ b/src/storedvalue/model_stored_value_balance_merge_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueBalanceMergeRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueBalanceMergeRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method SourcePaymentMethod map[string]string `json:"sourcePaymentMethod"` // The physical store, for which this payment is processed. @@ -314,7 +313,7 @@ func (o *StoredValueBalanceMergeRequest) SetStore(v string) { } func (o StoredValueBalanceMergeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,12 +380,14 @@ func (v *NullableStoredValueBalanceMergeRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceMergeRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_balance_merge_response.go b/src/storedvalue/model_stored_value_balance_merge_response.go index 78500e727..204572ba0 100644 --- a/src/storedvalue/model_stored_value_balance_merge_response.go +++ b/src/storedvalue/model_stored_value_balance_merge_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueBalanceMergeResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueBalanceMergeResponse{} // StoredValueBalanceMergeResponse struct for StoredValueBalanceMergeResponse type StoredValueBalanceMergeResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueBalanceMergeResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueBalanceMergeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueBalanceMergeResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueBalanceMergeResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_issue_request.go b/src/storedvalue/model_stored_value_issue_request.go index d217f87f8..d9d6bf0c5 100644 --- a/src/storedvalue/model_stored_value_issue_request.go +++ b/src/storedvalue/model_stored_value_issue_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueIssueRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueIssueRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -287,7 +286,7 @@ func (o *StoredValueIssueRequest) SetStore(v string) { } func (o StoredValueIssueRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -353,12 +352,14 @@ func (v *NullableStoredValueIssueRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueIssueRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_issue_response.go b/src/storedvalue/model_stored_value_issue_response.go index 16d1d9692..0a8b89273 100644 --- a/src/storedvalue/model_stored_value_issue_response.go +++ b/src/storedvalue/model_stored_value_issue_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueIssueResponse type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &StoredValueIssueResponse{} // StoredValueIssueResponse struct for StoredValueIssueResponse type StoredValueIssueResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // The collection that contains the type of the payment method and its specific information if available PaymentMethod *map[string]string `json:"paymentMethod,omitempty"` @@ -28,7 +27,7 @@ type StoredValueIssueResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -276,7 +275,7 @@ func (o *StoredValueIssueResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueIssueResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -345,12 +344,14 @@ func (v *NullableStoredValueIssueResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueIssueResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_load_request.go b/src/storedvalue/model_stored_value_load_request.go index 4a058dffe..9d8529317 100644 --- a/src/storedvalue/model_stored_value_load_request.go +++ b/src/storedvalue/model_stored_value_load_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueLoadRequest type satisfies the MappedNullable interface at compile time @@ -25,13 +24,13 @@ type StoredValueLoadRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The physical store, for which this payment is processed. Store *string `json:"store,omitempty"` } @@ -314,7 +313,7 @@ func (o *StoredValueLoadRequest) SetStore(v string) { } func (o StoredValueLoadRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,21 +380,23 @@ func (v *NullableStoredValueLoadRequest) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueLoadRequest) isValidLoadType() bool { - var allowedEnumValues = []string{"merchandiseReturn", "load"} - for _, allowed := range allowedEnumValues { - if o.GetLoadType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "merchandiseReturn", "load" } + for _, allowed := range allowedEnumValues { + if o.GetLoadType() == allowed { + return true + } + } + return false } func (o *StoredValueLoadRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_load_response.go b/src/storedvalue/model_stored_value_load_response.go index 435e4fd9a..3a4342cfd 100644 --- a/src/storedvalue/model_stored_value_load_response.go +++ b/src/storedvalue/model_stored_value_load_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueLoadResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueLoadResponse{} // StoredValueLoadResponse struct for StoredValueLoadResponse type StoredValueLoadResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueLoadResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueLoadResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueLoadResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueLoadResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_status_change_request.go b/src/storedvalue/model_stored_value_status_change_request.go index 9a8d3f0e7..e2e4dd5b5 100644 --- a/src/storedvalue/model_stored_value_status_change_request.go +++ b/src/storedvalue/model_stored_value_status_change_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueStatusChangeRequest type satisfies the MappedNullable interface at compile time @@ -23,13 +22,13 @@ type StoredValueStatusChangeRequest struct { // The merchant account identifier, with which you want to process the transaction. MerchantAccount string `json:"merchantAccount"` // The collection that contains the type of the payment method and its specific information if available - PaymentMethod map[string]string `json:"paymentMethod"` - RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` + PaymentMethod map[string]string `json:"paymentMethod"` + RecurringDetailReference *string `json:"recurringDetailReference,omitempty"` // The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. Reference string `json:"reference"` // Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. ShopperInteraction *string `json:"shopperInteraction,omitempty"` - ShopperReference *string `json:"shopperReference,omitempty"` + ShopperReference *string `json:"shopperReference,omitempty"` // The status you want to change to Status string `json:"status"` // The physical store, for which this payment is processed. @@ -314,7 +313,7 @@ func (o *StoredValueStatusChangeRequest) SetStore(v string) { } func (o StoredValueStatusChangeRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -381,21 +380,23 @@ func (v *NullableStoredValueStatusChangeRequest) UnmarshalJSON(src []byte) error return json.Unmarshal(src, &v.value) } + func (o *StoredValueStatusChangeRequest) isValidShopperInteraction() bool { - var allowedEnumValues = []string{"Ecommerce", "ContAuth", "Moto", "POS"} - for _, allowed := range allowedEnumValues { - if o.GetShopperInteraction() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Ecommerce", "ContAuth", "Moto", "POS" } + for _, allowed := range allowedEnumValues { + if o.GetShopperInteraction() == allowed { + return true + } + } + return false } func (o *StoredValueStatusChangeRequest) isValidStatus() bool { - var allowedEnumValues = []string{"active", "inactive"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "active", "inactive" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_status_change_response.go b/src/storedvalue/model_stored_value_status_change_response.go index ec58f7eec..bde928a57 100644 --- a/src/storedvalue/model_stored_value_status_change_response.go +++ b/src/storedvalue/model_stored_value_status_change_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueStatusChangeResponse type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &StoredValueStatusChangeResponse{} // StoredValueStatusChangeResponse struct for StoredValueStatusChangeResponse type StoredValueStatusChangeResponse struct { // Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - AuthCode *string `json:"authCode,omitempty"` + AuthCode *string `json:"authCode,omitempty"` CurrentBalance *Amount `json:"currentBalance,omitempty"` // Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -242,7 +241,7 @@ func (o *StoredValueStatusChangeResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueStatusChangeResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,12 +307,14 @@ func (v *NullableStoredValueStatusChangeResponse) UnmarshalJSON(src []byte) erro return json.Unmarshal(src, &v.value) } + func (o *StoredValueStatusChangeResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/storedvalue/model_stored_value_void_request.go b/src/storedvalue/model_stored_value_void_request.go index 8e008b71f..185e154ad 100644 --- a/src/storedvalue/model_stored_value_void_request.go +++ b/src/storedvalue/model_stored_value_void_request.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueVoidRequest type satisfies the MappedNullable interface at compile time @@ -229,7 +228,7 @@ func (o *StoredValueVoidRequest) SetUniqueTerminalId(v string) { } func (o StoredValueVoidRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -290,3 +289,6 @@ func (v *NullableStoredValueVoidRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/storedvalue/model_stored_value_void_response.go b/src/storedvalue/model_stored_value_void_response.go index 45aa4e25a..1d63555db 100644 --- a/src/storedvalue/model_stored_value_void_response.go +++ b/src/storedvalue/model_stored_value_void_response.go @@ -10,8 +10,7 @@ package storedvalue import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the StoredValueVoidResponse type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type StoredValueVoidResponse struct { PspReference *string `json:"pspReference,omitempty"` // If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. RefusalReason *string `json:"refusalReason,omitempty"` - // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + // The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ResultCode *string `json:"resultCode,omitempty"` // Raw refusal reason received from the third party, where available ThirdPartyRefusalReason *string `json:"thirdPartyRefusalReason,omitempty"` @@ -208,7 +207,7 @@ func (o *StoredValueVoidResponse) SetThirdPartyRefusalReason(v string) { } func (o StoredValueVoidResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,12 +270,14 @@ func (v *NullableStoredValueVoidResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *StoredValueVoidResponse) isValidResultCode() bool { - var allowedEnumValues = []string{"Success", "Refused", "Error", "NotEnoughBalance"} - for _, allowed := range allowedEnumValues { - if o.GetResultCode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Success", "Refused", "Error", "NotEnoughBalance" } + for _, allowed := range allowedEnumValues { + if o.GetResultCode() == allowed { + return true + } + } + return false } + diff --git a/src/transactionwebhooks/model_amount.go b/src/transactionwebhooks/model_amount.go new file mode 100644 index 000000000..e4ac746b8 --- /dev/null +++ b/src/transactionwebhooks/model_amount.go @@ -0,0 +1,146 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Amount type satisfies the MappedNullable interface at compile time +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). + Currency string `json:"currency"` + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + Value int64 `json:"value"` +} + +// NewAmount instantiates a new Amount 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 NewAmount(currency string, value int64) *Amount { + this := Amount{} + this.Currency = currency + this.Value = value + return &this +} + +// NewAmountWithDefaults instantiates a new Amount 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 NewAmountWithDefaults() *Amount { + this := Amount{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *Amount) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Amount) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Amount) SetCurrency(v string) { + o.Currency = v +} + +// GetValue returns the Value field value +func (o *Amount) GetValue() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Amount) GetValueOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Amount) SetValue(v int64) { + o.Value = v +} + +func (o Amount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Amount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableAmount struct { + value *Amount + isSet bool +} + +func (v NullableAmount) Get() *Amount { + return v.value +} + +func (v *NullableAmount) Set(val *Amount) { + v.value = val + v.isSet = true +} + +func (v NullableAmount) IsSet() bool { + return v.isSet +} + +func (v *NullableAmount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmount(val *Amount) *NullableAmount { + return &NullableAmount{value: val, isSet: true} +} + +func (v NullableAmount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transactionwebhooks/model_balance_platform_notification_response.go b/src/transactionwebhooks/model_balance_platform_notification_response.go new file mode 100644 index 000000000..f0985c7e2 --- /dev/null +++ b/src/transactionwebhooks/model_balance_platform_notification_response.go @@ -0,0 +1,127 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalancePlatformNotificationResponse{} + +// BalancePlatformNotificationResponse struct for BalancePlatformNotificationResponse +type BalancePlatformNotificationResponse struct { + // Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewBalancePlatformNotificationResponse instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponse() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// NewBalancePlatformNotificationResponseWithDefaults instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponseWithDefaults() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalancePlatformNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableBalancePlatformNotificationResponse struct { + value *BalancePlatformNotificationResponse + isSet bool +} + +func (v NullableBalancePlatformNotificationResponse) Get() *BalancePlatformNotificationResponse { + return v.value +} + +func (v *NullableBalancePlatformNotificationResponse) Set(val *BalancePlatformNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBalancePlatformNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBalancePlatformNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalancePlatformNotificationResponse(val *BalancePlatformNotificationResponse) *NullableBalancePlatformNotificationResponse { + return &NullableBalancePlatformNotificationResponse{value: val, isSet: true} +} + +func (v NullableBalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transactionwebhooks/model_resource.go b/src/transactionwebhooks/model_resource.go new file mode 100644 index 000000000..1782c32e4 --- /dev/null +++ b/src/transactionwebhooks/model_resource.go @@ -0,0 +1,202 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` +} + +// NewResource instantiates a new Resource 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 NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *Resource) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *Resource) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *Resource) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Resource) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Resource) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Resource) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Resource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Resource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Resource) SetId(v string) { + o.Id = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transactionwebhooks/model_resource_reference.go b/src/transactionwebhooks/model_resource_reference.go new file mode 100644 index 000000000..adf98b82c --- /dev/null +++ b/src/transactionwebhooks/model_resource_reference.go @@ -0,0 +1,201 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ResourceReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ResourceReference{} + +// ResourceReference struct for ResourceReference +type ResourceReference struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` +} + +// NewResourceReference instantiates a new ResourceReference 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 NewResourceReference() *ResourceReference { + this := ResourceReference{} + return &this +} + +// NewResourceReferenceWithDefaults instantiates a new ResourceReference 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 NewResourceReferenceWithDefaults() *ResourceReference { + this := ResourceReference{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ResourceReference) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ResourceReference) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ResourceReference) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourceReference) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ResourceReference) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourceReference) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *ResourceReference) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *ResourceReference) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *ResourceReference) SetReference(v string) { + o.Reference = &v +} + +func (o ResourceReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableResourceReference struct { + value *ResourceReference + isSet bool +} + +func (v NullableResourceReference) Get() *ResourceReference { + return v.value +} + +func (v *NullableResourceReference) Set(val *ResourceReference) { + v.value = val + v.isSet = true +} + +func (v NullableResourceReference) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceReference(val *ResourceReference) *NullableResourceReference { + return &NullableResourceReference{value: val, isSet: true} +} + +func (v NullableResourceReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transactionwebhooks/model_transaction.go b/src/transactionwebhooks/model_transaction.go new file mode 100644 index 000000000..dd74ce180 --- /dev/null +++ b/src/transactionwebhooks/model_transaction.go @@ -0,0 +1,394 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" + "time" +) + +// checks if the Transaction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Transaction{} + +// Transaction struct for Transaction +type Transaction struct { + AccountHolder ResourceReference `json:"accountHolder"` + Amount Amount `json:"amount"` + BalanceAccount ResourceReference `json:"balanceAccount"` + // The unique identifier of the balance platform. + BalancePlatform string `json:"balancePlatform"` + // The date the transaction was booked into the balance account. + BookingDate time.Time `json:"bookingDate"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The unique identifier of the transaction. + Id string `json:"id"` + // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. + Status string `json:"status"` + Transfer *TransferData `json:"transfer,omitempty"` + // The date the transfer amount becomes available in the balance account. + ValueDate time.Time `json:"valueDate"` +} + +// NewTransaction instantiates a new Transaction 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 NewTransaction(accountHolder ResourceReference, amount Amount, balanceAccount ResourceReference, balancePlatform string, bookingDate time.Time, id string, status string, valueDate time.Time) *Transaction { + this := Transaction{} + this.AccountHolder = accountHolder + this.Amount = amount + this.BalanceAccount = balanceAccount + this.BalancePlatform = balancePlatform + this.BookingDate = bookingDate + this.Id = id + this.Status = status + this.ValueDate = valueDate + return &this +} + +// NewTransactionWithDefaults instantiates a new Transaction 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 NewTransactionWithDefaults() *Transaction { + this := Transaction{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value +func (o *Transaction) GetAccountHolder() ResourceReference { + if o == nil { + var ret ResourceReference + return ret + } + + return o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetAccountHolderOk() (*ResourceReference, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolder, true +} + +// SetAccountHolder sets field value +func (o *Transaction) SetAccountHolder(v ResourceReference) { + o.AccountHolder = v +} + +// GetAmount returns the Amount field value +func (o *Transaction) GetAmount() Amount { + if o == nil { + var ret Amount + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetAmountOk() (*Amount, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *Transaction) SetAmount(v Amount) { + o.Amount = v +} + +// GetBalanceAccount returns the BalanceAccount field value +func (o *Transaction) GetBalanceAccount() ResourceReference { + if o == nil { + var ret ResourceReference + return ret + } + + return o.BalanceAccount +} + +// GetBalanceAccountOk returns a tuple with the BalanceAccount field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBalanceAccountOk() (*ResourceReference, bool) { + if o == nil { + return nil, false + } + return &o.BalanceAccount, true +} + +// SetBalanceAccount sets field value +func (o *Transaction) SetBalanceAccount(v ResourceReference) { + o.BalanceAccount = v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *Transaction) GetBalancePlatform() string { + if o == nil { + var ret string + return ret + } + + return o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *Transaction) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetBookingDate returns the BookingDate field value +func (o *Transaction) GetBookingDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.BookingDate +} + +// GetBookingDateOk returns a tuple with the BookingDate field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetBookingDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.BookingDate, true +} + +// SetBookingDate sets field value +func (o *Transaction) SetBookingDate(v time.Time) { + o.BookingDate = v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Transaction) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Transaction) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Transaction) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Transaction) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value +func (o *Transaction) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Transaction) SetId(v string) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Transaction) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Transaction) SetStatus(v string) { + o.Status = v +} + +// GetTransfer returns the Transfer field value if set, zero value otherwise. +func (o *Transaction) GetTransfer() TransferData { + if o == nil || common.IsNil(o.Transfer) { + var ret TransferData + return ret + } + return *o.Transfer +} + +// GetTransferOk returns a tuple with the Transfer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Transaction) GetTransferOk() (*TransferData, bool) { + if o == nil || common.IsNil(o.Transfer) { + return nil, false + } + return o.Transfer, true +} + +// HasTransfer returns a boolean if a field has been set. +func (o *Transaction) HasTransfer() bool { + if o != nil && !common.IsNil(o.Transfer) { + return true + } + + return false +} + +// SetTransfer gets a reference to the given TransferData and assigns it to the Transfer field. +func (o *Transaction) SetTransfer(v TransferData) { + o.Transfer = &v +} + +// GetValueDate returns the ValueDate field value +func (o *Transaction) GetValueDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ValueDate +} + +// GetValueDateOk returns a tuple with the ValueDate field value +// and a boolean to check if the value has been set. +func (o *Transaction) GetValueDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ValueDate, true +} + +// SetValueDate sets field value +func (o *Transaction) SetValueDate(v time.Time) { + o.ValueDate = v +} + +func (o Transaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountHolder"] = o.AccountHolder + toSerialize["amount"] = o.Amount + toSerialize["balanceAccount"] = o.BalanceAccount + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["bookingDate"] = o.BookingDate + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !common.IsNil(o.Transfer) { + toSerialize["transfer"] = o.Transfer + } + toSerialize["valueDate"] = o.ValueDate + return toSerialize, nil +} + +type NullableTransaction struct { + value *Transaction + isSet bool +} + +func (v NullableTransaction) Get() *Transaction { + return v.value +} + +func (v *NullableTransaction) Set(val *Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransaction(val *Transaction) *NullableTransaction { + return &NullableTransaction{value: val, isSet: true} +} + +func (v NullableTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Transaction) isValidStatus() bool { + var allowedEnumValues = []string{ "booked", "pending" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/transactionwebhooks/model_transaction_notification_request_v4.go b/src/transactionwebhooks/model_transaction_notification_request_v4.go new file mode 100644 index 000000000..f5ed69975 --- /dev/null +++ b/src/transactionwebhooks/model_transaction_notification_request_v4.go @@ -0,0 +1,191 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransactionNotificationRequestV4 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionNotificationRequestV4{} + +// TransactionNotificationRequestV4 struct for TransactionNotificationRequestV4 +type TransactionNotificationRequestV4 struct { + Data Transaction `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // Type of the webhook. + Type *string `json:"type,omitempty"` +} + +// NewTransactionNotificationRequestV4 instantiates a new TransactionNotificationRequestV4 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 NewTransactionNotificationRequestV4(data Transaction, environment string) *TransactionNotificationRequestV4 { + this := TransactionNotificationRequestV4{} + this.Data = data + this.Environment = environment + return &this +} + +// NewTransactionNotificationRequestV4WithDefaults instantiates a new TransactionNotificationRequestV4 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 NewTransactionNotificationRequestV4WithDefaults() *TransactionNotificationRequestV4 { + this := TransactionNotificationRequestV4{} + return &this +} + +// GetData returns the Data field value +func (o *TransactionNotificationRequestV4) GetData() Transaction { + if o == nil { + var ret Transaction + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetDataOk() (*Transaction, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *TransactionNotificationRequestV4) SetData(v Transaction) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *TransactionNotificationRequestV4) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *TransactionNotificationRequestV4) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionNotificationRequestV4) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransactionNotificationRequestV4) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransactionNotificationRequestV4) SetType(v string) { + o.Type = &v +} + +func (o TransactionNotificationRequestV4) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionNotificationRequestV4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransactionNotificationRequestV4 struct { + value *TransactionNotificationRequestV4 + isSet bool +} + +func (v NullableTransactionNotificationRequestV4) Get() *TransactionNotificationRequestV4 { + return v.value +} + +func (v *NullableTransactionNotificationRequestV4) Set(val *TransactionNotificationRequestV4) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionNotificationRequestV4) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionNotificationRequestV4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionNotificationRequestV4(val *TransactionNotificationRequestV4) *NullableTransactionNotificationRequestV4 { + return &NullableTransactionNotificationRequestV4{value: val, isSet: true} +} + +func (v NullableTransactionNotificationRequestV4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionNotificationRequestV4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *TransactionNotificationRequestV4) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.transaction.created" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transactionwebhooks/model_transfer_data.go b/src/transactionwebhooks/model_transfer_data.go new file mode 100644 index 000000000..31b1b79ee --- /dev/null +++ b/src/transactionwebhooks/model_transfer_data.go @@ -0,0 +1,155 @@ +/* +Transaction webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transactionwebhook + +import ( + "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferData{} + +// TransferData struct for TransferData +type TransferData struct { + // The ID of the resource. + Id *string `json:"id,omitempty"` + // The [`reference`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_reference) from the `/transfers` request. If you haven't provided any, Adyen generates a unique reference. + Reference string `json:"reference"` +} + +// NewTransferData instantiates a new TransferData 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 NewTransferData(reference string) *TransferData { + this := TransferData{} + this.Reference = reference + return &this +} + +// NewTransferDataWithDefaults instantiates a new TransferData 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 NewTransferDataWithDefaults() *TransferData { + this := TransferData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransferData) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransferData) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransferData) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value +func (o *TransferData) GetReference() string { + if o == nil { + var ret string + return ret + } + + return o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value +// and a boolean to check if the value has been set. +func (o *TransferData) GetReferenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reference, true +} + +// SetReference sets field value +func (o *TransferData) SetReference(v string) { + o.Reference = v +} + +func (o TransferData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["reference"] = o.Reference + return toSerialize, nil +} + +type NullableTransferData struct { + value *TransferData + isSet bool +} + +func (v NullableTransferData) Get() *TransferData { + return v.value +} + +func (v *NullableTransferData) Set(val *TransferData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferData(val *TransferData) *NullableTransferData { + return &NullableTransferData{value: val, isSet: true} +} + +func (v NullableTransferData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transfers/api_capital.go b/src/transfers/api_capital.go index 41089182b..0244f903e 100644 --- a/src/transfers/api_capital.go +++ b/src/transfers/api_capital.go @@ -10,13 +10,10 @@ package transfers import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // CapitalApi service @@ -33,13 +30,15 @@ func (r CapitalApiGetCapitalAccountInput) CounterpartyAccountHolderId(counterpar return r } + /* Prepare a request for GetCapitalAccount @return CapitalApiGetCapitalAccountInput */ func (a *CapitalApi) GetCapitalAccountInput() CapitalApiGetCapitalAccountInput { - return CapitalApiGetCapitalAccountInput{} + return CapitalApiGetCapitalAccountInput{ + } } /* @@ -52,86 +51,88 @@ Returns a list of grants with status and outstanding balances. @return CapitalGrants, *http.Response, error */ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapitalAccountInput) (CapitalGrants, *http.Response, error) { - res := &CapitalGrants{} + res := &CapitalGrants{} path := "/grants" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.counterpartyAccountHolderId != nil { - common.ParameterAddToQuery(queryParams, "counterpartyAccountHolderId", r.counterpartyAccountHolderId, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 404 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.counterpartyAccountHolderId != nil { + common.ParameterAddToQuery(queryParams, "counterpartyAccountHolderId", r.counterpartyAccountHolderId, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 404 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by CapitalApi.GetGrantReferenceDetails type CapitalApiGetGrantReferenceDetailsInput struct { id string } + /* Prepare a request for GetGrantReferenceDetails @param id The unique identifier of the grant. @@ -153,79 +154,80 @@ Returns the details of a capital account specified in the path. @return CapitalGrant, *http.Response, error */ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiGetGrantReferenceDetailsInput) (CapitalGrant, *http.Response, error) { - res := &CapitalGrant{} + res := &CapitalGrant{} path := "/grants/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 404 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 404 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by CapitalApi.RequestGrantPayout type CapitalApiRequestGrantPayoutInput struct { capitalGrantInfo *CapitalGrantInfo @@ -236,13 +238,15 @@ func (r CapitalApiRequestGrantPayoutInput) CapitalGrantInfo(capitalGrantInfo Cap return r } + /* Prepare a request for RequestGrantPayout @return CapitalApiRequestGrantPayoutInput */ func (a *CapitalApi) RequestGrantPayoutInput() CapitalApiRequestGrantPayoutInput { - return CapitalApiRequestGrantPayoutInput{} + return CapitalApiRequestGrantPayoutInput{ + } } /* @@ -255,74 +259,75 @@ Requests the payout of the selected grant offer. @return CapitalGrant, *http.Response, error */ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequestGrantPayoutInput) (CapitalGrant, *http.Response, error) { - res := &CapitalGrant{} + res := &CapitalGrant{} path := "/grants" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.capitalGrantInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 404 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.capitalGrantInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 400 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 404 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go index 8cc6ad2a2..5fa4e9377 100644 --- a/src/transfers/api_transactions.go +++ b/src/transfers/api_transactions.go @@ -10,14 +10,10 @@ package transfers import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TransactionsApi service @@ -25,14 +21,14 @@ type TransactionsApi common.Service // All parameters accepted by TransactionsApi.GetAllTransactions type TransactionsApiGetAllTransactionsInput struct { - createdSince *time.Time - createdUntil *time.Time - balancePlatform *string + createdSince *time.Time + createdUntil *time.Time + balancePlatform *string paymentInstrumentId *string - accountHolderId *string - balanceAccountId *string - cursor *string - limit *int32 + accountHolderId *string + balanceAccountId *string + cursor *string + limit *int32 } // Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. @@ -83,13 +79,15 @@ func (r TransactionsApiGetAllTransactionsInput) Limit(limit int32) TransactionsA return r } + /* Prepare a request for GetAllTransactions @return TransactionsApiGetAllTransactionsInput */ func (a *TransactionsApi) GetAllTransactionsInput() TransactionsApiGetAllTransactionsInput { - return TransactionsApiGetAllTransactionsInput{} + return TransactionsApiGetAllTransactionsInput{ + } } /* @@ -113,91 +111,93 @@ This endpoint supports cursor-based pagination. The response returns the first p @return TransactionSearchResponse, *http.Response, error */ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r TransactionsApiGetAllTransactionsInput) (TransactionSearchResponse, *http.Response, error) { - res := &TransactionSearchResponse{} + res := &TransactionSearchResponse{} path := "/transactions" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.balancePlatform != nil { - common.ParameterAddToQuery(queryParams, "balancePlatform", r.balancePlatform, "") - } - if r.paymentInstrumentId != nil { - common.ParameterAddToQuery(queryParams, "paymentInstrumentId", r.paymentInstrumentId, "") - } - if r.accountHolderId != nil { - common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") - } - if r.balanceAccountId != nil { - common.ParameterAddToQuery(queryParams, "balanceAccountId", r.balanceAccountId, "") - } - if r.cursor != nil { - common.ParameterAddToQuery(queryParams, "cursor", r.cursor, "") - } - if r.createdSince != nil { - common.ParameterAddToQuery(queryParams, "createdSince", r.createdSince, "") - } - if r.createdUntil != nil { - common.ParameterAddToQuery(queryParams, "createdUntil", r.createdUntil, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.balancePlatform != nil { + common.ParameterAddToQuery(queryParams, "balancePlatform", r.balancePlatform, "") + } + if r.paymentInstrumentId != nil { + common.ParameterAddToQuery(queryParams, "paymentInstrumentId", r.paymentInstrumentId, "") + } + if r.accountHolderId != nil { + common.ParameterAddToQuery(queryParams, "accountHolderId", r.accountHolderId, "") + } + if r.balanceAccountId != nil { + common.ParameterAddToQuery(queryParams, "balanceAccountId", r.balanceAccountId, "") + } + if r.cursor != nil { + common.ParameterAddToQuery(queryParams, "cursor", r.cursor, "") + } + if r.createdSince != nil { + common.ParameterAddToQuery(queryParams, "createdSince", r.createdSince, "") + } + if r.createdUntil != nil { + common.ParameterAddToQuery(queryParams, "createdUntil", r.createdUntil, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TransactionsApi.GetTransaction type TransactionsApiGetTransactionInput struct { id string } + /* Prepare a request for GetTransaction @param id Unique identifier of the transaction. @@ -221,59 +221,60 @@ Returns a transaction. @return Transaction, *http.Response, error */ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiGetTransactionInput) (Transaction, *http.Response, error) { - res := &Transaction{} + res := &Transaction{} path := "/transactions/{id}" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - nil, - res, - http.MethodGet, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go index 5a10065c4..1ecdede15 100644 --- a/src/transfers/api_transfers.go +++ b/src/transfers/api_transfers.go @@ -10,13 +10,10 @@ package transfers import ( "context" - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "net/http" + "net/url" + "strings" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // TransfersApi service @@ -24,7 +21,7 @@ type TransfersApi common.Service // All parameters accepted by TransfersApi.ReturnTransfer type TransfersApiReturnTransferInput struct { - id string + id string returnTransferRequest *ReturnTransferRequest } @@ -33,6 +30,7 @@ func (r TransfersApiReturnTransferInput) ReturnTransferRequest(returnTransferReq return r } + /* Prepare a request for ReturnTransfer @param id The unique identifier of the transfer to be returned. @@ -54,67 +52,68 @@ Returns previously transferred funds without creating a new `transferId`. @return ReturnTransferResponse, *http.Response, error */ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnTransferInput) (ReturnTransferResponse, *http.Response, error) { - res := &ReturnTransferResponse{} + res := &ReturnTransferResponse{} path := "/transfers/{id}/returns" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.returnTransferRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.returnTransferRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + // All parameters accepted by TransfersApi.TransferFunds type TransfersApiTransferFundsInput struct { wWWAuthenticate *string - transferInfo *TransferInfo + transferInfo *TransferInfo } // Header for authenticating through SCA @@ -128,13 +127,15 @@ func (r TransfersApiTransferFundsInput) TransferInfo(transferInfo TransferInfo) return r } + /* Prepare a request for TransferFunds @return TransfersApiTransferFundsInput */ func (a *TransfersApi) TransferFundsInput() TransfersApiTransferFundsInput { - return TransfersApiTransferFundsInput{} + return TransfersApiTransferFundsInput{ + } } /* @@ -151,61 +152,62 @@ To use this endpoint, you need an additional role for your API credential and tr @return Transfer, *http.Response, error */ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransferFundsInput) (Transfer, *http.Response, error) { - res := &Transfer{} + res := &Transfer{} path := "/transfers" - queryParams := url.Values{} - headerParams := make(map[string]string) - if r.wWWAuthenticate != nil { - common.ParameterAddToHeaderOrQuery(headerParams, "WWW-Authenticate", r.wWWAuthenticate, "") - } - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.transferInfo, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - if httpRes == nil { - return *res, httpRes, err - } - - var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 403 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 422 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - if httpRes.StatusCode == 500 { - body, _ := ioutil.ReadAll(httpRes.Body) - decodeError := json.Unmarshal([]byte(body), &serviceError) - if decodeError != nil { - return *res, httpRes, decodeError - } - return *res, httpRes, serviceError - } - - return *res, httpRes, err + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.wWWAuthenticate != nil { + common.ParameterAddToHeaderOrQuery(headerParams, "WWW-Authenticate", r.wWWAuthenticate, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.transferInfo, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err } + diff --git a/src/transfers/model_additional_bank_identification.go b/src/transfers/model_additional_bank_identification.go index 2849b47cb..80942f3d3 100644 --- a/src/transfers/model_additional_bank_identification.go +++ b/src/transfers/model_additional_bank_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *AdditionalBankIdentification) SetType(v string) { } func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -161,12 +160,14 @@ func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AdditionalBankIdentification) isValidType() bool { - var allowedEnumValues = []string{"gbSortCode", "usRoutingNumber"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_address.go b/src/transfers/model_address.go index 56f218900..7e931a5fc 100644 --- a/src/transfers/model_address.go +++ b/src/transfers/model_address.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Address type satisfies the MappedNullable interface at compile time @@ -236,7 +235,7 @@ func (o *Address) SetStateOrProvince(v string) { } func (o Address) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -299,3 +298,6 @@ func (v *NullableAddress) 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 3f95599eb..9ac3fba79 100644 --- a/src/transfers/model_amount.go +++ b/src/transfers/model_amount.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Amount type satisfies the MappedNullable interface at compile time @@ -93,7 +92,7 @@ func (o *Amount) SetValue(v int64) { } func (o Amount) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -142,3 +141,6 @@ func (v *NullableAmount) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_au_local_account_identification.go b/src/transfers/model_au_local_account_identification.go index 67eefd427..0033d6edc 100644 --- a/src/transfers/model_au_local_account_identification.go +++ b/src/transfers/model_au_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *AULocalAccountIdentification) SetType(v string) { } func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *AULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"auLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_bank_account_v3.go b/src/transfers/model_bank_account_v3.go index 089c3f51b..c4d0d3d44 100644 --- a/src/transfers/model_bank_account_v3.go +++ b/src/transfers/model_bank_account_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankAccountV3 type satisfies the MappedNullable interface at compile time @@ -19,7 +18,7 @@ var _ common.MappedNullable = &BankAccountV3{} // BankAccountV3 struct for BankAccountV3 type BankAccountV3 struct { - AccountHolder PartyIdentification `json:"accountHolder"` + AccountHolder PartyIdentification `json:"accountHolder"` AccountIdentification BankAccountV3AccountIdentification `json:"accountIdentification"` } @@ -91,7 +90,7 @@ func (o *BankAccountV3) SetAccountIdentification(v BankAccountV3AccountIdentific } func (o BankAccountV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -140,3 +139,6 @@ func (v *NullableBankAccountV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_bank_account_v3_account_identification.go b/src/transfers/model_bank_account_v3_account_identification.go index 6fed77b5c..12d92b6c5 100644 --- a/src/transfers/model_bank_account_v3_account_identification.go +++ b/src/transfers/model_bank_account_v3_account_identification.go @@ -10,27 +10,28 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // BankAccountV3AccountIdentification - Contains the bank account details. The fields required in this object depend on the country of the bank account and the currency of the transfer. type BankAccountV3AccountIdentification struct { - AULocalAccountIdentification *AULocalAccountIdentification - BRLocalAccountIdentification *BRLocalAccountIdentification - CALocalAccountIdentification *CALocalAccountIdentification - CZLocalAccountIdentification *CZLocalAccountIdentification - DKLocalAccountIdentification *DKLocalAccountIdentification - HKLocalAccountIdentification *HKLocalAccountIdentification - HULocalAccountIdentification *HULocalAccountIdentification - IbanAccountIdentification *IbanAccountIdentification - NOLocalAccountIdentification *NOLocalAccountIdentification - NZLocalAccountIdentification *NZLocalAccountIdentification + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification - PLLocalAccountIdentification *PLLocalAccountIdentification - SELocalAccountIdentification *SELocalAccountIdentification - SGLocalAccountIdentification *SGLocalAccountIdentification - UKLocalAccountIdentification *UKLocalAccountIdentification - USLocalAccountIdentification *USLocalAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification } // AULocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountV3AccountIdentification @@ -145,6 +146,7 @@ func USLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *USLocal } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error { var err error @@ -155,7 +157,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct dst.AULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -168,7 +170,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct dst.BRLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -181,7 +183,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct dst.CALocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -194,7 +196,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct dst.CZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -207,7 +209,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct dst.DKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -220,7 +222,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct dst.HKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -233,7 +235,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct dst.HULocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -246,7 +248,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct dst.IbanAccountIdentification = nil - } else { + } else { match++ } } else { @@ -259,7 +261,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct dst.NOLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -272,7 +274,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct dst.NZLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -285,7 +287,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct dst.NumberAndBicAccountIdentification = nil - } else { + } else { match++ } } else { @@ -298,7 +300,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct dst.PLLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -311,7 +313,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct dst.SELocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -324,7 +326,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct dst.SGLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -337,7 +339,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct dst.UKLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -350,7 +352,7 @@ func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct dst.USLocalAccountIdentification = nil - } else { + } else { match++ } } else { @@ -454,7 +456,7 @@ func (src BankAccountV3AccountIdentification) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *BankAccountV3AccountIdentification) GetActualInstance() interface{} { +func (obj *BankAccountV3AccountIdentification) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -561,3 +563,5 @@ func (v *NullableBankAccountV3AccountIdentification) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/transfers/model_bank_category_data.go b/src/transfers/model_bank_category_data.go index 2d5aabef1..8b1217403 100644 --- a/src/transfers/model_bank_category_data.go +++ b/src/transfers/model_bank_category_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BankCategoryData type satisfies the MappedNullable interface at compile time @@ -111,7 +110,7 @@ func (o *BankCategoryData) SetType(v string) { } func (o BankCategoryData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -165,21 +164,23 @@ func (v *NullableBankCategoryData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BankCategoryData) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "crossBorder", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } func (o *BankCategoryData) isValidType() bool { - var allowedEnumValues = []string{"bank"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_br_local_account_identification.go b/src/transfers/model_br_local_account_identification.go index 5f7b7ed19..f19adc55a 100644 --- a/src/transfers/model_br_local_account_identification.go +++ b/src/transfers/model_br_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the BRLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -149,7 +148,7 @@ func (o *BRLocalAccountIdentification) SetType(v string) { } func (o BRLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -201,12 +200,14 @@ func (v *NullableBRLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *BRLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"brLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "brLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_ca_local_account_identification.go b/src/transfers/model_ca_local_account_identification.go index 59271462c..fa2e952e0 100644 --- a/src/transfers/model_ca_local_account_identification.go +++ b/src/transfers/model_ca_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -187,7 +186,7 @@ func (o *CALocalAccountIdentification) SetType(v string) { } func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -242,21 +241,23 @@ func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CALocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *CALocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"caLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_capital_balance.go b/src/transfers/model_capital_balance.go index af4f122ba..2e09db2e0 100644 --- a/src/transfers/model_capital_balance.go +++ b/src/transfers/model_capital_balance.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalBalance type satisfies the MappedNullable interface at compile time @@ -147,7 +146,7 @@ func (o *CapitalBalance) SetTotal(v int64) { } func (o CapitalBalance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -198,3 +197,6 @@ func (v *NullableCapitalBalance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_capital_grant.go b/src/transfers/model_capital_grant.go index 61f90a5c7..f88efdcd2 100644 --- a/src/transfers/model_capital_grant.go +++ b/src/transfers/model_capital_grant.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalGrant type satisfies the MappedNullable interface at compile time @@ -19,16 +18,16 @@ var _ common.MappedNullable = &CapitalGrant{} // CapitalGrant struct for CapitalGrant type CapitalGrant struct { - Amount *Amount `json:"amount,omitempty"` - Balances CapitalBalance `json:"balances"` - Counterparty *Counterparty `json:"counterparty,omitempty"` - Fee *Fee `json:"fee,omitempty"` + Amount *Amount `json:"amount,omitempty"` + Balances CapitalBalance `json:"balances"` + Counterparty *Counterparty `json:"counterparty,omitempty"` + Fee *Fee `json:"fee,omitempty"` // The identifier of the grant account used for the grant. GrantAccountId string `json:"grantAccountId"` // The identifier of the grant offer that has been selected and from which the grant details will be used. GrantOfferId string `json:"grantOfferId"` // The identifier of the grant reference. - Id string `json:"id"` + Id string `json:"id"` Repayment *Repayment `json:"repayment,omitempty"` // The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. Status string `json:"status"` @@ -305,7 +304,7 @@ func (o *CapitalGrant) SetStatus(v string) { } func (o CapitalGrant) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -370,12 +369,14 @@ func (v *NullableCapitalGrant) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CapitalGrant) isValidStatus() bool { - var allowedEnumValues = []string{"Pending", "Active", "Repaid"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Pending", "Active", "Repaid" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_capital_grant_info.go b/src/transfers/model_capital_grant_info.go index a91aa4afe..93e4f3455 100644 --- a/src/transfers/model_capital_grant_info.go +++ b/src/transfers/model_capital_grant_info.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalGrantInfo type satisfies the MappedNullable interface at compile time @@ -126,7 +125,7 @@ func (o *CapitalGrantInfo) SetGrantOfferId(v string) { } func (o CapitalGrantInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -178,3 +177,6 @@ func (v *NullableCapitalGrantInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_capital_grants.go b/src/transfers/model_capital_grants.go index 49827278d..98f72f1e2 100644 --- a/src/transfers/model_capital_grants.go +++ b/src/transfers/model_capital_grants.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CapitalGrants type satisfies the MappedNullable interface at compile time @@ -66,7 +65,7 @@ func (o *CapitalGrants) SetGrants(v []CapitalGrant) { } func (o CapitalGrants) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -114,3 +113,6 @@ func (v *NullableCapitalGrants) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_counterparty.go b/src/transfers/model_counterparty.go index 94fa07462..7e98e25c2 100644 --- a/src/transfers/model_counterparty.go +++ b/src/transfers/model_counterparty.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Counterparty type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *Counterparty) SetTransferInstrumentId(v string) { } func (o Counterparty) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableCounterparty) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_counterparty_info_v3.go b/src/transfers/model_counterparty_info_v3.go index adf7d2876..74930254a 100644 --- a/src/transfers/model_counterparty_info_v3.go +++ b/src/transfers/model_counterparty_info_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CounterpartyInfoV3 type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &CounterpartyInfoV3{} // CounterpartyInfoV3 struct for CounterpartyInfoV3 type CounterpartyInfoV3 struct { // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } @@ -140,7 +139,7 @@ func (o *CounterpartyInfoV3) SetTransferInstrumentId(v string) { } func (o CounterpartyInfoV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -196,3 +195,6 @@ func (v *NullableCounterpartyInfoV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_counterparty_v3.go b/src/transfers/model_counterparty_v3.go index cc0adc150..bd27adb8b 100644 --- a/src/transfers/model_counterparty_v3.go +++ b/src/transfers/model_counterparty_v3.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CounterpartyV3 type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &CounterpartyV3{} // CounterpartyV3 struct for CounterpartyV3 type CounterpartyV3 struct { // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - BalanceAccountId *string `json:"balanceAccountId,omitempty"` - BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` - Merchant *MerchantData `json:"merchant,omitempty"` + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + Merchant *MerchantData `json:"merchant,omitempty"` // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` } @@ -173,7 +172,7 @@ func (o *CounterpartyV3) SetTransferInstrumentId(v string) { } func (o CounterpartyV3) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -232,3 +231,6 @@ func (v *NullableCounterpartyV3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_cz_local_account_identification.go b/src/transfers/model_cz_local_account_identification.go index 5274bb0ef..a55a0b8c8 100644 --- a/src/transfers/model_cz_local_account_identification.go +++ b/src/transfers/model_cz_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *CZLocalAccountIdentification) SetType(v string) { } func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *CZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"czLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_dk_local_account_identification.go b/src/transfers/model_dk_local_account_identification.go index 0e0494f7d..58114f2da 100644 --- a/src/transfers/model_dk_local_account_identification.go +++ b/src/transfers/model_dk_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *DKLocalAccountIdentification) SetType(v string) { } func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *DKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"dkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_fee.go b/src/transfers/model_fee.go index 02735cbd3..c88f6663b 100644 --- a/src/transfers/model_fee.go +++ b/src/transfers/model_fee.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Fee type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *Fee) SetAmount(v Amount) { } func (o Fee) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableFee) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_hk_local_account_identification.go b/src/transfers/model_hk_local_account_identification.go index 649c94b5c..eba9dc2bd 100644 --- a/src/transfers/model_hk_local_account_identification.go +++ b/src/transfers/model_hk_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *HKLocalAccountIdentification) SetType(v string) { } func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableHKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"hkLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "hkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_hu_local_account_identification.go b/src/transfers/model_hu_local_account_identification.go index e45c841ff..e75eeb93b 100644 --- a/src/transfers/model_hu_local_account_identification.go +++ b/src/transfers/model_hu_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *HULocalAccountIdentification) SetType(v string) { } func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *HULocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"huLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_iban_account_identification.go b/src/transfers/model_iban_account_identification.go index 6fd28c68b..78f2086db 100644 --- a/src/transfers/model_iban_account_identification.go +++ b/src/transfers/model_iban_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *IbanAccountIdentification) SetType(v string) { } func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IbanAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"iban"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_internal_category_data.go b/src/transfers/model_internal_category_data.go index 9e2a06584..6d044039d 100644 --- a/src/transfers/model_internal_category_data.go +++ b/src/transfers/model_internal_category_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InternalCategoryData type satisfies the MappedNullable interface at compile time @@ -145,7 +144,7 @@ func (o *InternalCategoryData) SetType(v string) { } func (o InternalCategoryData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -202,12 +201,14 @@ func (v *NullableInternalCategoryData) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *InternalCategoryData) isValidType() bool { - var allowedEnumValues = []string{"internal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "internal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_invalid_field.go b/src/transfers/model_invalid_field.go index 1ad526f8c..125c92450 100644 --- a/src/transfers/model_invalid_field.go +++ b/src/transfers/model_invalid_field.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the InvalidField type satisfies the MappedNullable interface at compile time @@ -120,7 +119,7 @@ func (o *InvalidField) SetValue(v string) { } func (o InvalidField) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -170,3 +169,6 @@ func (v *NullableInvalidField) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_issued_card.go b/src/transfers/model_issued_card.go index 9037fdc3c..900b4eeef 100644 --- a/src/transfers/model_issued_card.go +++ b/src/transfers/model_issued_card.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the IssuedCard type satisfies the MappedNullable interface at compile time @@ -22,7 +21,7 @@ type IssuedCard struct { // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. PanEntryMode *string `json:"panEntryMode,omitempty"` // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. - ProcessingType *string `json:"processingType,omitempty"` + ProcessingType *string `json:"processingType,omitempty"` RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` // **issuedCard** Type *string `json:"type,omitempty"` @@ -212,7 +211,7 @@ func (o *IssuedCard) SetValidationFacts(v []TransferNotificationValidationFact) } func (o IssuedCard) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -275,30 +274,32 @@ func (v *NullableIssuedCard) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *IssuedCard) isValidPanEntryMode() bool { - var allowedEnumValues = []string{"chip", "cof", "contactless", "ecommerce", "magstripe", "manual", "token"} - for _, allowed := range allowedEnumValues { - if o.GetPanEntryMode() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "chip", "cof", "contactless", "ecommerce", "magstripe", "manual", "token" } + for _, allowed := range allowedEnumValues { + if o.GetPanEntryMode() == allowed { + return true + } + } + return false } func (o *IssuedCard) isValidProcessingType() bool { - var allowedEnumValues = []string{"atmWithdraw", "balanceInquiry", "ecommerce", "moto", "pos", "purchaseWithCashback", "recurring", "token"} - for _, allowed := range allowedEnumValues { - if o.GetProcessingType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "atmWithdraw", "balanceInquiry", "ecommerce", "moto", "pos", "purchaseWithCashback", "recurring", "token" } + for _, allowed := range allowedEnumValues { + if o.GetProcessingType() == allowed { + return true + } + } + return false } func (o *IssuedCard) isValidType() bool { - var allowedEnumValues = []string{"issuedCard"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "issuedCard" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_link.go b/src/transfers/model_link.go index f771a4189..9acd76024 100644 --- a/src/transfers/model_link.go +++ b/src/transfers/model_link.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Link type satisfies the MappedNullable interface at compile time @@ -72,7 +71,7 @@ func (o *Link) SetHref(v string) { } func (o Link) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -122,3 +121,6 @@ func (v *NullableLink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_links.go b/src/transfers/model_links.go index 1a7e5e2ec..06ab979f0 100644 --- a/src/transfers/model_links.go +++ b/src/transfers/model_links.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Links type satisfies the MappedNullable interface at compile time @@ -105,7 +104,7 @@ func (o *Links) SetPrev(v Link) { } func (o Links) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -158,3 +157,6 @@ func (v *NullableLinks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_merchant_data.go b/src/transfers/model_merchant_data.go index ff93aaac1..b199b0bc4 100644 --- a/src/transfers/model_merchant_data.go +++ b/src/transfers/model_merchant_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the MerchantData type satisfies the MappedNullable interface at compile time @@ -24,7 +23,7 @@ type MerchantData struct { // The merchant category code. Mcc *string `json:"mcc,omitempty"` // The merchant identifier. - MerchantId *string `json:"merchantId,omitempty"` + MerchantId *string `json:"merchantId,omitempty"` NameLocation *NameLocation `json:"nameLocation,omitempty"` // The merchant postal code. PostalCode *string `json:"postalCode,omitempty"` @@ -208,7 +207,7 @@ func (o *MerchantData) SetPostalCode(v string) { } func (o MerchantData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -270,3 +269,6 @@ func (v *NullableMerchantData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_name_location.go b/src/transfers/model_name_location.go index f3d3c2bff..94a18f278 100644 --- a/src/transfers/model_name_location.go +++ b/src/transfers/model_name_location.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NameLocation type satisfies the MappedNullable interface at compile time @@ -243,7 +242,7 @@ func (o *NameLocation) SetState(v string) { } func (o NameLocation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -308,3 +307,6 @@ func (v *NullableNameLocation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_no_local_account_identification.go b/src/transfers/model_no_local_account_identification.go index d062a75ee..6c6296766 100644 --- a/src/transfers/model_no_local_account_identification.go +++ b/src/transfers/model_no_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NOLocalAccountIdentification) SetType(v string) { } func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NOLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"noLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_number_and_bic_account_identification.go b/src/transfers/model_number_and_bic_account_identification.go index aa14fe415..5e0a839a8 100644 --- a/src/transfers/model_number_and_bic_account_identification.go +++ b/src/transfers/model_number_and_bic_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &NumberAndBicAccountIdentification{} // NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification type NumberAndBicAccountIdentification struct { // The bank account number, without separators or whitespace. The length and format depends on the bank or country. - AccountNumber string `json:"accountNumber"` + AccountNumber string `json:"accountNumber"` AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` // The bank's 8- or 11-character BIC or SWIFT code. Bic string `json:"bic"` @@ -155,7 +154,7 @@ func (o *NumberAndBicAccountIdentification) SetType(v string) { } func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -209,12 +208,14 @@ func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) er return json.Unmarshal(src, &v.value) } + func (o *NumberAndBicAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"numberAndBic"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_nz_local_account_identification.go b/src/transfers/model_nz_local_account_identification.go index 6c6278aaa..6be2ddc89 100644 --- a/src/transfers/model_nz_local_account_identification.go +++ b/src/transfers/model_nz_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *NZLocalAccountIdentification) SetType(v string) { } func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *NZLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"nzLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "nzLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_party_identification.go b/src/transfers/model_party_identification.go index b4ed1caca..c59e01a0a 100644 --- a/src/transfers/model_party_identification.go +++ b/src/transfers/model_party_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PartyIdentification type satisfies the MappedNullable interface at compile time @@ -273,7 +272,7 @@ func (o *PartyIdentification) SetType(v string) { } func (o PartyIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -340,12 +339,14 @@ func (v *NullablePartyIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PartyIdentification) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_payment_instrument.go b/src/transfers/model_payment_instrument.go index 755e27268..88dc3ef3b 100644 --- a/src/transfers/model_payment_instrument.go +++ b/src/transfers/model_payment_instrument.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *PaymentInstrument) SetTokenType(v string) { } func (o PaymentInstrument) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -234,3 +233,6 @@ func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_pl_local_account_identification.go b/src/transfers/model_pl_local_account_identification.go index dd8f5669f..640316db7 100644 --- a/src/transfers/model_pl_local_account_identification.go +++ b/src/transfers/model_pl_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -95,7 +94,7 @@ func (o *PLLocalAccountIdentification) SetType(v string) { } func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -145,12 +144,14 @@ func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PLLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"plLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "plLocal" } + 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 fb7502371..b98646078 100644 --- a/src/transfers/model_platform_payment.go +++ b/src/transfers/model_platform_payment.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the PlatformPayment type satisfies the MappedNullable interface at compile time @@ -247,7 +246,7 @@ func (o *PlatformPayment) SetType(v string) { } func (o PlatformPayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -313,21 +312,23 @@ func (v *NullablePlatformPayment) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *PlatformPayment) isValidPlatformPaymentType() bool { - var allowedEnumValues = []string{"AcquiringFees", "AdyenCommission", "AdyenFees", "AdyenMarkup", "BalanceAccount", "Commission", "Default", "Interchange", "PaymentFee", "Remainder", "SchemeFee", "TopUp", "VAT"} - for _, allowed := range allowedEnumValues { - if o.GetPlatformPaymentType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "AcquiringFees", "AdyenCommission", "AdyenFees", "AdyenMarkup", "BalanceAccount", "Commission", "Default", "Interchange", "PaymentFee", "Remainder", "SchemeFee", "TopUp", "VAT" } + for _, allowed := range allowedEnumValues { + if o.GetPlatformPaymentType() == allowed { + return true + } + } + return false } func (o *PlatformPayment) isValidType() bool { - var allowedEnumValues = []string{"platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_relayed_authorisation_data.go b/src/transfers/model_relayed_authorisation_data.go index 611e82b55..7cbb1ceea 100644 --- a/src/transfers/model_relayed_authorisation_data.go +++ b/src/transfers/model_relayed_authorisation_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RelayedAuthorisationData type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *RelayedAuthorisationData) SetReference(v string) { } func (o RelayedAuthorisationData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableRelayedAuthorisationData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_repayment.go b/src/transfers/model_repayment.go index d679df965..3f4af875a 100644 --- a/src/transfers/model_repayment.go +++ b/src/transfers/model_repayment.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Repayment type satisfies the MappedNullable interface at compile time @@ -20,9 +19,9 @@ var _ common.MappedNullable = &Repayment{} // Repayment struct for Repayment type Repayment struct { // The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - BasisPoints int32 `json:"basisPoints"` - Term *RepaymentTerm `json:"term,omitempty"` - Threshold *ThresholdRepayment `json:"threshold,omitempty"` + BasisPoints int32 `json:"basisPoints"` + Term *RepaymentTerm `json:"term,omitempty"` + Threshold *ThresholdRepayment `json:"threshold,omitempty"` } // NewRepayment instantiates a new Repayment object @@ -132,7 +131,7 @@ func (o *Repayment) SetThreshold(v ThresholdRepayment) { } func (o Repayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -186,3 +185,6 @@ func (v *NullableRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_repayment_term.go b/src/transfers/model_repayment_term.go index 8aca5b777..f55ea81c2 100644 --- a/src/transfers/model_repayment_term.go +++ b/src/transfers/model_repayment_term.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RepaymentTerm type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *RepaymentTerm) SetMaximumDays(v int32) { } func (o RepaymentTerm) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableRepaymentTerm) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_resource_reference.go b/src/transfers/model_resource_reference.go index f35d8822c..ad59a33bd 100644 --- a/src/transfers/model_resource_reference.go +++ b/src/transfers/model_resource_reference.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ResourceReference type satisfies the MappedNullable interface at compile time @@ -141,7 +140,7 @@ func (o *ResourceReference) SetReference(v string) { } func (o ResourceReference) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -197,3 +196,6 @@ func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_rest_service_error.go b/src/transfers/model_rest_service_error.go index 0e636d74d..c470a42df 100644 --- a/src/transfers/model_rest_service_error.go +++ b/src/transfers/model_rest_service_error.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the RestServiceError type satisfies the MappedNullable interface at compile time @@ -310,7 +309,7 @@ func (o *RestServiceError) SetType(v string) { } func (o RestServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -374,3 +373,6 @@ func (v *NullableRestServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_return_transfer_request.go b/src/transfers/model_return_transfer_request.go index 74bcd3f79..685bd3cdb 100644 --- a/src/transfers/model_return_transfer_request.go +++ b/src/transfers/model_return_transfer_request.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ReturnTransferRequest type satisfies the MappedNullable interface at compile time @@ -20,7 +19,7 @@ var _ common.MappedNullable = &ReturnTransferRequest{} // ReturnTransferRequest struct for ReturnTransferRequest type ReturnTransferRequest struct { Amount Amount `json:"amount"` - // Your internal reference for the return. If you don't provide this in the request, Adyen generates a unique reference. This reference is used in all communication with you about the instruction status. We recommend using a unique value per instruction. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). + // Your internal reference for the return. If you don't provide this in the request, Adyen generates a unique reference. This reference is used in all communication with you about the instruction status. We recommend using a unique value per instruction. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Reference *string `json:"reference,omitempty"` } @@ -99,7 +98,7 @@ func (o *ReturnTransferRequest) SetReference(v string) { } func (o ReturnTransferRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -150,3 +149,6 @@ func (v *NullableReturnTransferRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_return_transfer_response.go b/src/transfers/model_return_transfer_response.go index 7de4c37bf..2fc8c81f3 100644 --- a/src/transfers/model_return_transfer_response.go +++ b/src/transfers/model_return_transfer_response.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ReturnTransferResponse type satisfies the MappedNullable interface at compile time @@ -175,7 +174,7 @@ func (o *ReturnTransferResponse) SetTransferId(v string) { } func (o ReturnTransferResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -235,12 +234,14 @@ func (v *NullableReturnTransferResponse) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *ReturnTransferResponse) isValidStatus() bool { - var allowedEnumValues = []string{"Authorised", "Declined"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "Authorised", "Declined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_se_local_account_identification.go b/src/transfers/model_se_local_account_identification.go index 4c6b2a357..da9611cf1 100644 --- a/src/transfers/model_se_local_account_identification.go +++ b/src/transfers/model_se_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *SELocalAccountIdentification) SetType(v string) { } func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SELocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"seLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_service_error.go b/src/transfers/model_service_error.go index 6187b7d3e..b0e1a3b94 100644 --- a/src/transfers/model_service_error.go +++ b/src/transfers/model_service_error.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ServiceError type satisfies the MappedNullable interface at compile time @@ -209,7 +208,7 @@ func (o *ServiceError) SetStatus(v int32) { } func (o ServiceError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -271,3 +270,6 @@ func (v *NullableServiceError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_sg_local_account_identification.go b/src/transfers/model_sg_local_account_identification.go index 4395eb6cf..237a77e69 100644 --- a/src/transfers/model_sg_local_account_identification.go +++ b/src/transfers/model_sg_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -131,7 +130,7 @@ func (o *SGLocalAccountIdentification) SetType(v string) { } func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -184,12 +183,14 @@ func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *SGLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"sgLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_threshold_repayment.go b/src/transfers/model_threshold_repayment.go index 1756c77b4..bb17bf63a 100644 --- a/src/transfers/model_threshold_repayment.go +++ b/src/transfers/model_threshold_repayment.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the ThresholdRepayment type satisfies the MappedNullable interface at compile time @@ -65,7 +64,7 @@ func (o *ThresholdRepayment) SetAmount(v Amount) { } func (o ThresholdRepayment) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -113,3 +112,6 @@ func (v *NullableThresholdRepayment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_transaction.go b/src/transfers/model_transaction.go index 848758961..41044ebe4 100644 --- a/src/transfers/model_transaction.go +++ b/src/transfers/model_transaction.go @@ -10,9 +10,8 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Transaction type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ common.MappedNullable = &Transaction{} // Transaction struct for Transaction type Transaction struct { - AccountHolder ResourceReference `json:"accountHolder"` - Amount Amount `json:"amount"` + AccountHolder ResourceReference `json:"accountHolder"` + Amount Amount `json:"amount"` BalanceAccount ResourceReference `json:"balanceAccount"` // The unique identifier of the balance platform. BalancePlatform string `json:"balancePlatform"` @@ -31,8 +30,8 @@ type Transaction struct { CreationDate *time.Time `json:"creationDate,omitempty"` // The unique identifier of the transaction. Id string `json:"id"` - // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. - Status string `json:"status"` + // The status of the transaction. Possible values: * **pending**: The transaction is still pending. * **booked**: The transaction has been booked to the balance account. + Status string `json:"status"` Transfer *TransferData `json:"transfer,omitempty"` // The date the transfer amount becomes available in the balance account. ValueDate time.Time `json:"valueDate"` @@ -320,7 +319,7 @@ func (o *Transaction) SetValueDate(v time.Time) { } func (o Transaction) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -382,12 +381,14 @@ func (v *NullableTransaction) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Transaction) isValidStatus() bool { - var allowedEnumValues = []string{"booked", "pending"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "booked", "pending" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transaction_search_response.go b/src/transfers/model_transaction_search_response.go index 7cfa40f92..4504ea6b7 100644 --- a/src/transfers/model_transaction_search_response.go +++ b/src/transfers/model_transaction_search_response.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransactionSearchResponse type satisfies the MappedNullable interface at compile time @@ -106,7 +105,7 @@ func (o *TransactionSearchResponse) SetData(v []Transaction) { } func (o TransactionSearchResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -159,3 +158,6 @@ func (v *NullableTransactionSearchResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_transfer.go b/src/transfers/model_transfer.go index 0d532f3aa..33ae4d3e9 100644 --- a/src/transfers/model_transfer.go +++ b/src/transfers/model_transfer.go @@ -10,9 +10,8 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "time" - - "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the Transfer type satisfies the MappedNullable interface at compile time @@ -20,13 +19,13 @@ var _ common.MappedNullable = &Transfer{} // Transfer struct for Transfer type Transfer struct { - AccountHolder *ResourceReference `json:"accountHolder,omitempty"` - Amount Amount `json:"amount"` + AccountHolder *ResourceReference `json:"accountHolder,omitempty"` + Amount Amount `json:"amount"` BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` // The category of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` + Category string `json:"category"` CategoryData *TransferCategoryData `json:"categoryData,omitempty"` - Counterparty CounterpartyV3 `json:"counterparty"` + Counterparty CounterpartyV3 `json:"counterparty"` // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. CreationDate *time.Time `json:"creationDate,omitempty"` // 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] & $ % # @** **~ = + - _ ' \" ! ?** @@ -34,7 +33,7 @@ type Transfer struct { // The direction of the transfer. Possible values: **incoming**, **outgoing**. Direction *string `json:"direction,omitempty"` // The ID of the resource. - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` // Additional information about the status of the transfer. Reason *string `json:"reason,omitempty"` @@ -516,7 +515,7 @@ func (o *Transfer) SetStatus(v string) { } func (o Transfer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -601,39 +600,41 @@ func (v *NullableTransfer) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *Transfer) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "issuedCard", "platformPayment"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "issuedCard", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *Transfer) isValidDirection() bool { - var allowedEnumValues = []string{"incoming", "outgoing"} - for _, allowed := range allowedEnumValues { - if o.GetDirection() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "incoming", "outgoing" } + for _, allowed := range allowedEnumValues { + if o.GetDirection() == allowed { + return true + } + } + return false } func (o *Transfer) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetReason() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false } func (o *Transfer) isValidStatus() bool { - var allowedEnumValues = []string{"approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} - for _, allowed := range allowedEnumValues { - if o.GetStatus() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transfer_category_data.go b/src/transfers/model_transfer_category_data.go index 2bd14af25..87fe5994a 100644 --- a/src/transfers/model_transfer_category_data.go +++ b/src/transfers/model_transfer_category_data.go @@ -10,15 +10,16 @@ package transfers import ( "encoding/json" + "github.com/adyen/adyen-go-api-library/v8/src/common" "fmt" ) // TransferCategoryData - The relevant data according to the transfer category. type TransferCategoryData struct { - BankCategoryData *BankCategoryData + BankCategoryData *BankCategoryData InternalCategoryData *InternalCategoryData - IssuedCard *IssuedCard - PlatformPayment *PlatformPayment + IssuedCard *IssuedCard + PlatformPayment *PlatformPayment } // BankCategoryDataAsTransferCategoryData is a convenience function that returns BankCategoryData wrapped in TransferCategoryData @@ -49,6 +50,7 @@ func PlatformPaymentAsTransferCategoryData(v *PlatformPayment) TransferCategoryD } } + // Unmarshal JSON data into one of the pointers in the struct func (dst *TransferCategoryData) UnmarshalJSON(data []byte) error { var err error @@ -59,7 +61,7 @@ func (dst *TransferCategoryData) UnmarshalJSON(data []byte) error { jsonBankCategoryData, _ := json.Marshal(dst.BankCategoryData) if string(jsonBankCategoryData) == "{}" || !dst.BankCategoryData.isValidType() { // empty struct dst.BankCategoryData = nil - } else { + } else { match++ } } else { @@ -72,7 +74,7 @@ func (dst *TransferCategoryData) UnmarshalJSON(data []byte) error { jsonInternalCategoryData, _ := json.Marshal(dst.InternalCategoryData) if string(jsonInternalCategoryData) == "{}" || !dst.InternalCategoryData.isValidType() { // empty struct dst.InternalCategoryData = nil - } else { + } else { match++ } } else { @@ -85,7 +87,7 @@ func (dst *TransferCategoryData) UnmarshalJSON(data []byte) error { jsonIssuedCard, _ := json.Marshal(dst.IssuedCard) if string(jsonIssuedCard) == "{}" || !dst.IssuedCard.isValidType() { // empty struct dst.IssuedCard = nil - } else { + } else { match++ } } else { @@ -98,7 +100,7 @@ func (dst *TransferCategoryData) UnmarshalJSON(data []byte) error { jsonPlatformPayment, _ := json.Marshal(dst.PlatformPayment) if string(jsonPlatformPayment) == "{}" || !dst.PlatformPayment.isValidType() { // empty struct dst.PlatformPayment = nil - } else { + } else { match++ } } else { @@ -142,7 +144,7 @@ func (src TransferCategoryData) MarshalJSON() ([]byte, error) { } // Get the actual instance -func (obj *TransferCategoryData) GetActualInstance() interface{} { +func (obj *TransferCategoryData) GetActualInstance() (interface{}) { if obj == nil { return nil } @@ -201,3 +203,5 @@ func (v *NullableTransferCategoryData) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + + diff --git a/src/transfers/model_transfer_data.go b/src/transfers/model_transfer_data.go index 505030479..5c0674f32 100644 --- a/src/transfers/model_transfer_data.go +++ b/src/transfers/model_transfer_data.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferData type satisfies the MappedNullable interface at compile time @@ -100,7 +99,7 @@ func (o *TransferData) SetReference(v string) { } func (o TransferData) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -151,3 +150,6 @@ func (v *NullableTransferData) 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 53a86feae..0c241abe9 100644 --- a/src/transfers/model_transfer_info.go +++ b/src/transfers/model_transfer_info.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferInfo type satisfies the MappedNullable interface at compile time @@ -23,7 +22,7 @@ type TransferInfo struct { // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). BalanceAccountId *string `json:"balanceAccountId,omitempty"` // The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. - Category string `json:"category"` + 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] & $ % # @** **~ = + - _ ' \" ! ?** Description *string `json:"description,omitempty"` @@ -34,8 +33,8 @@ type TransferInfo struct { // Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. Reference *string `json:"reference,omitempty"` // A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. - ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` - UltimateParty *UltimatePartyIdentification `json:"ultimateParty,omitempty"` + ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` + UltimateParty *UltimatePartyIdentification `json:"ultimateParty,omitempty"` } // NewTransferInfo instantiates a new TransferInfo object @@ -355,7 +354,7 @@ func (o *TransferInfo) SetUltimateParty(v UltimatePartyIdentification) { } func (o TransferInfo) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -427,21 +426,23 @@ func (v *NullableTransferInfo) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *TransferInfo) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "internal", "issuedCard", "platformPayment", "card"} - for _, allowed := range allowedEnumValues { - if o.GetCategory() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "bank", "internal", "issuedCard", "platformPayment", "card" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false } func (o *TransferInfo) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "crossBorder", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_transfer_notification_validation_fact.go b/src/transfers/model_transfer_notification_validation_fact.go index 55458d8a9..ae29aaac9 100644 --- a/src/transfers/model_transfer_notification_validation_fact.go +++ b/src/transfers/model_transfer_notification_validation_fact.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the TransferNotificationValidationFact type satisfies the MappedNullable interface at compile time @@ -107,7 +106,7 @@ func (o *TransferNotificationValidationFact) SetType(v string) { } func (o TransferNotificationValidationFact) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -160,3 +159,6 @@ func (v *NullableTransferNotificationValidationFact) UnmarshalJSON(src []byte) e v.isSet = true return json.Unmarshal(src, &v.value) } + + + diff --git a/src/transfers/model_uk_local_account_identification.go b/src/transfers/model_uk_local_account_identification.go index 41599e706..1334dc313 100644 --- a/src/transfers/model_uk_local_account_identification.go +++ b/src/transfers/model_uk_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -122,7 +121,7 @@ func (o *UKLocalAccountIdentification) SetType(v string) { } func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -173,12 +172,14 @@ func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UKLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"ukLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_ultimate_party_identification.go b/src/transfers/model_ultimate_party_identification.go index e42e47d9f..6f58b2d06 100644 --- a/src/transfers/model_ultimate_party_identification.go +++ b/src/transfers/model_ultimate_party_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the UltimatePartyIdentification type satisfies the MappedNullable interface at compile time @@ -273,7 +272,7 @@ func (o *UltimatePartyIdentification) SetType(v string) { } func (o UltimatePartyIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -340,12 +339,14 @@ func (v *NullableUltimatePartyIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *UltimatePartyIdentification) isValidType() bool { - var allowedEnumValues = []string{"individual", "organization", "unknown"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "individual", "organization", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transfers/model_us_local_account_identification.go b/src/transfers/model_us_local_account_identification.go index 1086c2d4f..927a0eb9b 100644 --- a/src/transfers/model_us_local_account_identification.go +++ b/src/transfers/model_us_local_account_identification.go @@ -10,8 +10,7 @@ package transfers import ( "encoding/json" - - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time @@ -160,7 +159,7 @@ func (o *USLocalAccountIdentification) SetType(v string) { } func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() + toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } @@ -214,21 +213,23 @@ func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, &v.value) } + func (o *USLocalAccountIdentification) isValidAccountType() bool { - var allowedEnumValues = []string{"checking", "savings"} - for _, allowed := range allowedEnumValues { - if o.GetAccountType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false } func (o *USLocalAccountIdentification) isValidType() bool { - var allowedEnumValues = []string{"usLocal"} - for _, allowed := range allowedEnumValues { - if o.GetType() == allowed { - return true - } - } - return false + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false } + diff --git a/src/transferwebhooks/model_additional_bank_identification.go b/src/transferwebhooks/model_additional_bank_identification.go new file mode 100644 index 000000000..c8a9bda64 --- /dev/null +++ b/src/transferwebhooks/model_additional_bank_identification.go @@ -0,0 +1,173 @@ +/* +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/v8/src/common" +) + +// checks if the AdditionalBankIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AdditionalBankIdentification{} + +// AdditionalBankIdentification struct for AdditionalBankIdentification +type AdditionalBankIdentification struct { + // The value of the additional bank identification. + Code *string `json:"code,omitempty"` + // The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + Type *string `json:"type,omitempty"` +} + +// NewAdditionalBankIdentification instantiates a new AdditionalBankIdentification 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 NewAdditionalBankIdentification() *AdditionalBankIdentification { + this := AdditionalBankIdentification{} + return &this +} + +// NewAdditionalBankIdentificationWithDefaults instantiates a new AdditionalBankIdentification 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 NewAdditionalBankIdentificationWithDefaults() *AdditionalBankIdentification { + this := AdditionalBankIdentification{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *AdditionalBankIdentification) GetCode() string { + if o == nil || common.IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalBankIdentification) GetCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *AdditionalBankIdentification) HasCode() bool { + if o != nil && !common.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *AdditionalBankIdentification) SetCode(v string) { + o.Code = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *AdditionalBankIdentification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalBankIdentification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *AdditionalBankIdentification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *AdditionalBankIdentification) SetType(v string) { + o.Type = &v +} + +func (o AdditionalBankIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AdditionalBankIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableAdditionalBankIdentification struct { + value *AdditionalBankIdentification + isSet bool +} + +func (v NullableAdditionalBankIdentification) Get() *AdditionalBankIdentification { + return v.value +} + +func (v *NullableAdditionalBankIdentification) Set(val *AdditionalBankIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalBankIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalBankIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalBankIdentification(val *AdditionalBankIdentification) *NullableAdditionalBankIdentification { + return &NullableAdditionalBankIdentification{value: val, isSet: true} +} + +func (v NullableAdditionalBankIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalBankIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AdditionalBankIdentification) isValidType() bool { + var allowedEnumValues = []string{ "gbSortCode", "usRoutingNumber" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_address.go b/src/transferwebhooks/model_address.go new file mode 100644 index 000000000..97e2948e1 --- /dev/null +++ b/src/transferwebhooks/model_address.go @@ -0,0 +1,303 @@ +/* +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/v8/src/common" +) + +// checks if the Address type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Address{} + +// Address struct for Address +type Address struct { + // The name of the city. + City *string `json:"city,omitempty"` + // The two-character ISO 3166-1 alpha-2 country code. For example, **US**, **NL**, or **GB**. + Country string `json:"country"` + // First line of the street address. + Line1 *string `json:"line1,omitempty"` + // Second line of the street address. + Line2 *string `json:"line2,omitempty"` + // The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + PostalCode *string `json:"postalCode,omitempty"` + // The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + StateOrProvince *string `json:"stateOrProvince,omitempty"` +} + +// NewAddress instantiates a new Address 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 NewAddress(country string) *Address { + this := Address{} + this.Country = country + return &this +} + +// NewAddressWithDefaults instantiates a new Address 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 NewAddressWithDefaults() *Address { + this := Address{} + return &this +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *Address) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *Address) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *Address) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value +func (o *Address) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *Address) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *Address) SetCountry(v string) { + o.Country = v +} + +// GetLine1 returns the Line1 field value if set, zero value otherwise. +func (o *Address) GetLine1() string { + if o == nil || common.IsNil(o.Line1) { + var ret string + return ret + } + return *o.Line1 +} + +// GetLine1Ok returns a tuple with the Line1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetLine1Ok() (*string, bool) { + if o == nil || common.IsNil(o.Line1) { + return nil, false + } + return o.Line1, true +} + +// HasLine1 returns a boolean if a field has been set. +func (o *Address) HasLine1() bool { + if o != nil && !common.IsNil(o.Line1) { + return true + } + + return false +} + +// SetLine1 gets a reference to the given string and assigns it to the Line1 field. +func (o *Address) SetLine1(v string) { + o.Line1 = &v +} + +// GetLine2 returns the Line2 field value if set, zero value otherwise. +func (o *Address) GetLine2() string { + if o == nil || common.IsNil(o.Line2) { + var ret string + return ret + } + return *o.Line2 +} + +// GetLine2Ok returns a tuple with the Line2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetLine2Ok() (*string, bool) { + if o == nil || common.IsNil(o.Line2) { + return nil, false + } + return o.Line2, true +} + +// HasLine2 returns a boolean if a field has been set. +func (o *Address) HasLine2() bool { + if o != nil && !common.IsNil(o.Line2) { + return true + } + + return false +} + +// SetLine2 gets a reference to the given string and assigns it to the Line2 field. +func (o *Address) SetLine2(v string) { + o.Line2 = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *Address) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *Address) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *Address) SetPostalCode(v string) { + o.PostalCode = &v +} + +// GetStateOrProvince returns the StateOrProvince field value if set, zero value otherwise. +func (o *Address) GetStateOrProvince() string { + if o == nil || common.IsNil(o.StateOrProvince) { + var ret string + return ret + } + return *o.StateOrProvince +} + +// GetStateOrProvinceOk returns a tuple with the StateOrProvince field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetStateOrProvinceOk() (*string, bool) { + if o == nil || common.IsNil(o.StateOrProvince) { + return nil, false + } + return o.StateOrProvince, true +} + +// HasStateOrProvince returns a boolean if a field has been set. +func (o *Address) HasStateOrProvince() bool { + if o != nil && !common.IsNil(o.StateOrProvince) { + return true + } + + return false +} + +// SetStateOrProvince gets a reference to the given string and assigns it to the StateOrProvince field. +func (o *Address) SetStateOrProvince(v string) { + o.StateOrProvince = &v +} + +func (o Address) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Address) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + toSerialize["country"] = o.Country + if !common.IsNil(o.Line1) { + toSerialize["line1"] = o.Line1 + } + if !common.IsNil(o.Line2) { + toSerialize["line2"] = o.Line2 + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + if !common.IsNil(o.StateOrProvince) { + toSerialize["stateOrProvince"] = o.StateOrProvince + } + return toSerialize, nil +} + +type NullableAddress struct { + value *Address + isSet bool +} + +func (v NullableAddress) Get() *Address { + return v.value +} + +func (v *NullableAddress) Set(val *Address) { + v.value = val + v.isSet = true +} + +func (v NullableAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddress(val *Address) *NullableAddress { + return &NullableAddress{value: val, isSet: true} +} + +func (v NullableAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_amount.go b/src/transferwebhooks/model_amount.go new file mode 100644 index 000000000..dacaee895 --- /dev/null +++ b/src/transferwebhooks/model_amount.go @@ -0,0 +1,146 @@ +/* +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/v8/src/common" +) + +// checks if the Amount type satisfies the MappedNullable interface at compile time +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). + Currency string `json:"currency"` + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + Value int64 `json:"value"` +} + +// NewAmount instantiates a new Amount 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 NewAmount(currency string, value int64) *Amount { + this := Amount{} + this.Currency = currency + this.Value = value + return &this +} + +// NewAmountWithDefaults instantiates a new Amount 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 NewAmountWithDefaults() *Amount { + this := Amount{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *Amount) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Amount) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Amount) SetCurrency(v string) { + o.Currency = v +} + +// GetValue returns the Value field value +func (o *Amount) GetValue() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Amount) GetValueOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Amount) SetValue(v int64) { + o.Value = v +} + +func (o Amount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Amount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableAmount struct { + value *Amount + isSet bool +} + +func (v NullableAmount) Get() *Amount { + return v.value +} + +func (v *NullableAmount) Set(val *Amount) { + v.value = val + v.isSet = true +} + +func (v NullableAmount) IsSet() bool { + return v.isSet +} + +func (v *NullableAmount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmount(val *Amount) *NullableAmount { + return &NullableAmount{value: val, isSet: true} +} + +func (v NullableAmount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_amount_adjustment.go b/src/transferwebhooks/model_amount_adjustment.go new file mode 100644 index 000000000..37d4d3a69 --- /dev/null +++ b/src/transferwebhooks/model_amount_adjustment.go @@ -0,0 +1,209 @@ +/* +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/v8/src/common" +) + +// checks if the AmountAdjustment type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AmountAdjustment{} + +// AmountAdjustment struct for AmountAdjustment +type AmountAdjustment struct { + Amount *Amount `json:"amount,omitempty"` + // The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + AmountAdjustmentType *string `json:"amountAdjustmentType,omitempty"` + // The basepoints associated with the applied markup. + Basepoints *int32 `json:"basepoints,omitempty"` +} + +// NewAmountAdjustment instantiates a new AmountAdjustment 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 NewAmountAdjustment() *AmountAdjustment { + this := AmountAdjustment{} + return &this +} + +// NewAmountAdjustmentWithDefaults instantiates a new AmountAdjustment 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 NewAmountAdjustmentWithDefaults() *AmountAdjustment { + this := AmountAdjustment{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *AmountAdjustment) GetAmount() Amount { + if o == nil || common.IsNil(o.Amount) { + var ret Amount + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountAdjustment) GetAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *AmountAdjustment) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given Amount and assigns it to the Amount field. +func (o *AmountAdjustment) SetAmount(v Amount) { + o.Amount = &v +} + +// GetAmountAdjustmentType returns the AmountAdjustmentType field value if set, zero value otherwise. +func (o *AmountAdjustment) GetAmountAdjustmentType() string { + if o == nil || common.IsNil(o.AmountAdjustmentType) { + var ret string + return ret + } + return *o.AmountAdjustmentType +} + +// GetAmountAdjustmentTypeOk returns a tuple with the AmountAdjustmentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountAdjustment) GetAmountAdjustmentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AmountAdjustmentType) { + return nil, false + } + return o.AmountAdjustmentType, true +} + +// HasAmountAdjustmentType returns a boolean if a field has been set. +func (o *AmountAdjustment) HasAmountAdjustmentType() bool { + if o != nil && !common.IsNil(o.AmountAdjustmentType) { + return true + } + + return false +} + +// SetAmountAdjustmentType gets a reference to the given string and assigns it to the AmountAdjustmentType field. +func (o *AmountAdjustment) SetAmountAdjustmentType(v string) { + o.AmountAdjustmentType = &v +} + +// GetBasepoints returns the Basepoints field value if set, zero value otherwise. +func (o *AmountAdjustment) GetBasepoints() int32 { + if o == nil || common.IsNil(o.Basepoints) { + var ret int32 + return ret + } + return *o.Basepoints +} + +// GetBasepointsOk returns a tuple with the Basepoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountAdjustment) GetBasepointsOk() (*int32, bool) { + if o == nil || common.IsNil(o.Basepoints) { + return nil, false + } + return o.Basepoints, true +} + +// HasBasepoints returns a boolean if a field has been set. +func (o *AmountAdjustment) HasBasepoints() bool { + if o != nil && !common.IsNil(o.Basepoints) { + return true + } + + return false +} + +// SetBasepoints gets a reference to the given int32 and assigns it to the Basepoints field. +func (o *AmountAdjustment) SetBasepoints(v int32) { + o.Basepoints = &v +} + +func (o AmountAdjustment) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AmountAdjustment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !common.IsNil(o.AmountAdjustmentType) { + toSerialize["amountAdjustmentType"] = o.AmountAdjustmentType + } + if !common.IsNil(o.Basepoints) { + toSerialize["basepoints"] = o.Basepoints + } + return toSerialize, nil +} + +type NullableAmountAdjustment struct { + value *AmountAdjustment + isSet bool +} + +func (v NullableAmountAdjustment) Get() *AmountAdjustment { + return v.value +} + +func (v *NullableAmountAdjustment) Set(val *AmountAdjustment) { + v.value = val + v.isSet = true +} + +func (v NullableAmountAdjustment) IsSet() bool { + return v.isSet +} + +func (v *NullableAmountAdjustment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmountAdjustment(val *AmountAdjustment) *NullableAmountAdjustment { + return &NullableAmountAdjustment{value: val, isSet: true} +} + +func (v NullableAmountAdjustment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmountAdjustment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AmountAdjustment) isValidAmountAdjustmentType() bool { + var allowedEnumValues = []string{ "atmMarkup", "authHoldReserve", "exchange", "forexMarkup" } + for _, allowed := range allowedEnumValues { + if o.GetAmountAdjustmentType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_au_local_account_identification.go b/src/transferwebhooks/model_au_local_account_identification.go new file mode 100644 index 000000000..6f4695e10 --- /dev/null +++ b/src/transferwebhooks/model_au_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the AULocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AULocalAccountIdentification{} + +// AULocalAccountIdentification struct for AULocalAccountIdentification +type AULocalAccountIdentification struct { + // The bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + BsbCode string `json:"bsbCode"` + // **auLocal** + Type string `json:"type"` +} + +// NewAULocalAccountIdentification instantiates a new AULocalAccountIdentification 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 NewAULocalAccountIdentification(accountNumber string, bsbCode string, type_ string) *AULocalAccountIdentification { + this := AULocalAccountIdentification{} + this.AccountNumber = accountNumber + this.BsbCode = bsbCode + this.Type = type_ + return &this +} + +// NewAULocalAccountIdentificationWithDefaults instantiates a new AULocalAccountIdentification 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 NewAULocalAccountIdentificationWithDefaults() *AULocalAccountIdentification { + this := AULocalAccountIdentification{} + var type_ string = "auLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *AULocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *AULocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *AULocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBsbCode returns the BsbCode field value +func (o *AULocalAccountIdentification) GetBsbCode() string { + if o == nil { + var ret string + return ret + } + + return o.BsbCode +} + +// GetBsbCodeOk returns a tuple with the BsbCode field value +// and a boolean to check if the value has been set. +func (o *AULocalAccountIdentification) GetBsbCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BsbCode, true +} + +// SetBsbCode sets field value +func (o *AULocalAccountIdentification) SetBsbCode(v string) { + o.BsbCode = v +} + +// GetType returns the Type field value +func (o *AULocalAccountIdentification) 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 *AULocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AULocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o AULocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AULocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bsbCode"] = o.BsbCode + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAULocalAccountIdentification struct { + value *AULocalAccountIdentification + isSet bool +} + +func (v NullableAULocalAccountIdentification) Get() *AULocalAccountIdentification { + return v.value +} + +func (v *NullableAULocalAccountIdentification) Set(val *AULocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableAULocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableAULocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAULocalAccountIdentification(val *AULocalAccountIdentification) *NullableAULocalAccountIdentification { + return &NullableAULocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableAULocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAULocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *AULocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "auLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_balance_mutation.go b/src/transferwebhooks/model_balance_mutation.go new file mode 100644 index 000000000..eb115da5a --- /dev/null +++ b/src/transferwebhooks/model_balance_mutation.go @@ -0,0 +1,238 @@ +/* +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/v8/src/common" +) + +// checks if the BalanceMutation type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalanceMutation{} + +// BalanceMutation struct for BalanceMutation +type BalanceMutation struct { + // The amount in the payment's currency that is debited or credited on the balance accounting register. + Balance *int64 `json:"balance,omitempty"` + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + Currency *string `json:"currency,omitempty"` + // The amount in the payment's currency that is debited or credited on the received accounting register. + Received *int64 `json:"received,omitempty"` + // The amount in the payment's currency that is debited or credited on the reserved accounting register. + Reserved *int64 `json:"reserved,omitempty"` +} + +// NewBalanceMutation instantiates a new BalanceMutation 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 NewBalanceMutation() *BalanceMutation { + this := BalanceMutation{} + return &this +} + +// NewBalanceMutationWithDefaults instantiates a new BalanceMutation 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 NewBalanceMutationWithDefaults() *BalanceMutation { + this := BalanceMutation{} + return &this +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *BalanceMutation) GetBalance() int64 { + if o == nil || common.IsNil(o.Balance) { + var ret int64 + return ret + } + return *o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceMutation) GetBalanceOk() (*int64, bool) { + if o == nil || common.IsNil(o.Balance) { + return nil, false + } + return o.Balance, true +} + +// HasBalance returns a boolean if a field has been set. +func (o *BalanceMutation) HasBalance() bool { + if o != nil && !common.IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given int64 and assigns it to the Balance field. +func (o *BalanceMutation) SetBalance(v int64) { + o.Balance = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *BalanceMutation) GetCurrency() string { + if o == nil || common.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceMutation) GetCurrencyOk() (*string, bool) { + if o == nil || common.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *BalanceMutation) HasCurrency() bool { + if o != nil && !common.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *BalanceMutation) SetCurrency(v string) { + o.Currency = &v +} + +// GetReceived returns the Received field value if set, zero value otherwise. +func (o *BalanceMutation) GetReceived() int64 { + if o == nil || common.IsNil(o.Received) { + var ret int64 + return ret + } + return *o.Received +} + +// GetReceivedOk returns a tuple with the Received field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceMutation) GetReceivedOk() (*int64, bool) { + if o == nil || common.IsNil(o.Received) { + return nil, false + } + return o.Received, true +} + +// HasReceived returns a boolean if a field has been set. +func (o *BalanceMutation) HasReceived() bool { + if o != nil && !common.IsNil(o.Received) { + return true + } + + return false +} + +// SetReceived gets a reference to the given int64 and assigns it to the Received field. +func (o *BalanceMutation) SetReceived(v int64) { + o.Received = &v +} + +// GetReserved returns the Reserved field value if set, zero value otherwise. +func (o *BalanceMutation) GetReserved() int64 { + if o == nil || common.IsNil(o.Reserved) { + var ret int64 + return ret + } + return *o.Reserved +} + +// GetReservedOk returns a tuple with the Reserved field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BalanceMutation) GetReservedOk() (*int64, bool) { + if o == nil || common.IsNil(o.Reserved) { + return nil, false + } + return o.Reserved, true +} + +// HasReserved returns a boolean if a field has been set. +func (o *BalanceMutation) HasReserved() bool { + if o != nil && !common.IsNil(o.Reserved) { + return true + } + + return false +} + +// SetReserved gets a reference to the given int64 and assigns it to the Reserved field. +func (o *BalanceMutation) SetReserved(v int64) { + o.Reserved = &v +} + +func (o BalanceMutation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalanceMutation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Balance) { + toSerialize["balance"] = o.Balance + } + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Received) { + toSerialize["received"] = o.Received + } + if !common.IsNil(o.Reserved) { + toSerialize["reserved"] = o.Reserved + } + return toSerialize, nil +} + +type NullableBalanceMutation struct { + value *BalanceMutation + isSet bool +} + +func (v NullableBalanceMutation) Get() *BalanceMutation { + return v.value +} + +func (v *NullableBalanceMutation) Set(val *BalanceMutation) { + v.value = val + v.isSet = true +} + +func (v NullableBalanceMutation) IsSet() bool { + return v.isSet +} + +func (v *NullableBalanceMutation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalanceMutation(val *BalanceMutation) *NullableBalanceMutation { + return &NullableBalanceMutation{value: val, isSet: true} +} + +func (v NullableBalanceMutation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalanceMutation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_balance_platform_notification_response.go b/src/transferwebhooks/model_balance_platform_notification_response.go new file mode 100644 index 000000000..4d14448c0 --- /dev/null +++ b/src/transferwebhooks/model_balance_platform_notification_response.go @@ -0,0 +1,127 @@ +/* +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/v8/src/common" +) + +// checks if the BalancePlatformNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BalancePlatformNotificationResponse{} + +// BalancePlatformNotificationResponse struct for BalancePlatformNotificationResponse +type BalancePlatformNotificationResponse struct { + // Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewBalancePlatformNotificationResponse instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponse() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// NewBalancePlatformNotificationResponseWithDefaults instantiates a new BalancePlatformNotificationResponse 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 NewBalancePlatformNotificationResponseWithDefaults() *BalancePlatformNotificationResponse { + this := BalancePlatformNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) 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 *BalancePlatformNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o BalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BalancePlatformNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableBalancePlatformNotificationResponse struct { + value *BalancePlatformNotificationResponse + isSet bool +} + +func (v NullableBalancePlatformNotificationResponse) Get() *BalancePlatformNotificationResponse { + return v.value +} + +func (v *NullableBalancePlatformNotificationResponse) Set(val *BalancePlatformNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBalancePlatformNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBalancePlatformNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalancePlatformNotificationResponse(val *BalancePlatformNotificationResponse) *NullableBalancePlatformNotificationResponse { + return &NullableBalancePlatformNotificationResponse{value: val, isSet: true} +} + +func (v NullableBalancePlatformNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalancePlatformNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_bank_account_v3.go b/src/transferwebhooks/model_bank_account_v3.go new file mode 100644 index 000000000..1ba912a72 --- /dev/null +++ b/src/transferwebhooks/model_bank_account_v3.go @@ -0,0 +1,144 @@ +/* +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/v8/src/common" +) + +// checks if the BankAccountV3 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccountV3{} + +// BankAccountV3 struct for BankAccountV3 +type BankAccountV3 struct { + AccountHolder PartyIdentification `json:"accountHolder"` + AccountIdentification BankAccountV3AccountIdentification `json:"accountIdentification"` +} + +// NewBankAccountV3 instantiates a new BankAccountV3 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 NewBankAccountV3(accountHolder PartyIdentification, accountIdentification BankAccountV3AccountIdentification) *BankAccountV3 { + this := BankAccountV3{} + this.AccountHolder = accountHolder + this.AccountIdentification = accountIdentification + return &this +} + +// NewBankAccountV3WithDefaults instantiates a new BankAccountV3 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 NewBankAccountV3WithDefaults() *BankAccountV3 { + this := BankAccountV3{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value +func (o *BankAccountV3) GetAccountHolder() PartyIdentification { + if o == nil { + var ret PartyIdentification + return ret + } + + return o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value +// and a boolean to check if the value has been set. +func (o *BankAccountV3) GetAccountHolderOk() (*PartyIdentification, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolder, true +} + +// SetAccountHolder sets field value +func (o *BankAccountV3) SetAccountHolder(v PartyIdentification) { + o.AccountHolder = v +} + +// GetAccountIdentification returns the AccountIdentification field value +func (o *BankAccountV3) GetAccountIdentification() BankAccountV3AccountIdentification { + if o == nil { + var ret BankAccountV3AccountIdentification + return ret + } + + return o.AccountIdentification +} + +// GetAccountIdentificationOk returns a tuple with the AccountIdentification field value +// and a boolean to check if the value has been set. +func (o *BankAccountV3) GetAccountIdentificationOk() (*BankAccountV3AccountIdentification, bool) { + if o == nil { + return nil, false + } + return &o.AccountIdentification, true +} + +// SetAccountIdentification sets field value +func (o *BankAccountV3) SetAccountIdentification(v BankAccountV3AccountIdentification) { + o.AccountIdentification = v +} + +func (o BankAccountV3) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccountV3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountHolder"] = o.AccountHolder + toSerialize["accountIdentification"] = o.AccountIdentification + return toSerialize, nil +} + +type NullableBankAccountV3 struct { + value *BankAccountV3 + isSet bool +} + +func (v NullableBankAccountV3) Get() *BankAccountV3 { + return v.value +} + +func (v *NullableBankAccountV3) Set(val *BankAccountV3) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountV3) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountV3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountV3(val *BankAccountV3) *NullableBankAccountV3 { + return &NullableBankAccountV3{value: val, isSet: true} +} + +func (v NullableBankAccountV3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountV3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_bank_account_v3_account_identification.go b/src/transferwebhooks/model_bank_account_v3_account_identification.go new file mode 100644 index 000000000..402a1b849 --- /dev/null +++ b/src/transferwebhooks/model_bank_account_v3_account_identification.go @@ -0,0 +1,567 @@ +/* +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/v8/src/common" + "fmt" +) + +// BankAccountV3AccountIdentification - Contains the bank account details. The fields required in this object depend on the country of the bank account and the currency of the transfer. +type BankAccountV3AccountIdentification struct { + AULocalAccountIdentification *AULocalAccountIdentification + BRLocalAccountIdentification *BRLocalAccountIdentification + CALocalAccountIdentification *CALocalAccountIdentification + CZLocalAccountIdentification *CZLocalAccountIdentification + DKLocalAccountIdentification *DKLocalAccountIdentification + HKLocalAccountIdentification *HKLocalAccountIdentification + HULocalAccountIdentification *HULocalAccountIdentification + IbanAccountIdentification *IbanAccountIdentification + NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification + NumberAndBicAccountIdentification *NumberAndBicAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification +} + +// AULocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func AULocalAccountIdentificationAsBankAccountV3AccountIdentification(v *AULocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + AULocalAccountIdentification: v, + } +} + +// BRLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns BRLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func BRLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *BRLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + BRLocalAccountIdentification: v, + } +} + +// CALocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns CALocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func CALocalAccountIdentificationAsBankAccountV3AccountIdentification(v *CALocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + CALocalAccountIdentification: v, + } +} + +// CZLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns CZLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func CZLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *CZLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + CZLocalAccountIdentification: v, + } +} + +// DKLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns DKLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func DKLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *DKLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + DKLocalAccountIdentification: v, + } +} + +// HKLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns HKLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func HKLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *HKLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + HKLocalAccountIdentification: v, + } +} + +// HULocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns HULocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func HULocalAccountIdentificationAsBankAccountV3AccountIdentification(v *HULocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + HULocalAccountIdentification: v, + } +} + +// IbanAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns IbanAccountIdentification wrapped in BankAccountV3AccountIdentification +func IbanAccountIdentificationAsBankAccountV3AccountIdentification(v *IbanAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + IbanAccountIdentification: v, + } +} + +// NOLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns NOLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func NOLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *NOLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + NOLocalAccountIdentification: v, + } +} + +// NZLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func NZLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *NZLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + NZLocalAccountIdentification: v, + } +} + +// NumberAndBicAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountV3AccountIdentification +func NumberAndBicAccountIdentificationAsBankAccountV3AccountIdentification(v *NumberAndBicAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + NumberAndBicAccountIdentification: v, + } +} + +// PLLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns PLLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func PLLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *PLLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + PLLocalAccountIdentification: v, + } +} + +// SELocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns SELocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func SELocalAccountIdentificationAsBankAccountV3AccountIdentification(v *SELocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + SELocalAccountIdentification: v, + } +} + +// SGLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns SGLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func SGLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *SGLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + SGLocalAccountIdentification: v, + } +} + +// UKLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns UKLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func UKLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *UKLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + UKLocalAccountIdentification: v, + } +} + +// USLocalAccountIdentificationAsBankAccountV3AccountIdentification is a convenience function that returns USLocalAccountIdentification wrapped in BankAccountV3AccountIdentification +func USLocalAccountIdentificationAsBankAccountV3AccountIdentification(v *USLocalAccountIdentification) BankAccountV3AccountIdentification { + return BankAccountV3AccountIdentification{ + USLocalAccountIdentification: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BankAccountV3AccountIdentification) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AULocalAccountIdentification + err = json.Unmarshal(data, &dst.AULocalAccountIdentification) + if err == nil { + jsonAULocalAccountIdentification, _ := json.Marshal(dst.AULocalAccountIdentification) + if string(jsonAULocalAccountIdentification) == "{}" || !dst.AULocalAccountIdentification.isValidType() { // empty struct + dst.AULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.AULocalAccountIdentification = nil + } + + // try to unmarshal data into BRLocalAccountIdentification + err = json.Unmarshal(data, &dst.BRLocalAccountIdentification) + if err == nil { + jsonBRLocalAccountIdentification, _ := json.Marshal(dst.BRLocalAccountIdentification) + if string(jsonBRLocalAccountIdentification) == "{}" || !dst.BRLocalAccountIdentification.isValidType() { // empty struct + dst.BRLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.BRLocalAccountIdentification = nil + } + + // try to unmarshal data into CALocalAccountIdentification + err = json.Unmarshal(data, &dst.CALocalAccountIdentification) + if err == nil { + jsonCALocalAccountIdentification, _ := json.Marshal(dst.CALocalAccountIdentification) + if string(jsonCALocalAccountIdentification) == "{}" || !dst.CALocalAccountIdentification.isValidType() { // empty struct + dst.CALocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CALocalAccountIdentification = nil + } + + // try to unmarshal data into CZLocalAccountIdentification + err = json.Unmarshal(data, &dst.CZLocalAccountIdentification) + if err == nil { + jsonCZLocalAccountIdentification, _ := json.Marshal(dst.CZLocalAccountIdentification) + if string(jsonCZLocalAccountIdentification) == "{}" || !dst.CZLocalAccountIdentification.isValidType() { // empty struct + dst.CZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.CZLocalAccountIdentification = nil + } + + // try to unmarshal data into DKLocalAccountIdentification + err = json.Unmarshal(data, &dst.DKLocalAccountIdentification) + if err == nil { + jsonDKLocalAccountIdentification, _ := json.Marshal(dst.DKLocalAccountIdentification) + if string(jsonDKLocalAccountIdentification) == "{}" || !dst.DKLocalAccountIdentification.isValidType() { // empty struct + dst.DKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.DKLocalAccountIdentification = nil + } + + // try to unmarshal data into HKLocalAccountIdentification + err = json.Unmarshal(data, &dst.HKLocalAccountIdentification) + if err == nil { + jsonHKLocalAccountIdentification, _ := json.Marshal(dst.HKLocalAccountIdentification) + if string(jsonHKLocalAccountIdentification) == "{}" || !dst.HKLocalAccountIdentification.isValidType() { // empty struct + dst.HKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HKLocalAccountIdentification = nil + } + + // try to unmarshal data into HULocalAccountIdentification + err = json.Unmarshal(data, &dst.HULocalAccountIdentification) + if err == nil { + jsonHULocalAccountIdentification, _ := json.Marshal(dst.HULocalAccountIdentification) + if string(jsonHULocalAccountIdentification) == "{}" || !dst.HULocalAccountIdentification.isValidType() { // empty struct + dst.HULocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.HULocalAccountIdentification = nil + } + + // try to unmarshal data into IbanAccountIdentification + err = json.Unmarshal(data, &dst.IbanAccountIdentification) + if err == nil { + jsonIbanAccountIdentification, _ := json.Marshal(dst.IbanAccountIdentification) + if string(jsonIbanAccountIdentification) == "{}" || !dst.IbanAccountIdentification.isValidType() { // empty struct + dst.IbanAccountIdentification = nil + } else { + match++ + } + } else { + dst.IbanAccountIdentification = nil + } + + // try to unmarshal data into NOLocalAccountIdentification + err = json.Unmarshal(data, &dst.NOLocalAccountIdentification) + if err == nil { + jsonNOLocalAccountIdentification, _ := json.Marshal(dst.NOLocalAccountIdentification) + if string(jsonNOLocalAccountIdentification) == "{}" || !dst.NOLocalAccountIdentification.isValidType() { // empty struct + dst.NOLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NOLocalAccountIdentification = nil + } + + // try to unmarshal data into NZLocalAccountIdentification + err = json.Unmarshal(data, &dst.NZLocalAccountIdentification) + if err == nil { + jsonNZLocalAccountIdentification, _ := json.Marshal(dst.NZLocalAccountIdentification) + if string(jsonNZLocalAccountIdentification) == "{}" || !dst.NZLocalAccountIdentification.isValidType() { // empty struct + dst.NZLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.NZLocalAccountIdentification = nil + } + + // try to unmarshal data into NumberAndBicAccountIdentification + err = json.Unmarshal(data, &dst.NumberAndBicAccountIdentification) + if err == nil { + jsonNumberAndBicAccountIdentification, _ := json.Marshal(dst.NumberAndBicAccountIdentification) + if string(jsonNumberAndBicAccountIdentification) == "{}" || !dst.NumberAndBicAccountIdentification.isValidType() { // empty struct + dst.NumberAndBicAccountIdentification = nil + } else { + match++ + } + } else { + dst.NumberAndBicAccountIdentification = nil + } + + // try to unmarshal data into PLLocalAccountIdentification + err = json.Unmarshal(data, &dst.PLLocalAccountIdentification) + if err == nil { + jsonPLLocalAccountIdentification, _ := json.Marshal(dst.PLLocalAccountIdentification) + if string(jsonPLLocalAccountIdentification) == "{}" || !dst.PLLocalAccountIdentification.isValidType() { // empty struct + dst.PLLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.PLLocalAccountIdentification = nil + } + + // try to unmarshal data into SELocalAccountIdentification + err = json.Unmarshal(data, &dst.SELocalAccountIdentification) + if err == nil { + jsonSELocalAccountIdentification, _ := json.Marshal(dst.SELocalAccountIdentification) + if string(jsonSELocalAccountIdentification) == "{}" || !dst.SELocalAccountIdentification.isValidType() { // empty struct + dst.SELocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.SELocalAccountIdentification = nil + } + + // try to unmarshal data into SGLocalAccountIdentification + err = json.Unmarshal(data, &dst.SGLocalAccountIdentification) + if err == nil { + jsonSGLocalAccountIdentification, _ := json.Marshal(dst.SGLocalAccountIdentification) + if string(jsonSGLocalAccountIdentification) == "{}" || !dst.SGLocalAccountIdentification.isValidType() { // empty struct + dst.SGLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.SGLocalAccountIdentification = nil + } + + // try to unmarshal data into UKLocalAccountIdentification + err = json.Unmarshal(data, &dst.UKLocalAccountIdentification) + if err == nil { + jsonUKLocalAccountIdentification, _ := json.Marshal(dst.UKLocalAccountIdentification) + if string(jsonUKLocalAccountIdentification) == "{}" || !dst.UKLocalAccountIdentification.isValidType() { // empty struct + dst.UKLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.UKLocalAccountIdentification = nil + } + + // try to unmarshal data into USLocalAccountIdentification + err = json.Unmarshal(data, &dst.USLocalAccountIdentification) + if err == nil { + jsonUSLocalAccountIdentification, _ := json.Marshal(dst.USLocalAccountIdentification) + if string(jsonUSLocalAccountIdentification) == "{}" || !dst.USLocalAccountIdentification.isValidType() { // empty struct + dst.USLocalAccountIdentification = nil + } else { + match++ + } + } else { + dst.USLocalAccountIdentification = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AULocalAccountIdentification = nil + dst.BRLocalAccountIdentification = nil + dst.CALocalAccountIdentification = nil + dst.CZLocalAccountIdentification = nil + dst.DKLocalAccountIdentification = nil + dst.HKLocalAccountIdentification = nil + dst.HULocalAccountIdentification = nil + dst.IbanAccountIdentification = nil + dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil + dst.NumberAndBicAccountIdentification = nil + dst.PLLocalAccountIdentification = nil + dst.SELocalAccountIdentification = nil + dst.SGLocalAccountIdentification = nil + dst.UKLocalAccountIdentification = nil + dst.USLocalAccountIdentification = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BankAccountV3AccountIdentification)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BankAccountV3AccountIdentification)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BankAccountV3AccountIdentification) MarshalJSON() ([]byte, error) { + if src.AULocalAccountIdentification != nil { + return json.Marshal(&src.AULocalAccountIdentification) + } + + if src.BRLocalAccountIdentification != nil { + return json.Marshal(&src.BRLocalAccountIdentification) + } + + if src.CALocalAccountIdentification != nil { + return json.Marshal(&src.CALocalAccountIdentification) + } + + if src.CZLocalAccountIdentification != nil { + return json.Marshal(&src.CZLocalAccountIdentification) + } + + if src.DKLocalAccountIdentification != nil { + return json.Marshal(&src.DKLocalAccountIdentification) + } + + if src.HKLocalAccountIdentification != nil { + return json.Marshal(&src.HKLocalAccountIdentification) + } + + if src.HULocalAccountIdentification != nil { + return json.Marshal(&src.HULocalAccountIdentification) + } + + if src.IbanAccountIdentification != nil { + return json.Marshal(&src.IbanAccountIdentification) + } + + if src.NOLocalAccountIdentification != nil { + return json.Marshal(&src.NOLocalAccountIdentification) + } + + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + + if src.NumberAndBicAccountIdentification != nil { + return json.Marshal(&src.NumberAndBicAccountIdentification) + } + + if src.PLLocalAccountIdentification != nil { + return json.Marshal(&src.PLLocalAccountIdentification) + } + + if src.SELocalAccountIdentification != nil { + return json.Marshal(&src.SELocalAccountIdentification) + } + + if src.SGLocalAccountIdentification != nil { + return json.Marshal(&src.SGLocalAccountIdentification) + } + + if src.UKLocalAccountIdentification != nil { + return json.Marshal(&src.UKLocalAccountIdentification) + } + + if src.USLocalAccountIdentification != nil { + return json.Marshal(&src.USLocalAccountIdentification) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BankAccountV3AccountIdentification) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.AULocalAccountIdentification != nil { + return obj.AULocalAccountIdentification + } + + if obj.BRLocalAccountIdentification != nil { + return obj.BRLocalAccountIdentification + } + + if obj.CALocalAccountIdentification != nil { + return obj.CALocalAccountIdentification + } + + if obj.CZLocalAccountIdentification != nil { + return obj.CZLocalAccountIdentification + } + + if obj.DKLocalAccountIdentification != nil { + return obj.DKLocalAccountIdentification + } + + if obj.HKLocalAccountIdentification != nil { + return obj.HKLocalAccountIdentification + } + + if obj.HULocalAccountIdentification != nil { + return obj.HULocalAccountIdentification + } + + if obj.IbanAccountIdentification != nil { + return obj.IbanAccountIdentification + } + + if obj.NOLocalAccountIdentification != nil { + return obj.NOLocalAccountIdentification + } + + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + + if obj.NumberAndBicAccountIdentification != nil { + return obj.NumberAndBicAccountIdentification + } + + if obj.PLLocalAccountIdentification != nil { + return obj.PLLocalAccountIdentification + } + + if obj.SELocalAccountIdentification != nil { + return obj.SELocalAccountIdentification + } + + if obj.SGLocalAccountIdentification != nil { + return obj.SGLocalAccountIdentification + } + + if obj.UKLocalAccountIdentification != nil { + return obj.UKLocalAccountIdentification + } + + if obj.USLocalAccountIdentification != nil { + return obj.USLocalAccountIdentification + } + + // all schemas are nil + return nil +} + +type NullableBankAccountV3AccountIdentification struct { + value *BankAccountV3AccountIdentification + isSet bool +} + +func (v NullableBankAccountV3AccountIdentification) Get() *BankAccountV3AccountIdentification { + return v.value +} + +func (v *NullableBankAccountV3AccountIdentification) Set(val *BankAccountV3AccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountV3AccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountV3AccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountV3AccountIdentification(val *BankAccountV3AccountIdentification) *NullableBankAccountV3AccountIdentification { + return &NullableBankAccountV3AccountIdentification{value: val, isSet: true} +} + +func (v NullableBankAccountV3AccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountV3AccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/transferwebhooks/model_bank_category_data.go b/src/transferwebhooks/model_bank_category_data.go new file mode 100644 index 000000000..8416fdd10 --- /dev/null +++ b/src/transferwebhooks/model_bank_category_data.go @@ -0,0 +1,186 @@ +/* +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/v8/src/common" +) + +// checks if the BankCategoryData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankCategoryData{} + +// BankCategoryData struct for BankCategoryData +type BankCategoryData struct { + // The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + Priority *string `json:"priority,omitempty"` + // **bank** + Type *string `json:"type,omitempty"` +} + +// NewBankCategoryData instantiates a new BankCategoryData 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 NewBankCategoryData() *BankCategoryData { + this := BankCategoryData{} + var type_ string = "bank" + this.Type = &type_ + return &this +} + +// NewBankCategoryDataWithDefaults instantiates a new BankCategoryData 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 NewBankCategoryDataWithDefaults() *BankCategoryData { + this := BankCategoryData{} + var type_ string = "bank" + this.Type = &type_ + return &this +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *BankCategoryData) GetPriority() string { + if o == nil || common.IsNil(o.Priority) { + var ret string + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankCategoryData) GetPriorityOk() (*string, bool) { + if o == nil || common.IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *BankCategoryData) HasPriority() bool { + if o != nil && !common.IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given string and assigns it to the Priority field. +func (o *BankCategoryData) SetPriority(v string) { + o.Priority = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *BankCategoryData) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankCategoryData) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *BankCategoryData) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *BankCategoryData) SetType(v string) { + o.Type = &v +} + +func (o BankCategoryData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankCategoryData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableBankCategoryData struct { + value *BankCategoryData + isSet bool +} + +func (v NullableBankCategoryData) Get() *BankCategoryData { + return v.value +} + +func (v *NullableBankCategoryData) Set(val *BankCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableBankCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableBankCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankCategoryData(val *BankCategoryData) *NullableBankCategoryData { + return &NullableBankCategoryData{value: val, isSet: true} +} + +func (v NullableBankCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *BankCategoryData) isValidPriority() bool { + var allowedEnumValues = []string{ "crossBorder", "fast", "instant", "internal", "regular", "wire" } + for _, allowed := range allowedEnumValues { + if o.GetPriority() == allowed { + return true + } + } + return false +} +func (o *BankCategoryData) isValidType() bool { + var allowedEnumValues = []string{ "bank" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_br_local_account_identification.go b/src/transferwebhooks/model_br_local_account_identification.go new file mode 100644 index 000000000..db21d3587 --- /dev/null +++ b/src/transferwebhooks/model_br_local_account_identification.go @@ -0,0 +1,213 @@ +/* +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/v8/src/common" +) + +// checks if the BRLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BRLocalAccountIdentification{} + +// BRLocalAccountIdentification struct for BRLocalAccountIdentification +type BRLocalAccountIdentification struct { + // The bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The 3-digit bank code, with leading zeros. + BankCode string `json:"bankCode"` + // The bank account branch number, without separators or whitespace. + BranchNumber string `json:"branchNumber"` + // **brLocal** + Type string `json:"type"` +} + +// NewBRLocalAccountIdentification instantiates a new BRLocalAccountIdentification 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 NewBRLocalAccountIdentification(accountNumber string, bankCode string, branchNumber string, type_ string) *BRLocalAccountIdentification { + this := BRLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.BankCode = bankCode + this.BranchNumber = branchNumber + this.Type = type_ + return &this +} + +// NewBRLocalAccountIdentificationWithDefaults instantiates a new BRLocalAccountIdentification 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 NewBRLocalAccountIdentificationWithDefaults() *BRLocalAccountIdentification { + this := BRLocalAccountIdentification{} + var type_ string = "brLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *BRLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *BRLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *BRLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBankCode returns the BankCode field value +func (o *BRLocalAccountIdentification) GetBankCode() string { + if o == nil { + var ret string + return ret + } + + return o.BankCode +} + +// GetBankCodeOk returns a tuple with the BankCode field value +// and a boolean to check if the value has been set. +func (o *BRLocalAccountIdentification) GetBankCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BankCode, true +} + +// SetBankCode sets field value +func (o *BRLocalAccountIdentification) SetBankCode(v string) { + o.BankCode = v +} + +// GetBranchNumber returns the BranchNumber field value +func (o *BRLocalAccountIdentification) GetBranchNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BranchNumber +} + +// GetBranchNumberOk returns a tuple with the BranchNumber field value +// and a boolean to check if the value has been set. +func (o *BRLocalAccountIdentification) GetBranchNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BranchNumber, true +} + +// SetBranchNumber sets field value +func (o *BRLocalAccountIdentification) SetBranchNumber(v string) { + o.BranchNumber = v +} + +// GetType returns the Type field value +func (o *BRLocalAccountIdentification) 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 *BRLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BRLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o BRLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BRLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bankCode"] = o.BankCode + toSerialize["branchNumber"] = o.BranchNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBRLocalAccountIdentification struct { + value *BRLocalAccountIdentification + isSet bool +} + +func (v NullableBRLocalAccountIdentification) Get() *BRLocalAccountIdentification { + return v.value +} + +func (v *NullableBRLocalAccountIdentification) Set(val *BRLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBRLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBRLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBRLocalAccountIdentification(val *BRLocalAccountIdentification) *NullableBRLocalAccountIdentification { + return &NullableBRLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableBRLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBRLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *BRLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "brLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_ca_local_account_identification.go b/src/transferwebhooks/model_ca_local_account_identification.go new file mode 100644 index 000000000..94913daea --- /dev/null +++ b/src/transferwebhooks/model_ca_local_account_identification.go @@ -0,0 +1,263 @@ +/* +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/v8/src/common" +) + +// checks if the CALocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CALocalAccountIdentification{} + +// CALocalAccountIdentification struct for CALocalAccountIdentification +type CALocalAccountIdentification struct { + // The 5- to 12-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + AccountType *string `json:"accountType,omitempty"` + // The 3-digit institution number, without separators or whitespace. + InstitutionNumber string `json:"institutionNumber"` + // The 5-digit transit number, without separators or whitespace. + TransitNumber string `json:"transitNumber"` + // **caLocal** + Type string `json:"type"` +} + +// NewCALocalAccountIdentification instantiates a new CALocalAccountIdentification 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 NewCALocalAccountIdentification(accountNumber string, institutionNumber string, transitNumber string, type_ string) *CALocalAccountIdentification { + this := CALocalAccountIdentification{} + this.AccountNumber = accountNumber + var accountType string = "checking" + this.AccountType = &accountType + this.InstitutionNumber = institutionNumber + this.TransitNumber = transitNumber + this.Type = type_ + return &this +} + +// NewCALocalAccountIdentificationWithDefaults instantiates a new CALocalAccountIdentification 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 NewCALocalAccountIdentificationWithDefaults() *CALocalAccountIdentification { + this := CALocalAccountIdentification{} + var accountType string = "checking" + this.AccountType = &accountType + var type_ string = "caLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *CALocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *CALocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *CALocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *CALocalAccountIdentification) GetAccountType() string { + if o == nil || common.IsNil(o.AccountType) { + var ret string + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CALocalAccountIdentification) GetAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *CALocalAccountIdentification) HasAccountType() bool { + if o != nil && !common.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given string and assigns it to the AccountType field. +func (o *CALocalAccountIdentification) SetAccountType(v string) { + o.AccountType = &v +} + +// GetInstitutionNumber returns the InstitutionNumber field value +func (o *CALocalAccountIdentification) GetInstitutionNumber() string { + if o == nil { + var ret string + return ret + } + + return o.InstitutionNumber +} + +// GetInstitutionNumberOk returns a tuple with the InstitutionNumber field value +// and a boolean to check if the value has been set. +func (o *CALocalAccountIdentification) GetInstitutionNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstitutionNumber, true +} + +// SetInstitutionNumber sets field value +func (o *CALocalAccountIdentification) SetInstitutionNumber(v string) { + o.InstitutionNumber = v +} + +// GetTransitNumber returns the TransitNumber field value +func (o *CALocalAccountIdentification) GetTransitNumber() string { + if o == nil { + var ret string + return ret + } + + return o.TransitNumber +} + +// GetTransitNumberOk returns a tuple with the TransitNumber field value +// and a boolean to check if the value has been set. +func (o *CALocalAccountIdentification) GetTransitNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransitNumber, true +} + +// SetTransitNumber sets field value +func (o *CALocalAccountIdentification) SetTransitNumber(v string) { + o.TransitNumber = v +} + +// GetType returns the Type field value +func (o *CALocalAccountIdentification) 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 *CALocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CALocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o CALocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CALocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + if !common.IsNil(o.AccountType) { + toSerialize["accountType"] = o.AccountType + } + toSerialize["institutionNumber"] = o.InstitutionNumber + toSerialize["transitNumber"] = o.TransitNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableCALocalAccountIdentification struct { + value *CALocalAccountIdentification + isSet bool +} + +func (v NullableCALocalAccountIdentification) Get() *CALocalAccountIdentification { + return v.value +} + +func (v *NullableCALocalAccountIdentification) Set(val *CALocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableCALocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableCALocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCALocalAccountIdentification(val *CALocalAccountIdentification) *NullableCALocalAccountIdentification { + return &NullableCALocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableCALocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCALocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CALocalAccountIdentification) isValidAccountType() bool { + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false +} +func (o *CALocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "caLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_counterparty_v3.go b/src/transferwebhooks/model_counterparty_v3.go new file mode 100644 index 000000000..90db82afa --- /dev/null +++ b/src/transferwebhooks/model_counterparty_v3.go @@ -0,0 +1,236 @@ +/* +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/v8/src/common" +) + +// checks if the CounterpartyV3 type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CounterpartyV3{} + +// CounterpartyV3 struct for CounterpartyV3 +type CounterpartyV3 struct { + // Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + BalanceAccountId *string `json:"balanceAccountId,omitempty"` + BankAccount *BankAccountV3 `json:"bankAccount,omitempty"` + Merchant *MerchantData `json:"merchant,omitempty"` + // Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + TransferInstrumentId *string `json:"transferInstrumentId,omitempty"` +} + +// NewCounterpartyV3 instantiates a new CounterpartyV3 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 NewCounterpartyV3() *CounterpartyV3 { + this := CounterpartyV3{} + return &this +} + +// NewCounterpartyV3WithDefaults instantiates a new CounterpartyV3 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 NewCounterpartyV3WithDefaults() *CounterpartyV3 { + this := CounterpartyV3{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *CounterpartyV3) GetBalanceAccountId() string { + if o == nil || common.IsNil(o.BalanceAccountId) { + var ret string + return ret + } + return *o.BalanceAccountId +} + +// GetBalanceAccountIdOk returns a tuple with the BalanceAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyV3) GetBalanceAccountIdOk() (*string, bool) { + if o == nil || common.IsNil(o.BalanceAccountId) { + return nil, false + } + return o.BalanceAccountId, true +} + +// HasBalanceAccountId returns a boolean if a field has been set. +func (o *CounterpartyV3) HasBalanceAccountId() bool { + if o != nil && !common.IsNil(o.BalanceAccountId) { + return true + } + + return false +} + +// SetBalanceAccountId gets a reference to the given string and assigns it to the BalanceAccountId field. +func (o *CounterpartyV3) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *CounterpartyV3) GetBankAccount() BankAccountV3 { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccountV3 + return ret + } + return *o.BankAccount +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyV3) GetBankAccountOk() (*BankAccountV3, bool) { + if o == nil || common.IsNil(o.BankAccount) { + return nil, false + } + return o.BankAccount, true +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *CounterpartyV3) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccountV3 and assigns it to the BankAccount field. +func (o *CounterpartyV3) SetBankAccount(v BankAccountV3) { + o.BankAccount = &v +} + +// GetMerchant returns the Merchant field value if set, zero value otherwise. +func (o *CounterpartyV3) GetMerchant() MerchantData { + if o == nil || common.IsNil(o.Merchant) { + var ret MerchantData + return ret + } + return *o.Merchant +} + +// GetMerchantOk returns a tuple with the Merchant field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyV3) GetMerchantOk() (*MerchantData, bool) { + if o == nil || common.IsNil(o.Merchant) { + return nil, false + } + return o.Merchant, true +} + +// HasMerchant returns a boolean if a field has been set. +func (o *CounterpartyV3) HasMerchant() bool { + if o != nil && !common.IsNil(o.Merchant) { + return true + } + + return false +} + +// SetMerchant gets a reference to the given MerchantData and assigns it to the Merchant field. +func (o *CounterpartyV3) SetMerchant(v MerchantData) { + o.Merchant = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *CounterpartyV3) GetTransferInstrumentId() string { + if o == nil || common.IsNil(o.TransferInstrumentId) { + var ret string + return ret + } + return *o.TransferInstrumentId +} + +// GetTransferInstrumentIdOk returns a tuple with the TransferInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyV3) GetTransferInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransferInstrumentId) { + return nil, false + } + return o.TransferInstrumentId, true +} + +// HasTransferInstrumentId returns a boolean if a field has been set. +func (o *CounterpartyV3) HasTransferInstrumentId() bool { + if o != nil && !common.IsNil(o.TransferInstrumentId) { + return true + } + + return false +} + +// SetTransferInstrumentId gets a reference to the given string and assigns it to the TransferInstrumentId field. +func (o *CounterpartyV3) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o CounterpartyV3) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyV3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.Merchant) { + toSerialize["merchant"] = o.Merchant + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableCounterpartyV3 struct { + value *CounterpartyV3 + isSet bool +} + +func (v NullableCounterpartyV3) Get() *CounterpartyV3 { + return v.value +} + +func (v *NullableCounterpartyV3) Set(val *CounterpartyV3) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyV3) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyV3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyV3(val *CounterpartyV3) *NullableCounterpartyV3 { + return &NullableCounterpartyV3{value: val, isSet: true} +} + +func (v NullableCounterpartyV3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyV3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_cz_local_account_identification.go b/src/transferwebhooks/model_cz_local_account_identification.go new file mode 100644 index 000000000..2174e720f --- /dev/null +++ b/src/transferwebhooks/model_cz_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the CZLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CZLocalAccountIdentification{} + +// CZLocalAccountIdentification struct for CZLocalAccountIdentification +type CZLocalAccountIdentification struct { + // The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) + AccountNumber string `json:"accountNumber"` + // The 4-digit bank code (Kód banky), without separators or whitespace. + BankCode string `json:"bankCode"` + // **czLocal** + Type string `json:"type"` +} + +// NewCZLocalAccountIdentification instantiates a new CZLocalAccountIdentification 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 NewCZLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *CZLocalAccountIdentification { + this := CZLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.BankCode = bankCode + this.Type = type_ + return &this +} + +// NewCZLocalAccountIdentificationWithDefaults instantiates a new CZLocalAccountIdentification 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 NewCZLocalAccountIdentificationWithDefaults() *CZLocalAccountIdentification { + this := CZLocalAccountIdentification{} + var type_ string = "czLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *CZLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *CZLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *CZLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBankCode returns the BankCode field value +func (o *CZLocalAccountIdentification) GetBankCode() string { + if o == nil { + var ret string + return ret + } + + return o.BankCode +} + +// GetBankCodeOk returns a tuple with the BankCode field value +// and a boolean to check if the value has been set. +func (o *CZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BankCode, true +} + +// SetBankCode sets field value +func (o *CZLocalAccountIdentification) SetBankCode(v string) { + o.BankCode = v +} + +// GetType returns the Type field value +func (o *CZLocalAccountIdentification) 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 *CZLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CZLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o CZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bankCode"] = o.BankCode + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableCZLocalAccountIdentification struct { + value *CZLocalAccountIdentification + isSet bool +} + +func (v NullableCZLocalAccountIdentification) Get() *CZLocalAccountIdentification { + return v.value +} + +func (v *NullableCZLocalAccountIdentification) Set(val *CZLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableCZLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableCZLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCZLocalAccountIdentification(val *CZLocalAccountIdentification) *NullableCZLocalAccountIdentification { + return &NullableCZLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableCZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCZLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *CZLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "czLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_dk_local_account_identification.go b/src/transferwebhooks/model_dk_local_account_identification.go new file mode 100644 index 000000000..405fd649f --- /dev/null +++ b/src/transferwebhooks/model_dk_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the DKLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &DKLocalAccountIdentification{} + +// DKLocalAccountIdentification struct for DKLocalAccountIdentification +type DKLocalAccountIdentification struct { + // The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + AccountNumber string `json:"accountNumber"` + // The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + BankCode string `json:"bankCode"` + // **dkLocal** + Type string `json:"type"` +} + +// NewDKLocalAccountIdentification instantiates a new DKLocalAccountIdentification 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 NewDKLocalAccountIdentification(accountNumber string, bankCode string, type_ string) *DKLocalAccountIdentification { + this := DKLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.BankCode = bankCode + this.Type = type_ + return &this +} + +// NewDKLocalAccountIdentificationWithDefaults instantiates a new DKLocalAccountIdentification 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 NewDKLocalAccountIdentificationWithDefaults() *DKLocalAccountIdentification { + this := DKLocalAccountIdentification{} + var type_ string = "dkLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *DKLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *DKLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *DKLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBankCode returns the BankCode field value +func (o *DKLocalAccountIdentification) GetBankCode() string { + if o == nil { + var ret string + return ret + } + + return o.BankCode +} + +// GetBankCodeOk returns a tuple with the BankCode field value +// and a boolean to check if the value has been set. +func (o *DKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BankCode, true +} + +// SetBankCode sets field value +func (o *DKLocalAccountIdentification) SetBankCode(v string) { + o.BankCode = v +} + +// GetType returns the Type field value +func (o *DKLocalAccountIdentification) 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 *DKLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DKLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o DKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bankCode"] = o.BankCode + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableDKLocalAccountIdentification struct { + value *DKLocalAccountIdentification + isSet bool +} + +func (v NullableDKLocalAccountIdentification) Get() *DKLocalAccountIdentification { + return v.value +} + +func (v *NullableDKLocalAccountIdentification) Set(val *DKLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableDKLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableDKLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDKLocalAccountIdentification(val *DKLocalAccountIdentification) *NullableDKLocalAccountIdentification { + return &NullableDKLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableDKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDKLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *DKLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "dkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_hk_local_account_identification.go b/src/transferwebhooks/model_hk_local_account_identification.go new file mode 100644 index 000000000..b97f7e1b3 --- /dev/null +++ b/src/transferwebhooks/model_hk_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the HKLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &HKLocalAccountIdentification{} + +// HKLocalAccountIdentification struct for HKLocalAccountIdentification +type HKLocalAccountIdentification struct { + // The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. + AccountNumber string `json:"accountNumber"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` + // **hkLocal** + Type string `json:"type"` +} + +// NewHKLocalAccountIdentification instantiates a new HKLocalAccountIdentification 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 NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { + this := HKLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.ClearingCode = clearingCode + this.Type = type_ + return &this +} + +// NewHKLocalAccountIdentificationWithDefaults instantiates a new HKLocalAccountIdentification 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 NewHKLocalAccountIdentificationWithDefaults() *HKLocalAccountIdentification { + this := HKLocalAccountIdentification{} + var type_ string = "hkLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *HKLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *HKLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { + if o == nil { + var ret string + return ret + } + + return o.ClearingCode +} + +// GetClearingCodeOk returns a tuple with the ClearingCode field value +// and a boolean to check if the value has been set. +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClearingCode, true +} + +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v +} + +// GetType returns the Type field value +func (o *HKLocalAccountIdentification) 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 *HKLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HKLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["clearingCode"] = o.ClearingCode + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableHKLocalAccountIdentification struct { + value *HKLocalAccountIdentification + isSet bool +} + +func (v NullableHKLocalAccountIdentification) Get() *HKLocalAccountIdentification { + return v.value +} + +func (v *NullableHKLocalAccountIdentification) Set(val *HKLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableHKLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableHKLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHKLocalAccountIdentification(val *HKLocalAccountIdentification) *NullableHKLocalAccountIdentification { + return &NullableHKLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableHKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHKLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *HKLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "hkLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_hu_local_account_identification.go b/src/transferwebhooks/model_hu_local_account_identification.go new file mode 100644 index 000000000..8d9c7901d --- /dev/null +++ b/src/transferwebhooks/model_hu_local_account_identification.go @@ -0,0 +1,157 @@ +/* +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/v8/src/common" +) + +// checks if the HULocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &HULocalAccountIdentification{} + +// HULocalAccountIdentification struct for HULocalAccountIdentification +type HULocalAccountIdentification struct { + // The 24-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // **huLocal** + Type string `json:"type"` +} + +// NewHULocalAccountIdentification instantiates a new HULocalAccountIdentification 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 NewHULocalAccountIdentification(accountNumber string, type_ string) *HULocalAccountIdentification { + this := HULocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewHULocalAccountIdentificationWithDefaults instantiates a new HULocalAccountIdentification 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 NewHULocalAccountIdentificationWithDefaults() *HULocalAccountIdentification { + this := HULocalAccountIdentification{} + var type_ string = "huLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *HULocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *HULocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *HULocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *HULocalAccountIdentification) 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 *HULocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HULocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o HULocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HULocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableHULocalAccountIdentification struct { + value *HULocalAccountIdentification + isSet bool +} + +func (v NullableHULocalAccountIdentification) Get() *HULocalAccountIdentification { + return v.value +} + +func (v *NullableHULocalAccountIdentification) Set(val *HULocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableHULocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableHULocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHULocalAccountIdentification(val *HULocalAccountIdentification) *NullableHULocalAccountIdentification { + return &NullableHULocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableHULocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHULocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *HULocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "huLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_iban_account_identification.go b/src/transferwebhooks/model_iban_account_identification.go new file mode 100644 index 000000000..43e3365c0 --- /dev/null +++ b/src/transferwebhooks/model_iban_account_identification.go @@ -0,0 +1,157 @@ +/* +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/v8/src/common" +) + +// checks if the IbanAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &IbanAccountIdentification{} + +// IbanAccountIdentification struct for IbanAccountIdentification +type IbanAccountIdentification struct { + // The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + Iban string `json:"iban"` + // **iban** + Type string `json:"type"` +} + +// NewIbanAccountIdentification instantiates a new IbanAccountIdentification 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 NewIbanAccountIdentification(iban string, type_ string) *IbanAccountIdentification { + this := IbanAccountIdentification{} + this.Iban = iban + this.Type = type_ + return &this +} + +// NewIbanAccountIdentificationWithDefaults instantiates a new IbanAccountIdentification 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 NewIbanAccountIdentificationWithDefaults() *IbanAccountIdentification { + this := IbanAccountIdentification{} + var type_ string = "iban" + this.Type = type_ + return &this +} + +// GetIban returns the Iban field value +func (o *IbanAccountIdentification) GetIban() string { + if o == nil { + var ret string + return ret + } + + return o.Iban +} + +// GetIbanOk returns a tuple with the Iban field value +// and a boolean to check if the value has been set. +func (o *IbanAccountIdentification) GetIbanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iban, true +} + +// SetIban sets field value +func (o *IbanAccountIdentification) SetIban(v string) { + o.Iban = v +} + +// GetType returns the Type field value +func (o *IbanAccountIdentification) 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 *IbanAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *IbanAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o IbanAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IbanAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["iban"] = o.Iban + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableIbanAccountIdentification struct { + value *IbanAccountIdentification + isSet bool +} + +func (v NullableIbanAccountIdentification) Get() *IbanAccountIdentification { + return v.value +} + +func (v *NullableIbanAccountIdentification) Set(val *IbanAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableIbanAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableIbanAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIbanAccountIdentification(val *IbanAccountIdentification) *NullableIbanAccountIdentification { + return &NullableIbanAccountIdentification{value: val, isSet: true} +} + +func (v NullableIbanAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIbanAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *IbanAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "iban" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_internal_category_data.go b/src/transferwebhooks/model_internal_category_data.go new file mode 100644 index 000000000..6a5b3c636 --- /dev/null +++ b/src/transferwebhooks/model_internal_category_data.go @@ -0,0 +1,214 @@ +/* +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/v8/src/common" +) + +// checks if the InternalCategoryData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &InternalCategoryData{} + +// InternalCategoryData struct for InternalCategoryData +type InternalCategoryData struct { + // The capture's merchant reference included in the transfer. + ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` + // The capture reference included in the transfer. + ModificationPspReference *string `json:"modificationPspReference,omitempty"` + // **internal** + Type *string `json:"type,omitempty"` +} + +// NewInternalCategoryData instantiates a new InternalCategoryData 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 NewInternalCategoryData() *InternalCategoryData { + this := InternalCategoryData{} + var type_ string = "internal" + this.Type = &type_ + return &this +} + +// NewInternalCategoryDataWithDefaults instantiates a new InternalCategoryData 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 NewInternalCategoryDataWithDefaults() *InternalCategoryData { + this := InternalCategoryData{} + var type_ string = "internal" + this.Type = &type_ + return &this +} + +// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. +func (o *InternalCategoryData) GetModificationMerchantReference() string { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + var ret string + return ret + } + return *o.ModificationMerchantReference +} + +// GetModificationMerchantReferenceOk returns a tuple with the ModificationMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalCategoryData) GetModificationMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + return nil, false + } + return o.ModificationMerchantReference, true +} + +// HasModificationMerchantReference returns a boolean if a field has been set. +func (o *InternalCategoryData) HasModificationMerchantReference() bool { + if o != nil && !common.IsNil(o.ModificationMerchantReference) { + return true + } + + return false +} + +// SetModificationMerchantReference gets a reference to the given string and assigns it to the ModificationMerchantReference field. +func (o *InternalCategoryData) SetModificationMerchantReference(v string) { + o.ModificationMerchantReference = &v +} + +// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. +func (o *InternalCategoryData) GetModificationPspReference() string { + if o == nil || common.IsNil(o.ModificationPspReference) { + var ret string + return ret + } + return *o.ModificationPspReference +} + +// GetModificationPspReferenceOk returns a tuple with the ModificationPspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalCategoryData) GetModificationPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationPspReference) { + return nil, false + } + return o.ModificationPspReference, true +} + +// HasModificationPspReference returns a boolean if a field has been set. +func (o *InternalCategoryData) HasModificationPspReference() bool { + if o != nil && !common.IsNil(o.ModificationPspReference) { + return true + } + + return false +} + +// SetModificationPspReference gets a reference to the given string and assigns it to the ModificationPspReference field. +func (o *InternalCategoryData) SetModificationPspReference(v string) { + o.ModificationPspReference = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InternalCategoryData) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalCategoryData) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *InternalCategoryData) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *InternalCategoryData) SetType(v string) { + o.Type = &v +} + +func (o InternalCategoryData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalCategoryData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ModificationMerchantReference) { + toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference + } + if !common.IsNil(o.ModificationPspReference) { + toSerialize["modificationPspReference"] = o.ModificationPspReference + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableInternalCategoryData struct { + value *InternalCategoryData + isSet bool +} + +func (v NullableInternalCategoryData) Get() *InternalCategoryData { + return v.value +} + +func (v *NullableInternalCategoryData) Set(val *InternalCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableInternalCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalCategoryData(val *InternalCategoryData) *NullableInternalCategoryData { + return &NullableInternalCategoryData{value: val, isSet: true} +} + +func (v NullableInternalCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *InternalCategoryData) isValidType() bool { + var allowedEnumValues = []string{ "internal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_issued_card.go b/src/transferwebhooks/model_issued_card.go new file mode 100644 index 000000000..6a03d6558 --- /dev/null +++ b/src/transferwebhooks/model_issued_card.go @@ -0,0 +1,305 @@ +/* +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/v8/src/common" +) + +// checks if the IssuedCard type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &IssuedCard{} + +// IssuedCard struct for IssuedCard +type IssuedCard struct { + // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. + PanEntryMode *string `json:"panEntryMode,omitempty"` + // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. + ProcessingType *string `json:"processingType,omitempty"` + RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` + // **issuedCard** + Type *string `json:"type,omitempty"` + // The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. + ValidationFacts []TransferNotificationValidationFact `json:"validationFacts,omitempty"` +} + +// NewIssuedCard instantiates a new IssuedCard 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 NewIssuedCard() *IssuedCard { + this := IssuedCard{} + var type_ string = "issuedCard" + this.Type = &type_ + return &this +} + +// NewIssuedCardWithDefaults instantiates a new IssuedCard 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 NewIssuedCardWithDefaults() *IssuedCard { + this := IssuedCard{} + var type_ string = "issuedCard" + this.Type = &type_ + return &this +} + +// GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. +func (o *IssuedCard) GetPanEntryMode() string { + if o == nil || common.IsNil(o.PanEntryMode) { + var ret string + return ret + } + return *o.PanEntryMode +} + +// GetPanEntryModeOk returns a tuple with the PanEntryMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetPanEntryModeOk() (*string, bool) { + if o == nil || common.IsNil(o.PanEntryMode) { + return nil, false + } + return o.PanEntryMode, true +} + +// HasPanEntryMode returns a boolean if a field has been set. +func (o *IssuedCard) HasPanEntryMode() bool { + if o != nil && !common.IsNil(o.PanEntryMode) { + return true + } + + return false +} + +// SetPanEntryMode gets a reference to the given string and assigns it to the PanEntryMode field. +func (o *IssuedCard) SetPanEntryMode(v string) { + o.PanEntryMode = &v +} + +// GetProcessingType returns the ProcessingType field value if set, zero value otherwise. +func (o *IssuedCard) GetProcessingType() string { + if o == nil || common.IsNil(o.ProcessingType) { + var ret string + return ret + } + return *o.ProcessingType +} + +// GetProcessingTypeOk returns a tuple with the ProcessingType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetProcessingTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ProcessingType) { + return nil, false + } + return o.ProcessingType, true +} + +// HasProcessingType returns a boolean if a field has been set. +func (o *IssuedCard) HasProcessingType() bool { + if o != nil && !common.IsNil(o.ProcessingType) { + return true + } + + return false +} + +// SetProcessingType gets a reference to the given string and assigns it to the ProcessingType field. +func (o *IssuedCard) SetProcessingType(v string) { + o.ProcessingType = &v +} + +// GetRelayedAuthorisationData returns the RelayedAuthorisationData field value if set, zero value otherwise. +func (o *IssuedCard) GetRelayedAuthorisationData() RelayedAuthorisationData { + if o == nil || common.IsNil(o.RelayedAuthorisationData) { + var ret RelayedAuthorisationData + return ret + } + return *o.RelayedAuthorisationData +} + +// GetRelayedAuthorisationDataOk returns a tuple with the RelayedAuthorisationData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetRelayedAuthorisationDataOk() (*RelayedAuthorisationData, bool) { + if o == nil || common.IsNil(o.RelayedAuthorisationData) { + return nil, false + } + return o.RelayedAuthorisationData, true +} + +// HasRelayedAuthorisationData returns a boolean if a field has been set. +func (o *IssuedCard) HasRelayedAuthorisationData() bool { + if o != nil && !common.IsNil(o.RelayedAuthorisationData) { + return true + } + + return false +} + +// SetRelayedAuthorisationData gets a reference to the given RelayedAuthorisationData and assigns it to the RelayedAuthorisationData field. +func (o *IssuedCard) SetRelayedAuthorisationData(v RelayedAuthorisationData) { + o.RelayedAuthorisationData = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *IssuedCard) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *IssuedCard) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *IssuedCard) SetType(v string) { + o.Type = &v +} + +// GetValidationFacts returns the ValidationFacts field value if set, zero value otherwise. +func (o *IssuedCard) GetValidationFacts() []TransferNotificationValidationFact { + if o == nil || common.IsNil(o.ValidationFacts) { + var ret []TransferNotificationValidationFact + return ret + } + return o.ValidationFacts +} + +// GetValidationFactsOk returns a tuple with the ValidationFacts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IssuedCard) GetValidationFactsOk() ([]TransferNotificationValidationFact, bool) { + if o == nil || common.IsNil(o.ValidationFacts) { + return nil, false + } + return o.ValidationFacts, true +} + +// HasValidationFacts returns a boolean if a field has been set. +func (o *IssuedCard) HasValidationFacts() bool { + if o != nil && !common.IsNil(o.ValidationFacts) { + return true + } + + return false +} + +// SetValidationFacts gets a reference to the given []TransferNotificationValidationFact and assigns it to the ValidationFacts field. +func (o *IssuedCard) SetValidationFacts(v []TransferNotificationValidationFact) { + o.ValidationFacts = v +} + +func (o IssuedCard) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IssuedCard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.PanEntryMode) { + toSerialize["panEntryMode"] = o.PanEntryMode + } + if !common.IsNil(o.ProcessingType) { + toSerialize["processingType"] = o.ProcessingType + } + if !common.IsNil(o.RelayedAuthorisationData) { + toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !common.IsNil(o.ValidationFacts) { + toSerialize["validationFacts"] = o.ValidationFacts + } + return toSerialize, nil +} + +type NullableIssuedCard struct { + value *IssuedCard + isSet bool +} + +func (v NullableIssuedCard) Get() *IssuedCard { + return v.value +} + +func (v *NullableIssuedCard) Set(val *IssuedCard) { + v.value = val + v.isSet = true +} + +func (v NullableIssuedCard) IsSet() bool { + return v.isSet +} + +func (v *NullableIssuedCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIssuedCard(val *IssuedCard) *NullableIssuedCard { + return &NullableIssuedCard{value: val, isSet: true} +} + +func (v NullableIssuedCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIssuedCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *IssuedCard) isValidPanEntryMode() bool { + var allowedEnumValues = []string{ "chip", "cof", "contactless", "ecommerce", "magstripe", "manual", "token" } + for _, allowed := range allowedEnumValues { + if o.GetPanEntryMode() == allowed { + return true + } + } + return false +} +func (o *IssuedCard) isValidProcessingType() bool { + var allowedEnumValues = []string{ "atmWithdraw", "balanceInquiry", "ecommerce", "moto", "pos", "purchaseWithCashback", "recurring", "token" } + for _, allowed := range allowedEnumValues { + if o.GetProcessingType() == allowed { + return true + } + } + return false +} +func (o *IssuedCard) isValidType() bool { + var allowedEnumValues = []string{ "issuedCard" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_merchant_data.go b/src/transferwebhooks/model_merchant_data.go new file mode 100644 index 000000000..cc6a51346 --- /dev/null +++ b/src/transferwebhooks/model_merchant_data.go @@ -0,0 +1,274 @@ +/* +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/v8/src/common" +) + +// checks if the MerchantData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &MerchantData{} + +// MerchantData struct for MerchantData +type MerchantData struct { + // The unique identifier of the merchant's acquirer. + AcquirerId *string `json:"acquirerId,omitempty"` + // The merchant category code. + Mcc *string `json:"mcc,omitempty"` + // The merchant identifier. + MerchantId *string `json:"merchantId,omitempty"` + NameLocation *NameLocation `json:"nameLocation,omitempty"` + // The merchant postal code. + PostalCode *string `json:"postalCode,omitempty"` +} + +// NewMerchantData instantiates a new MerchantData 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 NewMerchantData() *MerchantData { + this := MerchantData{} + return &this +} + +// NewMerchantDataWithDefaults instantiates a new MerchantData 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 NewMerchantDataWithDefaults() *MerchantData { + this := MerchantData{} + return &this +} + +// GetAcquirerId returns the AcquirerId field value if set, zero value otherwise. +func (o *MerchantData) GetAcquirerId() string { + if o == nil || common.IsNil(o.AcquirerId) { + var ret string + return ret + } + return *o.AcquirerId +} + +// GetAcquirerIdOk returns a tuple with the AcquirerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetAcquirerIdOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerId) { + return nil, false + } + return o.AcquirerId, true +} + +// HasAcquirerId returns a boolean if a field has been set. +func (o *MerchantData) HasAcquirerId() bool { + if o != nil && !common.IsNil(o.AcquirerId) { + return true + } + + return false +} + +// SetAcquirerId gets a reference to the given string and assigns it to the AcquirerId field. +func (o *MerchantData) SetAcquirerId(v string) { + o.AcquirerId = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *MerchantData) GetMcc() string { + if o == nil || common.IsNil(o.Mcc) { + var ret string + return ret + } + return *o.Mcc +} + +// GetMccOk returns a tuple with the Mcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetMccOk() (*string, bool) { + if o == nil || common.IsNil(o.Mcc) { + return nil, false + } + return o.Mcc, true +} + +// HasMcc returns a boolean if a field has been set. +func (o *MerchantData) HasMcc() bool { + if o != nil && !common.IsNil(o.Mcc) { + return true + } + + return false +} + +// SetMcc gets a reference to the given string and assigns it to the Mcc field. +func (o *MerchantData) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantId returns the MerchantId field value if set, zero value otherwise. +func (o *MerchantData) GetMerchantId() string { + if o == nil || common.IsNil(o.MerchantId) { + var ret string + return ret + } + return *o.MerchantId +} + +// GetMerchantIdOk returns a tuple with the MerchantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetMerchantIdOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantId) { + return nil, false + } + return o.MerchantId, true +} + +// HasMerchantId returns a boolean if a field has been set. +func (o *MerchantData) HasMerchantId() bool { + if o != nil && !common.IsNil(o.MerchantId) { + return true + } + + return false +} + +// SetMerchantId gets a reference to the given string and assigns it to the MerchantId field. +func (o *MerchantData) SetMerchantId(v string) { + o.MerchantId = &v +} + +// GetNameLocation returns the NameLocation field value if set, zero value otherwise. +func (o *MerchantData) GetNameLocation() NameLocation { + if o == nil || common.IsNil(o.NameLocation) { + var ret NameLocation + return ret + } + return *o.NameLocation +} + +// GetNameLocationOk returns a tuple with the NameLocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetNameLocationOk() (*NameLocation, bool) { + if o == nil || common.IsNil(o.NameLocation) { + return nil, false + } + return o.NameLocation, true +} + +// HasNameLocation returns a boolean if a field has been set. +func (o *MerchantData) HasNameLocation() bool { + if o != nil && !common.IsNil(o.NameLocation) { + return true + } + + return false +} + +// SetNameLocation gets a reference to the given NameLocation and assigns it to the NameLocation field. +func (o *MerchantData) SetNameLocation(v NameLocation) { + o.NameLocation = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *MerchantData) GetPostalCode() string { + if o == nil || common.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantData) GetPostalCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *MerchantData) HasPostalCode() bool { + if o != nil && !common.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *MerchantData) SetPostalCode(v string) { + o.PostalCode = &v +} + +func (o MerchantData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MerchantData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcquirerId) { + toSerialize["acquirerId"] = o.AcquirerId + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantId) { + toSerialize["merchantId"] = o.MerchantId + } + if !common.IsNil(o.NameLocation) { + toSerialize["nameLocation"] = o.NameLocation + } + if !common.IsNil(o.PostalCode) { + toSerialize["postalCode"] = o.PostalCode + } + return toSerialize, nil +} + +type NullableMerchantData struct { + value *MerchantData + isSet bool +} + +func (v NullableMerchantData) Get() *MerchantData { + return v.value +} + +func (v *NullableMerchantData) Set(val *MerchantData) { + v.value = val + v.isSet = true +} + +func (v NullableMerchantData) IsSet() bool { + return v.isSet +} + +func (v *NullableMerchantData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMerchantData(val *MerchantData) *NullableMerchantData { + return &NullableMerchantData{value: val, isSet: true} +} + +func (v NullableMerchantData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMerchantData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_modification.go b/src/transferwebhooks/model_modification.go new file mode 100644 index 000000000..65bdf7131 --- /dev/null +++ b/src/transferwebhooks/model_modification.go @@ -0,0 +1,284 @@ +/* +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/v8/src/common" +) + +// checks if the Modification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Modification{} + +// Modification struct for Modification +type Modification struct { + // The direction of the money movement. + Direction *string `json:"direction,omitempty"` + // Our reference for the modification. + Id *string `json:"id,omitempty"` + // Your reference for the modification, used internally within your platform. + Reference *string `json:"reference,omitempty"` + // The status of the transfer event. + Status *string `json:"status,omitempty"` + // The type of transfer modification. + Type *string `json:"type,omitempty"` +} + +// NewModification instantiates a new Modification 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 NewModification() *Modification { + this := Modification{} + return &this +} + +// NewModificationWithDefaults instantiates a new Modification 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 NewModificationWithDefaults() *Modification { + this := Modification{} + return &this +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *Modification) GetDirection() string { + if o == nil || common.IsNil(o.Direction) { + var ret string + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetDirectionOk() (*string, bool) { + if o == nil || common.IsNil(o.Direction) { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *Modification) HasDirection() bool { + if o != nil && !common.IsNil(o.Direction) { + return true + } + + return false +} + +// SetDirection gets a reference to the given string and assigns it to the Direction field. +func (o *Modification) SetDirection(v string) { + o.Direction = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Modification) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Modification) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Modification) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *Modification) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *Modification) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *Modification) SetReference(v string) { + o.Reference = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Modification) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Modification) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Modification) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Modification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Modification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Modification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Modification) SetType(v string) { + o.Type = &v +} + +func (o Modification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Modification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Direction) { + toSerialize["direction"] = o.Direction + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableModification struct { + value *Modification + isSet bool +} + +func (v NullableModification) Get() *Modification { + return v.value +} + +func (v *NullableModification) Set(val *Modification) { + v.value = val + v.isSet = true +} + +func (v NullableModification) IsSet() bool { + return v.isSet +} + +func (v *NullableModification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModification(val *Modification) *NullableModification { + return &NullableModification{value: val, isSet: true} +} + +func (v NullableModification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *Modification) isValidStatus() bool { + var allowedEnumValues = []string{ "approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_name_location.go b/src/transferwebhooks/model_name_location.go new file mode 100644 index 000000000..8f160fb41 --- /dev/null +++ b/src/transferwebhooks/model_name_location.go @@ -0,0 +1,312 @@ +/* +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/v8/src/common" +) + +// checks if the NameLocation type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NameLocation{} + +// NameLocation struct for NameLocation +type NameLocation struct { + // The city where the merchant is located. + City *string `json:"city,omitempty"` + // The country where the merchant is located in [three-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + Country *string `json:"country,omitempty"` + // The home country in [three-digit country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled merchants such as embassies. + CountryOfOrigin *string `json:"countryOfOrigin,omitempty"` + // The name of the merchant's shop or service. + Name *string `json:"name,omitempty"` + // The raw data. + RawData *string `json:"rawData,omitempty"` + // The state where the merchant is located. + State *string `json:"state,omitempty"` +} + +// NewNameLocation instantiates a new NameLocation 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 NewNameLocation() *NameLocation { + this := NameLocation{} + return &this +} + +// NewNameLocationWithDefaults instantiates a new NameLocation 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 NewNameLocationWithDefaults() *NameLocation { + this := NameLocation{} + return &this +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *NameLocation) GetCity() string { + if o == nil || common.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetCityOk() (*string, bool) { + if o == nil || common.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *NameLocation) HasCity() bool { + if o != nil && !common.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *NameLocation) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *NameLocation) GetCountry() string { + if o == nil || common.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetCountryOk() (*string, bool) { + if o == nil || common.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *NameLocation) HasCountry() bool { + if o != nil && !common.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *NameLocation) SetCountry(v string) { + o.Country = &v +} + +// GetCountryOfOrigin returns the CountryOfOrigin field value if set, zero value otherwise. +func (o *NameLocation) GetCountryOfOrigin() string { + if o == nil || common.IsNil(o.CountryOfOrigin) { + var ret string + return ret + } + return *o.CountryOfOrigin +} + +// GetCountryOfOriginOk returns a tuple with the CountryOfOrigin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetCountryOfOriginOk() (*string, bool) { + if o == nil || common.IsNil(o.CountryOfOrigin) { + return nil, false + } + return o.CountryOfOrigin, true +} + +// HasCountryOfOrigin returns a boolean if a field has been set. +func (o *NameLocation) HasCountryOfOrigin() bool { + if o != nil && !common.IsNil(o.CountryOfOrigin) { + return true + } + + return false +} + +// SetCountryOfOrigin gets a reference to the given string and assigns it to the CountryOfOrigin field. +func (o *NameLocation) SetCountryOfOrigin(v string) { + o.CountryOfOrigin = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NameLocation) GetName() string { + if o == nil || common.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetNameOk() (*string, bool) { + if o == nil || common.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NameLocation) HasName() bool { + if o != nil && !common.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NameLocation) SetName(v string) { + o.Name = &v +} + +// GetRawData returns the RawData field value if set, zero value otherwise. +func (o *NameLocation) GetRawData() string { + if o == nil || common.IsNil(o.RawData) { + var ret string + return ret + } + return *o.RawData +} + +// GetRawDataOk returns a tuple with the RawData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetRawDataOk() (*string, bool) { + if o == nil || common.IsNil(o.RawData) { + return nil, false + } + return o.RawData, true +} + +// HasRawData returns a boolean if a field has been set. +func (o *NameLocation) HasRawData() bool { + if o != nil && !common.IsNil(o.RawData) { + return true + } + + return false +} + +// SetRawData gets a reference to the given string and assigns it to the RawData field. +func (o *NameLocation) SetRawData(v string) { + o.RawData = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *NameLocation) GetState() string { + if o == nil || common.IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NameLocation) GetStateOk() (*string, bool) { + if o == nil || common.IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *NameLocation) HasState() bool { + if o != nil && !common.IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *NameLocation) SetState(v string) { + o.State = &v +} + +func (o NameLocation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NameLocation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.CountryOfOrigin) { + toSerialize["countryOfOrigin"] = o.CountryOfOrigin + } + if !common.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !common.IsNil(o.RawData) { + toSerialize["rawData"] = o.RawData + } + if !common.IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableNameLocation struct { + value *NameLocation + isSet bool +} + +func (v NullableNameLocation) Get() *NameLocation { + return v.value +} + +func (v *NullableNameLocation) Set(val *NameLocation) { + v.value = val + v.isSet = true +} + +func (v NullableNameLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableNameLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNameLocation(val *NameLocation) *NullableNameLocation { + return &NullableNameLocation{value: val, isSet: true} +} + +func (v NullableNameLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNameLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_no_local_account_identification.go b/src/transferwebhooks/model_no_local_account_identification.go new file mode 100644 index 000000000..e782ea364 --- /dev/null +++ b/src/transferwebhooks/model_no_local_account_identification.go @@ -0,0 +1,157 @@ +/* +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/v8/src/common" +) + +// checks if the NOLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NOLocalAccountIdentification{} + +// NOLocalAccountIdentification struct for NOLocalAccountIdentification +type NOLocalAccountIdentification struct { + // The 11-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // **noLocal** + Type string `json:"type"` +} + +// NewNOLocalAccountIdentification instantiates a new NOLocalAccountIdentification 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 NewNOLocalAccountIdentification(accountNumber string, type_ string) *NOLocalAccountIdentification { + this := NOLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewNOLocalAccountIdentificationWithDefaults instantiates a new NOLocalAccountIdentification 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 NewNOLocalAccountIdentificationWithDefaults() *NOLocalAccountIdentification { + this := NOLocalAccountIdentification{} + var type_ string = "noLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *NOLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *NOLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *NOLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *NOLocalAccountIdentification) 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 *NOLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NOLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o NOLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NOLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableNOLocalAccountIdentification struct { + value *NOLocalAccountIdentification + isSet bool +} + +func (v NullableNOLocalAccountIdentification) Get() *NOLocalAccountIdentification { + return v.value +} + +func (v *NullableNOLocalAccountIdentification) Set(val *NOLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableNOLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableNOLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNOLocalAccountIdentification(val *NOLocalAccountIdentification) *NullableNOLocalAccountIdentification { + return &NullableNOLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableNOLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNOLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *NOLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "noLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_number_and_bic_account_identification.go b/src/transferwebhooks/model_number_and_bic_account_identification.go new file mode 100644 index 000000000..fa69f3d76 --- /dev/null +++ b/src/transferwebhooks/model_number_and_bic_account_identification.go @@ -0,0 +1,221 @@ +/* +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/v8/src/common" +) + +// checks if the NumberAndBicAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NumberAndBicAccountIdentification{} + +// NumberAndBicAccountIdentification struct for NumberAndBicAccountIdentification +type NumberAndBicAccountIdentification struct { + // The bank account number, without separators or whitespace. The length and format depends on the bank or country. + AccountNumber string `json:"accountNumber"` + AdditionalBankIdentification *AdditionalBankIdentification `json:"additionalBankIdentification,omitempty"` + // The bank's 8- or 11-character BIC or SWIFT code. + Bic string `json:"bic"` + // **numberAndBic** + Type string `json:"type"` +} + +// NewNumberAndBicAccountIdentification instantiates a new NumberAndBicAccountIdentification 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 NewNumberAndBicAccountIdentification(accountNumber string, bic string, type_ string) *NumberAndBicAccountIdentification { + this := NumberAndBicAccountIdentification{} + this.AccountNumber = accountNumber + this.Bic = bic + this.Type = type_ + return &this +} + +// NewNumberAndBicAccountIdentificationWithDefaults instantiates a new NumberAndBicAccountIdentification 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 NewNumberAndBicAccountIdentificationWithDefaults() *NumberAndBicAccountIdentification { + this := NumberAndBicAccountIdentification{} + var type_ string = "numberAndBic" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *NumberAndBicAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *NumberAndBicAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *NumberAndBicAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetAdditionalBankIdentification returns the AdditionalBankIdentification field value if set, zero value otherwise. +func (o *NumberAndBicAccountIdentification) GetAdditionalBankIdentification() AdditionalBankIdentification { + if o == nil || common.IsNil(o.AdditionalBankIdentification) { + var ret AdditionalBankIdentification + return ret + } + return *o.AdditionalBankIdentification +} + +// GetAdditionalBankIdentificationOk returns a tuple with the AdditionalBankIdentification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NumberAndBicAccountIdentification) GetAdditionalBankIdentificationOk() (*AdditionalBankIdentification, bool) { + if o == nil || common.IsNil(o.AdditionalBankIdentification) { + return nil, false + } + return o.AdditionalBankIdentification, true +} + +// HasAdditionalBankIdentification returns a boolean if a field has been set. +func (o *NumberAndBicAccountIdentification) HasAdditionalBankIdentification() bool { + if o != nil && !common.IsNil(o.AdditionalBankIdentification) { + return true + } + + return false +} + +// SetAdditionalBankIdentification gets a reference to the given AdditionalBankIdentification and assigns it to the AdditionalBankIdentification field. +func (o *NumberAndBicAccountIdentification) SetAdditionalBankIdentification(v AdditionalBankIdentification) { + o.AdditionalBankIdentification = &v +} + +// GetBic returns the Bic field value +func (o *NumberAndBicAccountIdentification) GetBic() string { + if o == nil { + var ret string + return ret + } + + return o.Bic +} + +// GetBicOk returns a tuple with the Bic field value +// and a boolean to check if the value has been set. +func (o *NumberAndBicAccountIdentification) GetBicOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bic, true +} + +// SetBic sets field value +func (o *NumberAndBicAccountIdentification) SetBic(v string) { + o.Bic = v +} + +// GetType returns the Type field value +func (o *NumberAndBicAccountIdentification) 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 *NumberAndBicAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NumberAndBicAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o NumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NumberAndBicAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + if !common.IsNil(o.AdditionalBankIdentification) { + toSerialize["additionalBankIdentification"] = o.AdditionalBankIdentification + } + toSerialize["bic"] = o.Bic + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableNumberAndBicAccountIdentification struct { + value *NumberAndBicAccountIdentification + isSet bool +} + +func (v NullableNumberAndBicAccountIdentification) Get() *NumberAndBicAccountIdentification { + return v.value +} + +func (v *NullableNumberAndBicAccountIdentification) Set(val *NumberAndBicAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableNumberAndBicAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableNumberAndBicAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNumberAndBicAccountIdentification(val *NumberAndBicAccountIdentification) *NullableNumberAndBicAccountIdentification { + return &NullableNumberAndBicAccountIdentification{value: val, isSet: true} +} + +func (v NullableNumberAndBicAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNumberAndBicAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *NumberAndBicAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "numberAndBic" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_nz_local_account_identification.go b/src/transferwebhooks/model_nz_local_account_identification.go new file mode 100644 index 000000000..0362e045d --- /dev/null +++ b/src/transferwebhooks/model_nz_local_account_identification.go @@ -0,0 +1,157 @@ +/* +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/v8/src/common" +) + +// checks if the NZLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &NZLocalAccountIdentification{} + +// NZLocalAccountIdentification struct for NZLocalAccountIdentification +type NZLocalAccountIdentification struct { + // The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. + AccountNumber string `json:"accountNumber"` + // **nzLocal** + Type string `json:"type"` +} + +// NewNZLocalAccountIdentification instantiates a new NZLocalAccountIdentification 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 NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewNZLocalAccountIdentificationWithDefaults instantiates a new NZLocalAccountIdentification 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 NewNZLocalAccountIdentificationWithDefaults() *NZLocalAccountIdentification { + this := NZLocalAccountIdentification{} + var type_ string = "nzLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *NZLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *NZLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *NZLocalAccountIdentification) 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 *NZLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NZLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableNZLocalAccountIdentification struct { + value *NZLocalAccountIdentification + isSet bool +} + +func (v NullableNZLocalAccountIdentification) Get() *NZLocalAccountIdentification { + return v.value +} + +func (v *NullableNZLocalAccountIdentification) Set(val *NZLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableNZLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableNZLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNZLocalAccountIdentification(val *NZLocalAccountIdentification) *NullableNZLocalAccountIdentification { + return &NullableNZLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableNZLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNZLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *NZLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "nzLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_party_identification.go b/src/transferwebhooks/model_party_identification.go new file mode 100644 index 000000000..bb73afd6f --- /dev/null +++ b/src/transferwebhooks/model_party_identification.go @@ -0,0 +1,352 @@ +/* +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/v8/src/common" +) + +// checks if the PartyIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PartyIdentification{} + +// PartyIdentification struct for PartyIdentification +type PartyIdentification struct { + Address *Address `json:"address,omitempty"` + // The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Should not be before January 1, 1900. Allowed only when `type` is **individual**. + DateOfBirth *string `json:"dateOfBirth,omitempty"` + // First name of the individual. Allowed only when `type` is **individual**. + FirstName *string `json:"firstName,omitempty"` + // The name of the entity. + FullName string `json:"fullName"` + // Last name of the individual. Allowed only when `type` is **individual**. + LastName *string `json:"lastName,omitempty"` + // A unique reference to identify the party or counterparty involved in transfers. This identifier ensures consistency and uniqueness throughout all transactions initiated to and from the same party. For example, your client's unique wallet or payee ID. + Reference *string `json:"reference,omitempty"` + // The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + Type *string `json:"type,omitempty"` +} + +// NewPartyIdentification instantiates a new PartyIdentification 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 NewPartyIdentification(fullName string) *PartyIdentification { + this := PartyIdentification{} + this.FullName = fullName + var type_ string = "unknown" + this.Type = &type_ + return &this +} + +// NewPartyIdentificationWithDefaults instantiates a new PartyIdentification 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 NewPartyIdentificationWithDefaults() *PartyIdentification { + this := PartyIdentification{} + var type_ string = "unknown" + this.Type = &type_ + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *PartyIdentification) GetAddress() Address { + if o == nil || common.IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetAddressOk() (*Address, bool) { + if o == nil || common.IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *PartyIdentification) HasAddress() bool { + if o != nil && !common.IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *PartyIdentification) SetAddress(v Address) { + o.Address = &v +} + +// GetDateOfBirth returns the DateOfBirth field value if set, zero value otherwise. +func (o *PartyIdentification) GetDateOfBirth() string { + if o == nil || common.IsNil(o.DateOfBirth) { + var ret string + return ret + } + return *o.DateOfBirth +} + +// GetDateOfBirthOk returns a tuple with the DateOfBirth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetDateOfBirthOk() (*string, bool) { + if o == nil || common.IsNil(o.DateOfBirth) { + return nil, false + } + return o.DateOfBirth, true +} + +// HasDateOfBirth returns a boolean if a field has been set. +func (o *PartyIdentification) HasDateOfBirth() bool { + if o != nil && !common.IsNil(o.DateOfBirth) { + return true + } + + return false +} + +// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field. +func (o *PartyIdentification) SetDateOfBirth(v string) { + o.DateOfBirth = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *PartyIdentification) GetFirstName() string { + if o == nil || common.IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetFirstNameOk() (*string, bool) { + if o == nil || common.IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *PartyIdentification) HasFirstName() bool { + if o != nil && !common.IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *PartyIdentification) SetFirstName(v string) { + o.FirstName = &v +} + +// GetFullName returns the FullName field value +func (o *PartyIdentification) GetFullName() string { + if o == nil { + var ret string + return ret + } + + return o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetFullNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FullName, true +} + +// SetFullName sets field value +func (o *PartyIdentification) SetFullName(v string) { + o.FullName = v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *PartyIdentification) GetLastName() string { + if o == nil || common.IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetLastNameOk() (*string, bool) { + if o == nil || common.IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *PartyIdentification) HasLastName() bool { + if o != nil && !common.IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *PartyIdentification) SetLastName(v string) { + o.LastName = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *PartyIdentification) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *PartyIdentification) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *PartyIdentification) SetReference(v string) { + o.Reference = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PartyIdentification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartyIdentification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PartyIdentification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PartyIdentification) SetType(v string) { + o.Type = &v +} + +func (o PartyIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartyIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !common.IsNil(o.DateOfBirth) { + toSerialize["dateOfBirth"] = o.DateOfBirth + } + if !common.IsNil(o.FirstName) { + toSerialize["firstName"] = o.FirstName + } + toSerialize["fullName"] = o.FullName + if !common.IsNil(o.LastName) { + toSerialize["lastName"] = o.LastName + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullablePartyIdentification struct { + value *PartyIdentification + isSet bool +} + +func (v NullablePartyIdentification) Get() *PartyIdentification { + return v.value +} + +func (v *NullablePartyIdentification) Set(val *PartyIdentification) { + v.value = val + v.isSet = true +} + +func (v NullablePartyIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullablePartyIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartyIdentification(val *PartyIdentification) *NullablePartyIdentification { + return &NullablePartyIdentification{value: val, isSet: true} +} + +func (v NullablePartyIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartyIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PartyIdentification) isValidType() bool { + var allowedEnumValues = []string{ "individual", "organization", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_payment_instrument.go b/src/transferwebhooks/model_payment_instrument.go new file mode 100644 index 000000000..8185fa62f --- /dev/null +++ b/src/transferwebhooks/model_payment_instrument.go @@ -0,0 +1,238 @@ +/* +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/v8/src/common" +) + +// checks if the PaymentInstrument type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrument{} + +// PaymentInstrument struct for PaymentInstrument +type PaymentInstrument struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` + // The type of wallet the network token is associated with. + TokenType *string `json:"tokenType,omitempty"` +} + +// NewPaymentInstrument instantiates a new PaymentInstrument 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 NewPaymentInstrument() *PaymentInstrument { + this := PaymentInstrument{} + return &this +} + +// NewPaymentInstrumentWithDefaults instantiates a new PaymentInstrument 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 NewPaymentInstrumentWithDefaults() *PaymentInstrument { + this := PaymentInstrument{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentInstrument) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentInstrument) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PaymentInstrument) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PaymentInstrument) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PaymentInstrument) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PaymentInstrument) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *PaymentInstrument) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *PaymentInstrument) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *PaymentInstrument) SetReference(v string) { + o.Reference = &v +} + +// GetTokenType returns the TokenType field value if set, zero value otherwise. +func (o *PaymentInstrument) GetTokenType() string { + if o == nil || common.IsNil(o.TokenType) { + var ret string + return ret + } + return *o.TokenType +} + +// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrument) GetTokenTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.TokenType) { + return nil, false + } + return o.TokenType, true +} + +// HasTokenType returns a boolean if a field has been set. +func (o *PaymentInstrument) HasTokenType() bool { + if o != nil && !common.IsNil(o.TokenType) { + return true + } + + return false +} + +// SetTokenType gets a reference to the given string and assigns it to the TokenType field. +func (o *PaymentInstrument) SetTokenType(v string) { + o.TokenType = &v +} + +func (o PaymentInstrument) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrument) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.TokenType) { + toSerialize["tokenType"] = o.TokenType + } + return toSerialize, nil +} + +type NullablePaymentInstrument struct { + value *PaymentInstrument + isSet bool +} + +func (v NullablePaymentInstrument) Get() *PaymentInstrument { + return v.value +} + +func (v *NullablePaymentInstrument) Set(val *PaymentInstrument) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrument) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrument) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrument(val *PaymentInstrument) *NullablePaymentInstrument { + return &NullablePaymentInstrument{value: val, isSet: true} +} + +func (v NullablePaymentInstrument) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrument) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_pl_local_account_identification.go b/src/transferwebhooks/model_pl_local_account_identification.go new file mode 100644 index 000000000..2bcc08563 --- /dev/null +++ b/src/transferwebhooks/model_pl_local_account_identification.go @@ -0,0 +1,157 @@ +/* +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/v8/src/common" +) + +// checks if the PLLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PLLocalAccountIdentification{} + +// PLLocalAccountIdentification struct for PLLocalAccountIdentification +type PLLocalAccountIdentification struct { + // The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // **plLocal** + Type string `json:"type"` +} + +// NewPLLocalAccountIdentification instantiates a new PLLocalAccountIdentification 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 NewPLLocalAccountIdentification(accountNumber string, type_ string) *PLLocalAccountIdentification { + this := PLLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Type = type_ + return &this +} + +// NewPLLocalAccountIdentificationWithDefaults instantiates a new PLLocalAccountIdentification 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 NewPLLocalAccountIdentificationWithDefaults() *PLLocalAccountIdentification { + this := PLLocalAccountIdentification{} + var type_ string = "plLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *PLLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *PLLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *PLLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetType returns the Type field value +func (o *PLLocalAccountIdentification) 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 *PLLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PLLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o PLLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PLLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePLLocalAccountIdentification struct { + value *PLLocalAccountIdentification + isSet bool +} + +func (v NullablePLLocalAccountIdentification) Get() *PLLocalAccountIdentification { + return v.value +} + +func (v *NullablePLLocalAccountIdentification) Set(val *PLLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullablePLLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullablePLLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePLLocalAccountIdentification(val *PLLocalAccountIdentification) *NullablePLLocalAccountIdentification { + return &NullablePLLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullablePLLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePLLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PLLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "plLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_platform_payment.go b/src/transferwebhooks/model_platform_payment.go new file mode 100644 index 000000000..f7711d686 --- /dev/null +++ b/src/transferwebhooks/model_platform_payment.go @@ -0,0 +1,334 @@ +/* +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/v8/src/common" +) + +// checks if the PlatformPayment type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PlatformPayment{} + +// PlatformPayment struct for PlatformPayment +type PlatformPayment struct { + // The capture's merchant reference included in the transfer. + ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` + // The capture reference included in the transfer. + 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. + PlatformPaymentType *string `json:"platformPaymentType,omitempty"` + // The payment reference included in the transfer. + PspPaymentReference *string `json:"pspPaymentReference,omitempty"` + // **platformPayment** + Type *string `json:"type,omitempty"` +} + +// NewPlatformPayment instantiates a new PlatformPayment 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 NewPlatformPayment() *PlatformPayment { + this := PlatformPayment{} + var type_ string = "platformPayment" + this.Type = &type_ + return &this +} + +// NewPlatformPaymentWithDefaults instantiates a new PlatformPayment 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 NewPlatformPaymentWithDefaults() *PlatformPayment { + this := PlatformPayment{} + var type_ string = "platformPayment" + this.Type = &type_ + return &this +} + +// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetModificationMerchantReference() string { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + var ret string + return ret + } + return *o.ModificationMerchantReference +} + +// GetModificationMerchantReferenceOk returns a tuple with the ModificationMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetModificationMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationMerchantReference) { + return nil, false + } + return o.ModificationMerchantReference, true +} + +// HasModificationMerchantReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasModificationMerchantReference() bool { + if o != nil && !common.IsNil(o.ModificationMerchantReference) { + return true + } + + return false +} + +// SetModificationMerchantReference gets a reference to the given string and assigns it to the ModificationMerchantReference field. +func (o *PlatformPayment) SetModificationMerchantReference(v string) { + o.ModificationMerchantReference = &v +} + +// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetModificationPspReference() string { + if o == nil || common.IsNil(o.ModificationPspReference) { + var ret string + return ret + } + return *o.ModificationPspReference +} + +// GetModificationPspReferenceOk returns a tuple with the ModificationPspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetModificationPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.ModificationPspReference) { + return nil, false + } + return o.ModificationPspReference, true +} + +// HasModificationPspReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasModificationPspReference() bool { + if o != nil && !common.IsNil(o.ModificationPspReference) { + return true + } + + return false +} + +// SetModificationPspReference gets a reference to the given string and assigns it to the ModificationPspReference field. +func (o *PlatformPayment) SetModificationPspReference(v string) { + o.ModificationPspReference = &v +} + +// GetPaymentMerchantReference returns the PaymentMerchantReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetPaymentMerchantReference() string { + if o == nil || common.IsNil(o.PaymentMerchantReference) { + var ret string + return ret + } + return *o.PaymentMerchantReference +} + +// GetPaymentMerchantReferenceOk returns a tuple with the PaymentMerchantReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPaymentMerchantReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentMerchantReference) { + return nil, false + } + return o.PaymentMerchantReference, true +} + +// HasPaymentMerchantReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasPaymentMerchantReference() bool { + if o != nil && !common.IsNil(o.PaymentMerchantReference) { + return true + } + + return false +} + +// SetPaymentMerchantReference gets a reference to the given string and assigns it to the PaymentMerchantReference field. +func (o *PlatformPayment) SetPaymentMerchantReference(v string) { + o.PaymentMerchantReference = &v +} + +// GetPlatformPaymentType returns the PlatformPaymentType field value if set, zero value otherwise. +func (o *PlatformPayment) GetPlatformPaymentType() string { + if o == nil || common.IsNil(o.PlatformPaymentType) { + var ret string + return ret + } + return *o.PlatformPaymentType +} + +// GetPlatformPaymentTypeOk returns a tuple with the PlatformPaymentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPlatformPaymentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PlatformPaymentType) { + return nil, false + } + return o.PlatformPaymentType, true +} + +// HasPlatformPaymentType returns a boolean if a field has been set. +func (o *PlatformPayment) HasPlatformPaymentType() bool { + if o != nil && !common.IsNil(o.PlatformPaymentType) { + return true + } + + return false +} + +// SetPlatformPaymentType gets a reference to the given string and assigns it to the PlatformPaymentType field. +func (o *PlatformPayment) SetPlatformPaymentType(v string) { + o.PlatformPaymentType = &v +} + +// GetPspPaymentReference returns the PspPaymentReference field value if set, zero value otherwise. +func (o *PlatformPayment) GetPspPaymentReference() string { + if o == nil || common.IsNil(o.PspPaymentReference) { + var ret string + return ret + } + return *o.PspPaymentReference +} + +// GetPspPaymentReferenceOk returns a tuple with the PspPaymentReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetPspPaymentReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PspPaymentReference) { + return nil, false + } + return o.PspPaymentReference, true +} + +// HasPspPaymentReference returns a boolean if a field has been set. +func (o *PlatformPayment) HasPspPaymentReference() bool { + if o != nil && !common.IsNil(o.PspPaymentReference) { + return true + } + + return false +} + +// SetPspPaymentReference gets a reference to the given string and assigns it to the PspPaymentReference field. +func (o *PlatformPayment) SetPspPaymentReference(v string) { + o.PspPaymentReference = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PlatformPayment) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlatformPayment) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PlatformPayment) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PlatformPayment) SetType(v string) { + o.Type = &v +} + +func (o PlatformPayment) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlatformPayment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ModificationMerchantReference) { + toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference + } + if !common.IsNil(o.ModificationPspReference) { + toSerialize["modificationPspReference"] = o.ModificationPspReference + } + if !common.IsNil(o.PaymentMerchantReference) { + toSerialize["paymentMerchantReference"] = o.PaymentMerchantReference + } + if !common.IsNil(o.PlatformPaymentType) { + toSerialize["platformPaymentType"] = o.PlatformPaymentType + } + if !common.IsNil(o.PspPaymentReference) { + toSerialize["pspPaymentReference"] = o.PspPaymentReference + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullablePlatformPayment struct { + value *PlatformPayment + isSet bool +} + +func (v NullablePlatformPayment) Get() *PlatformPayment { + return v.value +} + +func (v *NullablePlatformPayment) Set(val *PlatformPayment) { + v.value = val + v.isSet = true +} + +func (v NullablePlatformPayment) IsSet() bool { + return v.isSet +} + +func (v *NullablePlatformPayment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlatformPayment(val *PlatformPayment) *NullablePlatformPayment { + return &NullablePlatformPayment{value: val, isSet: true} +} + +func (v NullablePlatformPayment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlatformPayment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *PlatformPayment) isValidPlatformPaymentType() bool { + var allowedEnumValues = []string{ "AcquiringFees", "AdyenCommission", "AdyenFees", "AdyenMarkup", "BalanceAccount", "Commission", "Default", "Interchange", "PaymentFee", "Remainder", "SchemeFee", "TopUp", "VAT" } + for _, allowed := range allowedEnumValues { + if o.GetPlatformPaymentType() == allowed { + return true + } + } + return false +} +func (o *PlatformPayment) isValidType() bool { + var allowedEnumValues = []string{ "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_relayed_authorisation_data.go b/src/transferwebhooks/model_relayed_authorisation_data.go new file mode 100644 index 000000000..d47bf63b9 --- /dev/null +++ b/src/transferwebhooks/model_relayed_authorisation_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/v8/src/common" +) + +// checks if the RelayedAuthorisationData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &RelayedAuthorisationData{} + +// RelayedAuthorisationData struct for RelayedAuthorisationData +type RelayedAuthorisationData struct { + // Contains key-value pairs of your references and descriptions, for example, `customId`:`your-own-custom-field-12345`. + Metadata *map[string]string `json:"metadata,omitempty"` + // Your reference for the relayed authorisation data. + Reference *string `json:"reference,omitempty"` +} + +// NewRelayedAuthorisationData instantiates a new RelayedAuthorisationData 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 NewRelayedAuthorisationData() *RelayedAuthorisationData { + this := RelayedAuthorisationData{} + return &this +} + +// NewRelayedAuthorisationDataWithDefaults instantiates a new RelayedAuthorisationData 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 NewRelayedAuthorisationDataWithDefaults() *RelayedAuthorisationData { + this := RelayedAuthorisationData{} + return &this +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *RelayedAuthorisationData) GetMetadata() map[string]string { + if o == nil || common.IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelayedAuthorisationData) GetMetadataOk() (*map[string]string, bool) { + if o == nil || common.IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *RelayedAuthorisationData) HasMetadata() bool { + if o != nil && !common.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *RelayedAuthorisationData) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *RelayedAuthorisationData) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelayedAuthorisationData) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *RelayedAuthorisationData) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *RelayedAuthorisationData) SetReference(v string) { + o.Reference = &v +} + +func (o RelayedAuthorisationData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RelayedAuthorisationData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableRelayedAuthorisationData struct { + value *RelayedAuthorisationData + isSet bool +} + +func (v NullableRelayedAuthorisationData) Get() *RelayedAuthorisationData { + return v.value +} + +func (v *NullableRelayedAuthorisationData) Set(val *RelayedAuthorisationData) { + v.value = val + v.isSet = true +} + +func (v NullableRelayedAuthorisationData) IsSet() bool { + return v.isSet +} + +func (v *NullableRelayedAuthorisationData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRelayedAuthorisationData(val *RelayedAuthorisationData) *NullableRelayedAuthorisationData { + return &NullableRelayedAuthorisationData{value: val, isSet: true} +} + +func (v NullableRelayedAuthorisationData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRelayedAuthorisationData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_resource.go b/src/transferwebhooks/model_resource.go new file mode 100644 index 000000000..0d3c729a9 --- /dev/null +++ b/src/transferwebhooks/model_resource.go @@ -0,0 +1,202 @@ +/* +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/v8/src/common" + "time" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Resource{} + +// Resource struct for Resource +type Resource struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` +} + +// NewResource instantiates a new Resource 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 NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *Resource) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *Resource) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *Resource) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *Resource) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *Resource) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *Resource) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Resource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Resource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Resource) SetId(v string) { + o.Id = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_resource_reference.go b/src/transferwebhooks/model_resource_reference.go new file mode 100644 index 000000000..2ad875eff --- /dev/null +++ b/src/transferwebhooks/model_resource_reference.go @@ -0,0 +1,201 @@ +/* +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/v8/src/common" +) + +// checks if the ResourceReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ResourceReference{} + +// ResourceReference struct for ResourceReference +type ResourceReference struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` +} + +// NewResourceReference instantiates a new ResourceReference 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 NewResourceReference() *ResourceReference { + this := ResourceReference{} + return &this +} + +// NewResourceReferenceWithDefaults instantiates a new ResourceReference 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 NewResourceReferenceWithDefaults() *ResourceReference { + this := ResourceReference{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ResourceReference) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ResourceReference) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ResourceReference) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourceReference) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ResourceReference) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourceReference) SetId(v string) { + o.Id = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *ResourceReference) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceReference) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *ResourceReference) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *ResourceReference) SetReference(v string) { + o.Reference = &v +} + +func (o ResourceReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + return toSerialize, nil +} + +type NullableResourceReference struct { + value *ResourceReference + isSet bool +} + +func (v NullableResourceReference) Get() *ResourceReference { + return v.value +} + +func (v *NullableResourceReference) Set(val *ResourceReference) { + v.value = val + v.isSet = true +} + +func (v NullableResourceReference) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceReference(val *ResourceReference) *NullableResourceReference { + return &NullableResourceReference{value: val, isSet: true} +} + +func (v NullableResourceReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_se_local_account_identification.go b/src/transferwebhooks/model_se_local_account_identification.go new file mode 100644 index 000000000..005848ef0 --- /dev/null +++ b/src/transferwebhooks/model_se_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the SELocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SELocalAccountIdentification{} + +// SELocalAccountIdentification struct for SELocalAccountIdentification +type SELocalAccountIdentification struct { + // The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. + AccountNumber string `json:"accountNumber"` + // The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + ClearingNumber string `json:"clearingNumber"` + // **seLocal** + Type string `json:"type"` +} + +// NewSELocalAccountIdentification instantiates a new SELocalAccountIdentification 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 NewSELocalAccountIdentification(accountNumber string, clearingNumber string, type_ string) *SELocalAccountIdentification { + this := SELocalAccountIdentification{} + this.AccountNumber = accountNumber + this.ClearingNumber = clearingNumber + this.Type = type_ + return &this +} + +// NewSELocalAccountIdentificationWithDefaults instantiates a new SELocalAccountIdentification 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 NewSELocalAccountIdentificationWithDefaults() *SELocalAccountIdentification { + this := SELocalAccountIdentification{} + var type_ string = "seLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *SELocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *SELocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *SELocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetClearingNumber returns the ClearingNumber field value +func (o *SELocalAccountIdentification) GetClearingNumber() string { + if o == nil { + var ret string + return ret + } + + return o.ClearingNumber +} + +// GetClearingNumberOk returns a tuple with the ClearingNumber field value +// and a boolean to check if the value has been set. +func (o *SELocalAccountIdentification) GetClearingNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClearingNumber, true +} + +// SetClearingNumber sets field value +func (o *SELocalAccountIdentification) SetClearingNumber(v string) { + o.ClearingNumber = v +} + +// GetType returns the Type field value +func (o *SELocalAccountIdentification) 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 *SELocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SELocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o SELocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SELocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["clearingNumber"] = o.ClearingNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableSELocalAccountIdentification struct { + value *SELocalAccountIdentification + isSet bool +} + +func (v NullableSELocalAccountIdentification) Get() *SELocalAccountIdentification { + return v.value +} + +func (v *NullableSELocalAccountIdentification) Set(val *SELocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableSELocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableSELocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSELocalAccountIdentification(val *SELocalAccountIdentification) *NullableSELocalAccountIdentification { + return &NullableSELocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableSELocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSELocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SELocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "seLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_sg_local_account_identification.go b/src/transferwebhooks/model_sg_local_account_identification.go new file mode 100644 index 000000000..56e256433 --- /dev/null +++ b/src/transferwebhooks/model_sg_local_account_identification.go @@ -0,0 +1,196 @@ +/* +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/v8/src/common" +) + +// checks if the SGLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &SGLocalAccountIdentification{} + +// SGLocalAccountIdentification struct for SGLocalAccountIdentification +type SGLocalAccountIdentification struct { + // The 4- to 19-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The bank's 8- or 11-character BIC or SWIFT code. + Bic string `json:"bic"` + // **sgLocal** + Type *string `json:"type,omitempty"` +} + +// NewSGLocalAccountIdentification instantiates a new SGLocalAccountIdentification 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 NewSGLocalAccountIdentification(accountNumber string, bic string) *SGLocalAccountIdentification { + this := SGLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.Bic = bic + var type_ string = "sgLocal" + this.Type = &type_ + return &this +} + +// NewSGLocalAccountIdentificationWithDefaults instantiates a new SGLocalAccountIdentification 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 NewSGLocalAccountIdentificationWithDefaults() *SGLocalAccountIdentification { + this := SGLocalAccountIdentification{} + var type_ string = "sgLocal" + this.Type = &type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *SGLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *SGLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetBic returns the Bic field value +func (o *SGLocalAccountIdentification) GetBic() string { + if o == nil { + var ret string + return ret + } + + return o.Bic +} + +// GetBicOk returns a tuple with the Bic field value +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetBicOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bic, true +} + +// SetBic sets field value +func (o *SGLocalAccountIdentification) SetBic(v string) { + o.Bic = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SGLocalAccountIdentification) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SGLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SGLocalAccountIdentification) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SGLocalAccountIdentification) SetType(v string) { + o.Type = &v +} + +func (o SGLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SGLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["bic"] = o.Bic + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableSGLocalAccountIdentification struct { + value *SGLocalAccountIdentification + isSet bool +} + +func (v NullableSGLocalAccountIdentification) Get() *SGLocalAccountIdentification { + return v.value +} + +func (v *NullableSGLocalAccountIdentification) Set(val *SGLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableSGLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableSGLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSGLocalAccountIdentification(val *SGLocalAccountIdentification) *NullableSGLocalAccountIdentification { + return &NullableSGLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableSGLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSGLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *SGLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "sgLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_transaction_event_violation.go b/src/transferwebhooks/model_transaction_event_violation.go new file mode 100644 index 000000000..53f746be6 --- /dev/null +++ b/src/transferwebhooks/model_transaction_event_violation.go @@ -0,0 +1,199 @@ +/* +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/v8/src/common" +) + +// checks if the TransactionEventViolation type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionEventViolation{} + +// TransactionEventViolation struct for TransactionEventViolation +type TransactionEventViolation struct { + // An explanation about why the transaction rule failed. + Reason *string `json:"reason,omitempty"` + TransactionRule *TransactionRuleReference `json:"transactionRule,omitempty"` + TransactionRuleSource *TransactionRuleSource `json:"transactionRuleSource,omitempty"` +} + +// NewTransactionEventViolation instantiates a new TransactionEventViolation 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 NewTransactionEventViolation() *TransactionEventViolation { + this := TransactionEventViolation{} + return &this +} + +// NewTransactionEventViolationWithDefaults instantiates a new TransactionEventViolation 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 NewTransactionEventViolationWithDefaults() *TransactionEventViolation { + this := TransactionEventViolation{} + return &this +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *TransactionEventViolation) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionEventViolation) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *TransactionEventViolation) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *TransactionEventViolation) SetReason(v string) { + o.Reason = &v +} + +// GetTransactionRule returns the TransactionRule field value if set, zero value otherwise. +func (o *TransactionEventViolation) GetTransactionRule() TransactionRuleReference { + if o == nil || common.IsNil(o.TransactionRule) { + var ret TransactionRuleReference + return ret + } + return *o.TransactionRule +} + +// GetTransactionRuleOk returns a tuple with the TransactionRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionEventViolation) GetTransactionRuleOk() (*TransactionRuleReference, bool) { + if o == nil || common.IsNil(o.TransactionRule) { + return nil, false + } + return o.TransactionRule, true +} + +// HasTransactionRule returns a boolean if a field has been set. +func (o *TransactionEventViolation) HasTransactionRule() bool { + if o != nil && !common.IsNil(o.TransactionRule) { + return true + } + + return false +} + +// SetTransactionRule gets a reference to the given TransactionRuleReference and assigns it to the TransactionRule field. +func (o *TransactionEventViolation) SetTransactionRule(v TransactionRuleReference) { + o.TransactionRule = &v +} + +// GetTransactionRuleSource returns the TransactionRuleSource field value if set, zero value otherwise. +func (o *TransactionEventViolation) GetTransactionRuleSource() TransactionRuleSource { + if o == nil || common.IsNil(o.TransactionRuleSource) { + var ret TransactionRuleSource + return ret + } + return *o.TransactionRuleSource +} + +// GetTransactionRuleSourceOk returns a tuple with the TransactionRuleSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionEventViolation) GetTransactionRuleSourceOk() (*TransactionRuleSource, bool) { + if o == nil || common.IsNil(o.TransactionRuleSource) { + return nil, false + } + return o.TransactionRuleSource, true +} + +// HasTransactionRuleSource returns a boolean if a field has been set. +func (o *TransactionEventViolation) HasTransactionRuleSource() bool { + if o != nil && !common.IsNil(o.TransactionRuleSource) { + return true + } + + return false +} + +// SetTransactionRuleSource gets a reference to the given TransactionRuleSource and assigns it to the TransactionRuleSource field. +func (o *TransactionEventViolation) SetTransactionRuleSource(v TransactionRuleSource) { + o.TransactionRuleSource = &v +} + +func (o TransactionEventViolation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionEventViolation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + if !common.IsNil(o.TransactionRule) { + toSerialize["transactionRule"] = o.TransactionRule + } + if !common.IsNil(o.TransactionRuleSource) { + toSerialize["transactionRuleSource"] = o.TransactionRuleSource + } + return toSerialize, nil +} + +type NullableTransactionEventViolation struct { + value *TransactionEventViolation + isSet bool +} + +func (v NullableTransactionEventViolation) Get() *TransactionEventViolation { + return v.value +} + +func (v *NullableTransactionEventViolation) Set(val *TransactionEventViolation) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionEventViolation) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionEventViolation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionEventViolation(val *TransactionEventViolation) *NullableTransactionEventViolation { + return &NullableTransactionEventViolation{value: val, isSet: true} +} + +func (v NullableTransactionEventViolation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionEventViolation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_transaction_rule_reference.go b/src/transferwebhooks/model_transaction_rule_reference.go new file mode 100644 index 000000000..6c620e4f0 --- /dev/null +++ b/src/transferwebhooks/model_transaction_rule_reference.go @@ -0,0 +1,275 @@ +/* +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/v8/src/common" +) + +// checks if the TransactionRuleReference type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionRuleReference{} + +// TransactionRuleReference struct for TransactionRuleReference +type TransactionRuleReference struct { + // The description of the resource. + Description *string `json:"description,omitempty"` + // The unique identifier of the resource. + Id *string `json:"id,omitempty"` + // The outcome type of the rule. + OutcomeType *string `json:"outcomeType,omitempty"` + // The reference for the resource. + Reference *string `json:"reference,omitempty"` + // The score of the rule in case it's a scoreBased rule. + Score *int32 `json:"score,omitempty"` +} + +// NewTransactionRuleReference instantiates a new TransactionRuleReference 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 NewTransactionRuleReference() *TransactionRuleReference { + this := TransactionRuleReference{} + return &this +} + +// NewTransactionRuleReferenceWithDefaults instantiates a new TransactionRuleReference 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 NewTransactionRuleReferenceWithDefaults() *TransactionRuleReference { + this := TransactionRuleReference{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TransactionRuleReference) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransactionRuleReference) SetId(v string) { + o.Id = &v +} + +// GetOutcomeType returns the OutcomeType field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetOutcomeType() string { + if o == nil || common.IsNil(o.OutcomeType) { + var ret string + return ret + } + return *o.OutcomeType +} + +// GetOutcomeTypeOk returns a tuple with the OutcomeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetOutcomeTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.OutcomeType) { + return nil, false + } + return o.OutcomeType, true +} + +// HasOutcomeType returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasOutcomeType() bool { + if o != nil && !common.IsNil(o.OutcomeType) { + return true + } + + return false +} + +// SetOutcomeType gets a reference to the given string and assigns it to the OutcomeType field. +func (o *TransactionRuleReference) SetOutcomeType(v string) { + o.OutcomeType = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *TransactionRuleReference) SetReference(v string) { + o.Reference = &v +} + +// GetScore returns the Score field value if set, zero value otherwise. +func (o *TransactionRuleReference) GetScore() int32 { + if o == nil || common.IsNil(o.Score) { + var ret int32 + return ret + } + return *o.Score +} + +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleReference) GetScoreOk() (*int32, bool) { + if o == nil || common.IsNil(o.Score) { + return nil, false + } + return o.Score, true +} + +// HasScore returns a boolean if a field has been set. +func (o *TransactionRuleReference) HasScore() bool { + if o != nil && !common.IsNil(o.Score) { + return true + } + + return false +} + +// SetScore gets a reference to the given int32 and assigns it to the Score field. +func (o *TransactionRuleReference) SetScore(v int32) { + o.Score = &v +} + +func (o TransactionRuleReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionRuleReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.OutcomeType) { + toSerialize["outcomeType"] = o.OutcomeType + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.Score) { + toSerialize["score"] = o.Score + } + return toSerialize, nil +} + +type NullableTransactionRuleReference struct { + value *TransactionRuleReference + isSet bool +} + +func (v NullableTransactionRuleReference) Get() *TransactionRuleReference { + return v.value +} + +func (v *NullableTransactionRuleReference) Set(val *TransactionRuleReference) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionRuleReference) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionRuleReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionRuleReference(val *TransactionRuleReference) *NullableTransactionRuleReference { + return &NullableTransactionRuleReference{value: val, isSet: true} +} + +func (v NullableTransactionRuleReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionRuleReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_transaction_rule_source.go b/src/transferwebhooks/model_transaction_rule_source.go new file mode 100644 index 000000000..4044bfb6f --- /dev/null +++ b/src/transferwebhooks/model_transaction_rule_source.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/v8/src/common" +) + +// checks if the TransactionRuleSource type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionRuleSource{} + +// TransactionRuleSource struct for TransactionRuleSource +type TransactionRuleSource struct { + // ID of the resource, when applicable. + Id *string `json:"id,omitempty"` + // Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen. + Type *string `json:"type,omitempty"` +} + +// NewTransactionRuleSource instantiates a new TransactionRuleSource 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 NewTransactionRuleSource() *TransactionRuleSource { + this := TransactionRuleSource{} + return &this +} + +// NewTransactionRuleSourceWithDefaults instantiates a new TransactionRuleSource 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 NewTransactionRuleSourceWithDefaults() *TransactionRuleSource { + this := TransactionRuleSource{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransactionRuleSource) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleSource) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransactionRuleSource) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransactionRuleSource) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransactionRuleSource) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleSource) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransactionRuleSource) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransactionRuleSource) SetType(v string) { + o.Type = &v +} + +func (o TransactionRuleSource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionRuleSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransactionRuleSource struct { + value *TransactionRuleSource + isSet bool +} + +func (v NullableTransactionRuleSource) Get() *TransactionRuleSource { + return v.value +} + +func (v *NullableTransactionRuleSource) Set(val *TransactionRuleSource) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionRuleSource) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionRuleSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionRuleSource(val *TransactionRuleSource) *NullableTransactionRuleSource { + return &NullableTransactionRuleSource{value: val, isSet: true} +} + +func (v NullableTransactionRuleSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionRuleSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_transaction_rules_result.go b/src/transferwebhooks/model_transaction_rules_result.go new file mode 100644 index 000000000..c25992cf3 --- /dev/null +++ b/src/transferwebhooks/model_transaction_rules_result.go @@ -0,0 +1,238 @@ +/* +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/v8/src/common" +) + +// checks if the TransactionRulesResult type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransactionRulesResult{} + +// TransactionRulesResult struct for TransactionRulesResult +type TransactionRulesResult struct { + // The advice given by the Risk analysis. + Advice *string `json:"advice,omitempty"` + // Indicates whether the transaction passed the evaluation for all hardblock rules + AllHardBlockRulesPassed *bool `json:"allHardBlockRulesPassed,omitempty"` + // The score of the Risk analysis. + Score *int32 `json:"score,omitempty"` + // Array containing all the transaction rules that the transaction triggered. + TriggeredTransactionRules []TransactionEventViolation `json:"triggeredTransactionRules,omitempty"` +} + +// NewTransactionRulesResult instantiates a new TransactionRulesResult 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 NewTransactionRulesResult() *TransactionRulesResult { + this := TransactionRulesResult{} + return &this +} + +// NewTransactionRulesResultWithDefaults instantiates a new TransactionRulesResult 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 NewTransactionRulesResultWithDefaults() *TransactionRulesResult { + this := TransactionRulesResult{} + return &this +} + +// GetAdvice returns the Advice field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetAdvice() string { + if o == nil || common.IsNil(o.Advice) { + var ret string + return ret + } + return *o.Advice +} + +// GetAdviceOk returns a tuple with the Advice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRulesResult) GetAdviceOk() (*string, bool) { + if o == nil || common.IsNil(o.Advice) { + return nil, false + } + return o.Advice, true +} + +// HasAdvice returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasAdvice() bool { + if o != nil && !common.IsNil(o.Advice) { + return true + } + + return false +} + +// SetAdvice gets a reference to the given string and assigns it to the Advice field. +func (o *TransactionRulesResult) SetAdvice(v string) { + o.Advice = &v +} + +// GetAllHardBlockRulesPassed returns the AllHardBlockRulesPassed field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetAllHardBlockRulesPassed() bool { + if o == nil || common.IsNil(o.AllHardBlockRulesPassed) { + var ret bool + return ret + } + return *o.AllHardBlockRulesPassed +} + +// GetAllHardBlockRulesPassedOk returns a tuple with the AllHardBlockRulesPassed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRulesResult) GetAllHardBlockRulesPassedOk() (*bool, bool) { + if o == nil || common.IsNil(o.AllHardBlockRulesPassed) { + return nil, false + } + return o.AllHardBlockRulesPassed, true +} + +// HasAllHardBlockRulesPassed returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasAllHardBlockRulesPassed() bool { + if o != nil && !common.IsNil(o.AllHardBlockRulesPassed) { + return true + } + + return false +} + +// SetAllHardBlockRulesPassed gets a reference to the given bool and assigns it to the AllHardBlockRulesPassed field. +func (o *TransactionRulesResult) SetAllHardBlockRulesPassed(v bool) { + o.AllHardBlockRulesPassed = &v +} + +// GetScore returns the Score field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetScore() int32 { + if o == nil || common.IsNil(o.Score) { + var ret int32 + return ret + } + return *o.Score +} + +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRulesResult) GetScoreOk() (*int32, bool) { + if o == nil || common.IsNil(o.Score) { + return nil, false + } + return o.Score, true +} + +// HasScore returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasScore() bool { + if o != nil && !common.IsNil(o.Score) { + return true + } + + return false +} + +// SetScore gets a reference to the given int32 and assigns it to the Score field. +func (o *TransactionRulesResult) SetScore(v int32) { + o.Score = &v +} + +// GetTriggeredTransactionRules returns the TriggeredTransactionRules field value if set, zero value otherwise. +func (o *TransactionRulesResult) GetTriggeredTransactionRules() []TransactionEventViolation { + if o == nil || common.IsNil(o.TriggeredTransactionRules) { + var ret []TransactionEventViolation + return ret + } + return o.TriggeredTransactionRules +} + +// GetTriggeredTransactionRulesOk returns a tuple with the TriggeredTransactionRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRulesResult) GetTriggeredTransactionRulesOk() ([]TransactionEventViolation, bool) { + if o == nil || common.IsNil(o.TriggeredTransactionRules) { + return nil, false + } + return o.TriggeredTransactionRules, true +} + +// HasTriggeredTransactionRules returns a boolean if a field has been set. +func (o *TransactionRulesResult) HasTriggeredTransactionRules() bool { + if o != nil && !common.IsNil(o.TriggeredTransactionRules) { + return true + } + + return false +} + +// SetTriggeredTransactionRules gets a reference to the given []TransactionEventViolation and assigns it to the TriggeredTransactionRules field. +func (o *TransactionRulesResult) SetTriggeredTransactionRules(v []TransactionEventViolation) { + o.TriggeredTransactionRules = v +} + +func (o TransactionRulesResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionRulesResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Advice) { + toSerialize["advice"] = o.Advice + } + if !common.IsNil(o.AllHardBlockRulesPassed) { + toSerialize["allHardBlockRulesPassed"] = o.AllHardBlockRulesPassed + } + if !common.IsNil(o.Score) { + toSerialize["score"] = o.Score + } + if !common.IsNil(o.TriggeredTransactionRules) { + toSerialize["triggeredTransactionRules"] = o.TriggeredTransactionRules + } + return toSerialize, nil +} + +type NullableTransactionRulesResult struct { + value *TransactionRulesResult + isSet bool +} + +func (v NullableTransactionRulesResult) Get() *TransactionRulesResult { + return v.value +} + +func (v *NullableTransactionRulesResult) Set(val *TransactionRulesResult) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionRulesResult) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionRulesResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionRulesResult(val *TransactionRulesResult) *NullableTransactionRulesResult { + return &NullableTransactionRulesResult{value: val, isSet: true} +} + +func (v NullableTransactionRulesResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionRulesResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_transfer_data.go b/src/transferwebhooks/model_transfer_data.go new file mode 100644 index 000000000..3837e5493 --- /dev/null +++ b/src/transferwebhooks/model_transfer_data.go @@ -0,0 +1,915 @@ +/* +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/v8/src/common" + "time" +) + +// checks if the TransferData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferData{} + +// TransferData struct for TransferData +type TransferData struct { + AccountHolder *ResourceReference `json:"accountHolder,omitempty"` + Amount Amount `json:"amount"` + BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + // The list of the latest balance statuses in the transfer. + Balances []BalanceMutation `json:"balances,omitempty"` + // The category of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. + Category string `json:"category"` + CategoryData *TransferDataCategoryData `json:"categoryData,omitempty"` + Counterparty *CounterpartyV3 `json:"counterparty,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // 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] & $ % # @** **~ = + - _ ' \" ! ?** + Description *string `json:"description,omitempty"` + // The direction of the transfer. Possible values: **incoming**, **outgoing**. + Direction *string `json:"direction,omitempty"` + // The list of events leading up to the current status of the transfer. + Events []TransferEvent `json:"events,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` + PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` + // Additional information about the status of the transfer. + Reason *string `json:"reason,omitempty"` + // Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. + Reference *string `json:"reference,omitempty"` + // A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + ReferenceForBeneficiary *string `json:"referenceForBeneficiary,omitempty"` + // The sequence number of the transfer notification. The numbers start from 1 and increase with each new notification for a specific transfer. It can help you restore the correct sequence of events even if they arrive out of order. + SequenceNumber *int32 `json:"sequenceNumber,omitempty"` + // The result of the transfer. For example, **authorised**, **refused**, or **error**. + Status string `json:"status"` + Tracking *TransferNotificationTransferTracking `json:"tracking,omitempty"` + TransactionRulesResult *TransactionRulesResult `json:"transactionRulesResult,omitempty"` + // The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**. + Type *string `json:"type,omitempty"` +} + +// NewTransferData instantiates a new TransferData 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 NewTransferData(amount Amount, category string, status string) *TransferData { + this := TransferData{} + this.Amount = amount + this.Category = category + this.Status = status + return &this +} + +// NewTransferDataWithDefaults instantiates a new TransferData 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 NewTransferDataWithDefaults() *TransferData { + this := TransferData{} + return &this +} + +// GetAccountHolder returns the AccountHolder field value if set, zero value otherwise. +func (o *TransferData) GetAccountHolder() ResourceReference { + if o == nil || common.IsNil(o.AccountHolder) { + var ret ResourceReference + return ret + } + return *o.AccountHolder +} + +// GetAccountHolderOk returns a tuple with the AccountHolder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetAccountHolderOk() (*ResourceReference, bool) { + if o == nil || common.IsNil(o.AccountHolder) { + return nil, false + } + return o.AccountHolder, true +} + +// HasAccountHolder returns a boolean if a field has been set. +func (o *TransferData) HasAccountHolder() bool { + if o != nil && !common.IsNil(o.AccountHolder) { + return true + } + + return false +} + +// SetAccountHolder gets a reference to the given ResourceReference and assigns it to the AccountHolder field. +func (o *TransferData) SetAccountHolder(v ResourceReference) { + o.AccountHolder = &v +} + +// GetAmount returns the Amount field value +func (o *TransferData) GetAmount() Amount { + if o == nil { + var ret Amount + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *TransferData) GetAmountOk() (*Amount, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *TransferData) SetAmount(v Amount) { + o.Amount = v +} + +// GetBalanceAccount returns the BalanceAccount field value if set, zero value otherwise. +func (o *TransferData) GetBalanceAccount() ResourceReference { + if o == nil || common.IsNil(o.BalanceAccount) { + var ret ResourceReference + return ret + } + return *o.BalanceAccount +} + +// GetBalanceAccountOk returns a tuple with the BalanceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetBalanceAccountOk() (*ResourceReference, bool) { + if o == nil || common.IsNil(o.BalanceAccount) { + return nil, false + } + return o.BalanceAccount, true +} + +// HasBalanceAccount returns a boolean if a field has been set. +func (o *TransferData) HasBalanceAccount() bool { + if o != nil && !common.IsNil(o.BalanceAccount) { + return true + } + + return false +} + +// SetBalanceAccount gets a reference to the given ResourceReference and assigns it to the BalanceAccount field. +func (o *TransferData) SetBalanceAccount(v ResourceReference) { + o.BalanceAccount = &v +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *TransferData) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *TransferData) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *TransferData) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetBalances returns the Balances field value if set, zero value otherwise. +func (o *TransferData) GetBalances() []BalanceMutation { + if o == nil || common.IsNil(o.Balances) { + var ret []BalanceMutation + return ret + } + return o.Balances +} + +// GetBalancesOk returns a tuple with the Balances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetBalancesOk() ([]BalanceMutation, bool) { + if o == nil || common.IsNil(o.Balances) { + return nil, false + } + return o.Balances, true +} + +// HasBalances returns a boolean if a field has been set. +func (o *TransferData) HasBalances() bool { + if o != nil && !common.IsNil(o.Balances) { + return true + } + + return false +} + +// SetBalances gets a reference to the given []BalanceMutation and assigns it to the Balances field. +func (o *TransferData) SetBalances(v []BalanceMutation) { + o.Balances = v +} + +// GetCategory returns the Category field value +func (o *TransferData) GetCategory() string { + if o == nil { + var ret string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *TransferData) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *TransferData) SetCategory(v string) { + o.Category = v +} + +// GetCategoryData returns the CategoryData field value if set, zero value otherwise. +func (o *TransferData) GetCategoryData() TransferDataCategoryData { + if o == nil || common.IsNil(o.CategoryData) { + var ret TransferDataCategoryData + return ret + } + return *o.CategoryData +} + +// GetCategoryDataOk returns a tuple with the CategoryData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetCategoryDataOk() (*TransferDataCategoryData, bool) { + if o == nil || common.IsNil(o.CategoryData) { + return nil, false + } + return o.CategoryData, true +} + +// HasCategoryData returns a boolean if a field has been set. +func (o *TransferData) HasCategoryData() bool { + if o != nil && !common.IsNil(o.CategoryData) { + return true + } + + return false +} + +// SetCategoryData gets a reference to the given TransferDataCategoryData and assigns it to the CategoryData field. +func (o *TransferData) SetCategoryData(v TransferDataCategoryData) { + o.CategoryData = &v +} + +// GetCounterparty returns the Counterparty field value if set, zero value otherwise. +func (o *TransferData) GetCounterparty() CounterpartyV3 { + if o == nil || common.IsNil(o.Counterparty) { + var ret CounterpartyV3 + return ret + } + return *o.Counterparty +} + +// GetCounterpartyOk returns a tuple with the Counterparty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetCounterpartyOk() (*CounterpartyV3, bool) { + if o == nil || common.IsNil(o.Counterparty) { + return nil, false + } + return o.Counterparty, true +} + +// HasCounterparty returns a boolean if a field has been set. +func (o *TransferData) HasCounterparty() bool { + if o != nil && !common.IsNil(o.Counterparty) { + return true + } + + return false +} + +// SetCounterparty gets a reference to the given CounterpartyV3 and assigns it to the Counterparty field. +func (o *TransferData) SetCounterparty(v CounterpartyV3) { + o.Counterparty = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *TransferData) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *TransferData) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *TransferData) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TransferData) GetDescription() string { + if o == nil || common.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetDescriptionOk() (*string, bool) { + if o == nil || common.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TransferData) HasDescription() bool { + if o != nil && !common.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TransferData) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *TransferData) GetDirection() string { + if o == nil || common.IsNil(o.Direction) { + var ret string + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetDirectionOk() (*string, bool) { + if o == nil || common.IsNil(o.Direction) { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *TransferData) HasDirection() bool { + if o != nil && !common.IsNil(o.Direction) { + return true + } + + return false +} + +// SetDirection gets a reference to the given string and assigns it to the Direction field. +func (o *TransferData) SetDirection(v string) { + o.Direction = &v +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *TransferData) GetEvents() []TransferEvent { + if o == nil || common.IsNil(o.Events) { + var ret []TransferEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetEventsOk() ([]TransferEvent, bool) { + if o == nil || common.IsNil(o.Events) { + return nil, false + } + return o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *TransferData) HasEvents() bool { + if o != nil && !common.IsNil(o.Events) { + return true + } + + return false +} + +// SetEvents gets a reference to the given []TransferEvent and assigns it to the Events field. +func (o *TransferData) SetEvents(v []TransferEvent) { + o.Events = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransferData) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransferData) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransferData) SetId(v string) { + o.Id = &v +} + +// GetPaymentInstrument returns the PaymentInstrument field value if set, zero value otherwise. +func (o *TransferData) GetPaymentInstrument() PaymentInstrument { + if o == nil || common.IsNil(o.PaymentInstrument) { + var ret PaymentInstrument + return ret + } + return *o.PaymentInstrument +} + +// GetPaymentInstrumentOk returns a tuple with the PaymentInstrument field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetPaymentInstrumentOk() (*PaymentInstrument, bool) { + if o == nil || common.IsNil(o.PaymentInstrument) { + return nil, false + } + return o.PaymentInstrument, true +} + +// HasPaymentInstrument returns a boolean if a field has been set. +func (o *TransferData) HasPaymentInstrument() bool { + if o != nil && !common.IsNil(o.PaymentInstrument) { + return true + } + + return false +} + +// SetPaymentInstrument gets a reference to the given PaymentInstrument and assigns it to the PaymentInstrument field. +func (o *TransferData) SetPaymentInstrument(v PaymentInstrument) { + o.PaymentInstrument = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *TransferData) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *TransferData) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *TransferData) SetReason(v string) { + o.Reason = &v +} + +// GetReference returns the Reference field value if set, zero value otherwise. +func (o *TransferData) GetReference() string { + if o == nil || common.IsNil(o.Reference) { + var ret string + return ret + } + return *o.Reference +} + +// GetReferenceOk returns a tuple with the Reference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.Reference) { + return nil, false + } + return o.Reference, true +} + +// HasReference returns a boolean if a field has been set. +func (o *TransferData) HasReference() bool { + if o != nil && !common.IsNil(o.Reference) { + return true + } + + return false +} + +// SetReference gets a reference to the given string and assigns it to the Reference field. +func (o *TransferData) SetReference(v string) { + o.Reference = &v +} + +// GetReferenceForBeneficiary returns the ReferenceForBeneficiary field value if set, zero value otherwise. +func (o *TransferData) GetReferenceForBeneficiary() string { + if o == nil || common.IsNil(o.ReferenceForBeneficiary) { + var ret string + return ret + } + return *o.ReferenceForBeneficiary +} + +// GetReferenceForBeneficiaryOk returns a tuple with the ReferenceForBeneficiary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetReferenceForBeneficiaryOk() (*string, bool) { + if o == nil || common.IsNil(o.ReferenceForBeneficiary) { + return nil, false + } + return o.ReferenceForBeneficiary, true +} + +// HasReferenceForBeneficiary returns a boolean if a field has been set. +func (o *TransferData) HasReferenceForBeneficiary() bool { + if o != nil && !common.IsNil(o.ReferenceForBeneficiary) { + return true + } + + return false +} + +// SetReferenceForBeneficiary gets a reference to the given string and assigns it to the ReferenceForBeneficiary field. +func (o *TransferData) SetReferenceForBeneficiary(v string) { + o.ReferenceForBeneficiary = &v +} + +// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. +func (o *TransferData) GetSequenceNumber() int32 { + if o == nil || common.IsNil(o.SequenceNumber) { + var ret int32 + return ret + } + return *o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetSequenceNumberOk() (*int32, bool) { + if o == nil || common.IsNil(o.SequenceNumber) { + return nil, false + } + return o.SequenceNumber, true +} + +// HasSequenceNumber returns a boolean if a field has been set. +func (o *TransferData) HasSequenceNumber() bool { + if o != nil && !common.IsNil(o.SequenceNumber) { + return true + } + + return false +} + +// SetSequenceNumber gets a reference to the given int32 and assigns it to the SequenceNumber field. +func (o *TransferData) SetSequenceNumber(v int32) { + o.SequenceNumber = &v +} + +// GetStatus returns the Status field value +func (o *TransferData) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TransferData) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TransferData) SetStatus(v string) { + o.Status = v +} + +// GetTracking returns the Tracking field value if set, zero value otherwise. +func (o *TransferData) GetTracking() TransferNotificationTransferTracking { + if o == nil || common.IsNil(o.Tracking) { + var ret TransferNotificationTransferTracking + return ret + } + return *o.Tracking +} + +// GetTrackingOk returns a tuple with the Tracking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetTrackingOk() (*TransferNotificationTransferTracking, bool) { + if o == nil || common.IsNil(o.Tracking) { + return nil, false + } + return o.Tracking, true +} + +// HasTracking returns a boolean if a field has been set. +func (o *TransferData) HasTracking() bool { + if o != nil && !common.IsNil(o.Tracking) { + return true + } + + return false +} + +// SetTracking gets a reference to the given TransferNotificationTransferTracking and assigns it to the Tracking field. +func (o *TransferData) SetTracking(v TransferNotificationTransferTracking) { + o.Tracking = &v +} + +// GetTransactionRulesResult returns the TransactionRulesResult field value if set, zero value otherwise. +func (o *TransferData) GetTransactionRulesResult() TransactionRulesResult { + if o == nil || common.IsNil(o.TransactionRulesResult) { + var ret TransactionRulesResult + return ret + } + return *o.TransactionRulesResult +} + +// GetTransactionRulesResultOk returns a tuple with the TransactionRulesResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetTransactionRulesResultOk() (*TransactionRulesResult, bool) { + if o == nil || common.IsNil(o.TransactionRulesResult) { + return nil, false + } + return o.TransactionRulesResult, true +} + +// HasTransactionRulesResult returns a boolean if a field has been set. +func (o *TransferData) HasTransactionRulesResult() bool { + if o != nil && !common.IsNil(o.TransactionRulesResult) { + return true + } + + return false +} + +// SetTransactionRulesResult gets a reference to the given TransactionRulesResult and assigns it to the TransactionRulesResult field. +func (o *TransferData) SetTransactionRulesResult(v TransactionRulesResult) { + o.TransactionRulesResult = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransferData) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransferData) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransferData) SetType(v string) { + o.Type = &v +} + +func (o TransferData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AccountHolder) { + toSerialize["accountHolder"] = o.AccountHolder + } + toSerialize["amount"] = o.Amount + if !common.IsNil(o.BalanceAccount) { + toSerialize["balanceAccount"] = o.BalanceAccount + } + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.Balances) { + toSerialize["balances"] = o.Balances + } + toSerialize["category"] = o.Category + if !common.IsNil(o.CategoryData) { + toSerialize["categoryData"] = o.CategoryData + } + if !common.IsNil(o.Counterparty) { + toSerialize["counterparty"] = o.Counterparty + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Direction) { + toSerialize["direction"] = o.Direction + } + if !common.IsNil(o.Events) { + toSerialize["events"] = o.Events + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.PaymentInstrument) { + toSerialize["paymentInstrument"] = o.PaymentInstrument + } + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + if !common.IsNil(o.Reference) { + toSerialize["reference"] = o.Reference + } + if !common.IsNil(o.ReferenceForBeneficiary) { + toSerialize["referenceForBeneficiary"] = o.ReferenceForBeneficiary + } + if !common.IsNil(o.SequenceNumber) { + toSerialize["sequenceNumber"] = o.SequenceNumber + } + toSerialize["status"] = o.Status + if !common.IsNil(o.Tracking) { + toSerialize["tracking"] = o.Tracking + } + if !common.IsNil(o.TransactionRulesResult) { + toSerialize["transactionRulesResult"] = o.TransactionRulesResult + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransferData struct { + value *TransferData + isSet bool +} + +func (v NullableTransferData) Get() *TransferData { + return v.value +} + +func (v *NullableTransferData) Set(val *TransferData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferData(val *TransferData) *NullableTransferData { + return &NullableTransferData{value: val, isSet: true} +} + +func (v NullableTransferData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *TransferData) isValidCategory() bool { + var allowedEnumValues = []string{ "bank", "internal", "issuedCard", "platformPayment" } + for _, allowed := range allowedEnumValues { + if o.GetCategory() == allowed { + return true + } + } + return false +} +func (o *TransferData) isValidDirection() bool { + var allowedEnumValues = []string{ "incoming", "outgoing" } + for _, allowed := range allowedEnumValues { + if o.GetDirection() == allowed { + return true + } + } + return false +} +func (o *TransferData) isValidReason() bool { + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *TransferData) isValidStatus() bool { + var allowedEnumValues = []string{ "approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *TransferData) isValidType() bool { + var allowedEnumValues = []string{ "atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceMigration", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "cashOutFee", "cashOutFunding", "cashOutInstruction", "chargeback", "chargebackCorrection", "chargebackReversal", "chargebackReversalCorrection", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback", "secondChargebackCorrection" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_transfer_data_category_data.go b/src/transferwebhooks/model_transfer_data_category_data.go new file mode 100644 index 000000000..b34c3a346 --- /dev/null +++ b/src/transferwebhooks/model_transfer_data_category_data.go @@ -0,0 +1,207 @@ +/* +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/v8/src/common" + "fmt" +) + +// TransferDataCategoryData - The relevant data according to the transfer category. +type TransferDataCategoryData struct { + BankCategoryData *BankCategoryData + InternalCategoryData *InternalCategoryData + IssuedCard *IssuedCard + PlatformPayment *PlatformPayment +} + +// BankCategoryDataAsTransferDataCategoryData is a convenience function that returns BankCategoryData wrapped in TransferDataCategoryData +func BankCategoryDataAsTransferDataCategoryData(v *BankCategoryData) TransferDataCategoryData { + return TransferDataCategoryData{ + BankCategoryData: v, + } +} + +// InternalCategoryDataAsTransferDataCategoryData is a convenience function that returns InternalCategoryData wrapped in TransferDataCategoryData +func InternalCategoryDataAsTransferDataCategoryData(v *InternalCategoryData) TransferDataCategoryData { + return TransferDataCategoryData{ + InternalCategoryData: v, + } +} + +// IssuedCardAsTransferDataCategoryData is a convenience function that returns IssuedCard wrapped in TransferDataCategoryData +func IssuedCardAsTransferDataCategoryData(v *IssuedCard) TransferDataCategoryData { + return TransferDataCategoryData{ + IssuedCard: v, + } +} + +// PlatformPaymentAsTransferDataCategoryData is a convenience function that returns PlatformPayment wrapped in TransferDataCategoryData +func PlatformPaymentAsTransferDataCategoryData(v *PlatformPayment) TransferDataCategoryData { + return TransferDataCategoryData{ + PlatformPayment: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferDataCategoryData) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into BankCategoryData + err = json.Unmarshal(data, &dst.BankCategoryData) + if err == nil { + jsonBankCategoryData, _ := json.Marshal(dst.BankCategoryData) + if string(jsonBankCategoryData) == "{}" || !dst.BankCategoryData.isValidType() { // empty struct + dst.BankCategoryData = nil + } else { + match++ + } + } else { + dst.BankCategoryData = nil + } + + // try to unmarshal data into InternalCategoryData + err = json.Unmarshal(data, &dst.InternalCategoryData) + if err == nil { + jsonInternalCategoryData, _ := json.Marshal(dst.InternalCategoryData) + if string(jsonInternalCategoryData) == "{}" || !dst.InternalCategoryData.isValidType() { // empty struct + dst.InternalCategoryData = nil + } else { + match++ + } + } else { + dst.InternalCategoryData = nil + } + + // try to unmarshal data into IssuedCard + err = json.Unmarshal(data, &dst.IssuedCard) + if err == nil { + jsonIssuedCard, _ := json.Marshal(dst.IssuedCard) + if string(jsonIssuedCard) == "{}" || !dst.IssuedCard.isValidType() { // empty struct + dst.IssuedCard = nil + } else { + match++ + } + } else { + dst.IssuedCard = nil + } + + // try to unmarshal data into PlatformPayment + err = json.Unmarshal(data, &dst.PlatformPayment) + if err == nil { + jsonPlatformPayment, _ := json.Marshal(dst.PlatformPayment) + if string(jsonPlatformPayment) == "{}" || !dst.PlatformPayment.isValidType() { // empty struct + dst.PlatformPayment = nil + } else { + match++ + } + } else { + dst.PlatformPayment = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.BankCategoryData = nil + dst.InternalCategoryData = nil + dst.IssuedCard = nil + dst.PlatformPayment = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferDataCategoryData)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferDataCategoryData)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferDataCategoryData) MarshalJSON() ([]byte, error) { + if src.BankCategoryData != nil { + return json.Marshal(&src.BankCategoryData) + } + + if src.InternalCategoryData != nil { + return json.Marshal(&src.InternalCategoryData) + } + + if src.IssuedCard != nil { + return json.Marshal(&src.IssuedCard) + } + + if src.PlatformPayment != nil { + return json.Marshal(&src.PlatformPayment) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferDataCategoryData) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.BankCategoryData != nil { + return obj.BankCategoryData + } + + if obj.InternalCategoryData != nil { + return obj.InternalCategoryData + } + + if obj.IssuedCard != nil { + return obj.IssuedCard + } + + if obj.PlatformPayment != nil { + return obj.PlatformPayment + } + + // all schemas are nil + return nil +} + +type NullableTransferDataCategoryData struct { + value *TransferDataCategoryData + isSet bool +} + +func (v NullableTransferDataCategoryData) Get() *TransferDataCategoryData { + return v.value +} + +func (v *NullableTransferDataCategoryData) Set(val *TransferDataCategoryData) { + v.value = val + v.isSet = true +} + +func (v NullableTransferDataCategoryData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferDataCategoryData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferDataCategoryData(val *TransferDataCategoryData) *NullableTransferDataCategoryData { + return &NullableTransferDataCategoryData{value: val, isSet: true} +} + +func (v NullableTransferDataCategoryData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferDataCategoryData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/src/transferwebhooks/model_transfer_event.go b/src/transferwebhooks/model_transfer_event.go new file mode 100644 index 000000000..2086cbc9e --- /dev/null +++ b/src/transferwebhooks/model_transfer_event.go @@ -0,0 +1,707 @@ +/* +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/v8/src/common" + "time" +) + +// checks if the TransferEvent type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferEvent{} + +// TransferEvent struct for TransferEvent +type TransferEvent struct { + Amount *Amount `json:"amount,omitempty"` + // The amount adjustments in this transfer. + AmountAdjustments []AmountAdjustment `json:"amountAdjustments,omitempty"` + // The date when the transfer request was sent. + BookingDate *time.Time `json:"bookingDate,omitempty"` + // The estimated time the beneficiary should have access to the funds. + EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` + // The unique identifier of the transfer event. + Id *string `json:"id,omitempty"` + Modification *Modification `json:"modification,omitempty"` + // The list of the balance mutation per event. + Mutations []BalanceMutation `json:"mutations,omitempty"` + OriginalAmount *Amount `json:"originalAmount,omitempty"` + // The reason for the transfer status. + Reason *string `json:"reason,omitempty"` + // SchemeTraceID retrieved from scheme. + SchemeTraceID *string `json:"schemeTraceID,omitempty"` + // SchemeUniqueTransactionID retrieved from scheme. + SchemeUniqueTransactionID *string `json:"schemeUniqueTransactionID,omitempty"` + // The status of the transfer event. + Status *string `json:"status,omitempty"` + // The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. + TransactionId *string `json:"transactionId,omitempty"` + // The type of the transfer event. Possible values: **accounting**, **tracking**. + Type *string `json:"type,omitempty"` + // The date when the tracking status was updated. + UpdateDate *time.Time `json:"updateDate,omitempty"` + // A future date, when the funds are expected to be deducted from or credited to the balance account. + ValueDate *time.Time `json:"valueDate,omitempty"` +} + +// NewTransferEvent instantiates a new TransferEvent 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 NewTransferEvent() *TransferEvent { + this := TransferEvent{} + return &this +} + +// NewTransferEventWithDefaults instantiates a new TransferEvent 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 NewTransferEventWithDefaults() *TransferEvent { + this := TransferEvent{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *TransferEvent) GetAmount() Amount { + if o == nil || common.IsNil(o.Amount) { + var ret Amount + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *TransferEvent) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given Amount and assigns it to the Amount field. +func (o *TransferEvent) SetAmount(v Amount) { + o.Amount = &v +} + +// GetAmountAdjustments returns the AmountAdjustments field value if set, zero value otherwise. +func (o *TransferEvent) GetAmountAdjustments() []AmountAdjustment { + if o == nil || common.IsNil(o.AmountAdjustments) { + var ret []AmountAdjustment + return ret + } + return o.AmountAdjustments +} + +// GetAmountAdjustmentsOk returns a tuple with the AmountAdjustments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetAmountAdjustmentsOk() ([]AmountAdjustment, bool) { + if o == nil || common.IsNil(o.AmountAdjustments) { + return nil, false + } + return o.AmountAdjustments, true +} + +// HasAmountAdjustments returns a boolean if a field has been set. +func (o *TransferEvent) HasAmountAdjustments() bool { + if o != nil && !common.IsNil(o.AmountAdjustments) { + return true + } + + return false +} + +// SetAmountAdjustments gets a reference to the given []AmountAdjustment and assigns it to the AmountAdjustments field. +func (o *TransferEvent) SetAmountAdjustments(v []AmountAdjustment) { + o.AmountAdjustments = v +} + +// GetBookingDate returns the BookingDate field value if set, zero value otherwise. +func (o *TransferEvent) GetBookingDate() time.Time { + if o == nil || common.IsNil(o.BookingDate) { + var ret time.Time + return ret + } + return *o.BookingDate +} + +// GetBookingDateOk returns a tuple with the BookingDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetBookingDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.BookingDate) { + return nil, false + } + return o.BookingDate, true +} + +// HasBookingDate returns a boolean if a field has been set. +func (o *TransferEvent) HasBookingDate() bool { + if o != nil && !common.IsNil(o.BookingDate) { + return true + } + + return false +} + +// SetBookingDate gets a reference to the given time.Time and assigns it to the BookingDate field. +func (o *TransferEvent) SetBookingDate(v time.Time) { + o.BookingDate = &v +} + +// GetEstimatedArrivalTime returns the EstimatedArrivalTime field value if set, zero value otherwise. +func (o *TransferEvent) GetEstimatedArrivalTime() time.Time { + if o == nil || common.IsNil(o.EstimatedArrivalTime) { + var ret time.Time + return ret + } + return *o.EstimatedArrivalTime +} + +// GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetEstimatedArrivalTimeOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.EstimatedArrivalTime) { + return nil, false + } + return o.EstimatedArrivalTime, true +} + +// HasEstimatedArrivalTime returns a boolean if a field has been set. +func (o *TransferEvent) HasEstimatedArrivalTime() bool { + if o != nil && !common.IsNil(o.EstimatedArrivalTime) { + return true + } + + return false +} + +// SetEstimatedArrivalTime gets a reference to the given time.Time and assigns it to the EstimatedArrivalTime field. +func (o *TransferEvent) SetEstimatedArrivalTime(v time.Time) { + o.EstimatedArrivalTime = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransferEvent) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransferEvent) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransferEvent) SetId(v string) { + o.Id = &v +} + +// GetModification returns the Modification field value if set, zero value otherwise. +func (o *TransferEvent) GetModification() Modification { + if o == nil || common.IsNil(o.Modification) { + var ret Modification + return ret + } + return *o.Modification +} + +// GetModificationOk returns a tuple with the Modification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetModificationOk() (*Modification, bool) { + if o == nil || common.IsNil(o.Modification) { + return nil, false + } + return o.Modification, true +} + +// HasModification returns a boolean if a field has been set. +func (o *TransferEvent) HasModification() bool { + if o != nil && !common.IsNil(o.Modification) { + return true + } + + return false +} + +// SetModification gets a reference to the given Modification and assigns it to the Modification field. +func (o *TransferEvent) SetModification(v Modification) { + o.Modification = &v +} + +// GetMutations returns the Mutations field value if set, zero value otherwise. +func (o *TransferEvent) GetMutations() []BalanceMutation { + if o == nil || common.IsNil(o.Mutations) { + var ret []BalanceMutation + return ret + } + return o.Mutations +} + +// GetMutationsOk returns a tuple with the Mutations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetMutationsOk() ([]BalanceMutation, bool) { + if o == nil || common.IsNil(o.Mutations) { + return nil, false + } + return o.Mutations, true +} + +// HasMutations returns a boolean if a field has been set. +func (o *TransferEvent) HasMutations() bool { + if o != nil && !common.IsNil(o.Mutations) { + return true + } + + return false +} + +// SetMutations gets a reference to the given []BalanceMutation and assigns it to the Mutations field. +func (o *TransferEvent) SetMutations(v []BalanceMutation) { + o.Mutations = v +} + +// GetOriginalAmount returns the OriginalAmount field value if set, zero value otherwise. +func (o *TransferEvent) GetOriginalAmount() Amount { + if o == nil || common.IsNil(o.OriginalAmount) { + var ret Amount + return ret + } + return *o.OriginalAmount +} + +// GetOriginalAmountOk returns a tuple with the OriginalAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetOriginalAmountOk() (*Amount, bool) { + if o == nil || common.IsNil(o.OriginalAmount) { + return nil, false + } + return o.OriginalAmount, true +} + +// HasOriginalAmount returns a boolean if a field has been set. +func (o *TransferEvent) HasOriginalAmount() bool { + if o != nil && !common.IsNil(o.OriginalAmount) { + return true + } + + return false +} + +// SetOriginalAmount gets a reference to the given Amount and assigns it to the OriginalAmount field. +func (o *TransferEvent) SetOriginalAmount(v Amount) { + o.OriginalAmount = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *TransferEvent) GetReason() string { + if o == nil || common.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetReasonOk() (*string, bool) { + if o == nil || common.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *TransferEvent) HasReason() bool { + if o != nil && !common.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *TransferEvent) SetReason(v string) { + o.Reason = &v +} + +// GetSchemeTraceID returns the SchemeTraceID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeTraceID() string { + if o == nil || common.IsNil(o.SchemeTraceID) { + var ret string + return ret + } + return *o.SchemeTraceID +} + +// GetSchemeTraceIDOk returns a tuple with the SchemeTraceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeTraceIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeTraceID) { + return nil, false + } + return o.SchemeTraceID, true +} + +// HasSchemeTraceID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeTraceID() bool { + if o != nil && !common.IsNil(o.SchemeTraceID) { + return true + } + + return false +} + +// SetSchemeTraceID gets a reference to the given string and assigns it to the SchemeTraceID field. +func (o *TransferEvent) SetSchemeTraceID(v string) { + o.SchemeTraceID = &v +} + +// GetSchemeUniqueTransactionID returns the SchemeUniqueTransactionID field value if set, zero value otherwise. +func (o *TransferEvent) GetSchemeUniqueTransactionID() string { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + var ret string + return ret + } + return *o.SchemeUniqueTransactionID +} + +// GetSchemeUniqueTransactionIDOk returns a tuple with the SchemeUniqueTransactionID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetSchemeUniqueTransactionIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SchemeUniqueTransactionID) { + return nil, false + } + return o.SchemeUniqueTransactionID, true +} + +// HasSchemeUniqueTransactionID returns a boolean if a field has been set. +func (o *TransferEvent) HasSchemeUniqueTransactionID() bool { + if o != nil && !common.IsNil(o.SchemeUniqueTransactionID) { + return true + } + + return false +} + +// SetSchemeUniqueTransactionID gets a reference to the given string and assigns it to the SchemeUniqueTransactionID field. +func (o *TransferEvent) SetSchemeUniqueTransactionID(v string) { + o.SchemeUniqueTransactionID = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *TransferEvent) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *TransferEvent) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *TransferEvent) SetStatus(v string) { + o.Status = &v +} + +// GetTransactionId returns the TransactionId field value if set, zero value otherwise. +func (o *TransferEvent) GetTransactionId() string { + if o == nil || common.IsNil(o.TransactionId) { + var ret string + return ret + } + return *o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetTransactionIdOk() (*string, bool) { + if o == nil || common.IsNil(o.TransactionId) { + return nil, false + } + return o.TransactionId, true +} + +// HasTransactionId returns a boolean if a field has been set. +func (o *TransferEvent) HasTransactionId() bool { + if o != nil && !common.IsNil(o.TransactionId) { + return true + } + + return false +} + +// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. +func (o *TransferEvent) SetTransactionId(v string) { + o.TransactionId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransferEvent) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransferEvent) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransferEvent) SetType(v string) { + o.Type = &v +} + +// GetUpdateDate returns the UpdateDate field value if set, zero value otherwise. +func (o *TransferEvent) GetUpdateDate() time.Time { + if o == nil || common.IsNil(o.UpdateDate) { + var ret time.Time + return ret + } + return *o.UpdateDate +} + +// GetUpdateDateOk returns a tuple with the UpdateDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetUpdateDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.UpdateDate) { + return nil, false + } + return o.UpdateDate, true +} + +// HasUpdateDate returns a boolean if a field has been set. +func (o *TransferEvent) HasUpdateDate() bool { + if o != nil && !common.IsNil(o.UpdateDate) { + return true + } + + return false +} + +// SetUpdateDate gets a reference to the given time.Time and assigns it to the UpdateDate field. +func (o *TransferEvent) SetUpdateDate(v time.Time) { + o.UpdateDate = &v +} + +// GetValueDate returns the ValueDate field value if set, zero value otherwise. +func (o *TransferEvent) GetValueDate() time.Time { + if o == nil || common.IsNil(o.ValueDate) { + var ret time.Time + return ret + } + return *o.ValueDate +} + +// GetValueDateOk returns a tuple with the ValueDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetValueDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.ValueDate) { + return nil, false + } + return o.ValueDate, true +} + +// HasValueDate returns a boolean if a field has been set. +func (o *TransferEvent) HasValueDate() bool { + if o != nil && !common.IsNil(o.ValueDate) { + return true + } + + return false +} + +// SetValueDate gets a reference to the given time.Time and assigns it to the ValueDate field. +func (o *TransferEvent) SetValueDate(v time.Time) { + o.ValueDate = &v +} + +func (o TransferEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !common.IsNil(o.AmountAdjustments) { + toSerialize["amountAdjustments"] = o.AmountAdjustments + } + if !common.IsNil(o.BookingDate) { + toSerialize["bookingDate"] = o.BookingDate + } + if !common.IsNil(o.EstimatedArrivalTime) { + toSerialize["estimatedArrivalTime"] = o.EstimatedArrivalTime + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.Modification) { + toSerialize["modification"] = o.Modification + } + if !common.IsNil(o.Mutations) { + toSerialize["mutations"] = o.Mutations + } + if !common.IsNil(o.OriginalAmount) { + toSerialize["originalAmount"] = o.OriginalAmount + } + if !common.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + if !common.IsNil(o.SchemeTraceID) { + toSerialize["schemeTraceID"] = o.SchemeTraceID + } + if !common.IsNil(o.SchemeUniqueTransactionID) { + toSerialize["schemeUniqueTransactionID"] = o.SchemeUniqueTransactionID + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.TransactionId) { + toSerialize["transactionId"] = o.TransactionId + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !common.IsNil(o.UpdateDate) { + toSerialize["updateDate"] = o.UpdateDate + } + if !common.IsNil(o.ValueDate) { + toSerialize["valueDate"] = o.ValueDate + } + return toSerialize, nil +} + +type NullableTransferEvent struct { + value *TransferEvent + isSet bool +} + +func (v NullableTransferEvent) Get() *TransferEvent { + return v.value +} + +func (v *NullableTransferEvent) Set(val *TransferEvent) { + v.value = val + v.isSet = true +} + +func (v NullableTransferEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferEvent(val *TransferEvent) *NullableTransferEvent { + return &NullableTransferEvent{value: val, isSet: true} +} + +func (v NullableTransferEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *TransferEvent) isValidReason() bool { + var allowedEnumValues = []string{ "amountLimitExceeded", "approved", "balanceAccountTemporarilyBlockedByTransactionRule", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "declinedByTransactionRule", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "scaFailed", "unknown" } + for _, allowed := range allowedEnumValues { + if o.GetReason() == allowed { + return true + } + } + return false +} +func (o *TransferEvent) isValidStatus() bool { + var allowedEnumValues = []string{ "approvalPending", "atmWithdrawal", "atmWithdrawalReversalPending", "atmWithdrawalReversed", "authAdjustmentAuthorised", "authAdjustmentError", "authAdjustmentRefused", "authorised", "bankTransfer", "bankTransferPending", "booked", "bookingPending", "cancelled", "capturePending", "captureReversalPending", "captureReversed", "captured", "capturedExternally", "chargeback", "chargebackExternally", "chargebackPending", "chargebackReversalPending", "chargebackReversed", "credited", "depositCorrection", "depositCorrectionPending", "dispute", "disputeClosed", "disputeExpired", "disputeNeedsReview", "error", "expired", "failed", "fee", "feePending", "internalTransfer", "internalTransferPending", "invoiceDeduction", "invoiceDeductionPending", "manualCorrectionPending", "manuallyCorrected", "matchedStatement", "matchedStatementPending", "merchantPayin", "merchantPayinPending", "merchantPayinReversed", "merchantPayinReversedPending", "miscCost", "miscCostPending", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} +func (o *TransferEvent) isValidType() bool { + var allowedEnumValues = []string{ "accounting", "tracking" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_transfer_notification_request.go b/src/transferwebhooks/model_transfer_notification_request.go new file mode 100644 index 000000000..b18403190 --- /dev/null +++ b/src/transferwebhooks/model_transfer_notification_request.go @@ -0,0 +1,191 @@ +/* +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/v8/src/common" +) + +// checks if the TransferNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferNotificationRequest{} + +// TransferNotificationRequest struct for TransferNotificationRequest +type TransferNotificationRequest struct { + Data TransferData `json:"data"` + // The environment from which the webhook originated. Possible values: **test**, **live**. + Environment string `json:"environment"` + // The type of webhook. + Type *string `json:"type,omitempty"` +} + +// NewTransferNotificationRequest instantiates a new TransferNotificationRequest 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 NewTransferNotificationRequest(data TransferData, environment string) *TransferNotificationRequest { + this := TransferNotificationRequest{} + this.Data = data + this.Environment = environment + return &this +} + +// NewTransferNotificationRequestWithDefaults instantiates a new TransferNotificationRequest 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 NewTransferNotificationRequestWithDefaults() *TransferNotificationRequest { + this := TransferNotificationRequest{} + return &this +} + +// GetData returns the Data field value +func (o *TransferNotificationRequest) GetData() TransferData { + if o == nil { + var ret TransferData + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TransferNotificationRequest) GetDataOk() (*TransferData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *TransferNotificationRequest) SetData(v TransferData) { + o.Data = v +} + +// GetEnvironment returns the Environment field value +func (o *TransferNotificationRequest) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *TransferNotificationRequest) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *TransferNotificationRequest) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransferNotificationRequest) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationRequest) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransferNotificationRequest) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransferNotificationRequest) SetType(v string) { + o.Type = &v +} + +func (o TransferNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["environment"] = o.Environment + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransferNotificationRequest struct { + value *TransferNotificationRequest + isSet bool +} + +func (v NullableTransferNotificationRequest) Get() *TransferNotificationRequest { + return v.value +} + +func (v *NullableTransferNotificationRequest) Set(val *TransferNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransferNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferNotificationRequest(val *TransferNotificationRequest) *NullableTransferNotificationRequest { + return &NullableTransferNotificationRequest{value: val, isSet: true} +} + +func (v NullableTransferNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *TransferNotificationRequest) isValidType() bool { + var allowedEnumValues = []string{ "balancePlatform.transfer.created", "balancePlatform.transfer.updated" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_transfer_notification_transfer_tracking.go b/src/transferwebhooks/model_transfer_notification_transfer_tracking.go new file mode 100644 index 000000000..40a4893c7 --- /dev/null +++ b/src/transferwebhooks/model_transfer_notification_transfer_tracking.go @@ -0,0 +1,174 @@ +/* +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/v8/src/common" + "time" +) + +// checks if the TransferNotificationTransferTracking type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferNotificationTransferTracking{} + +// TransferNotificationTransferTracking struct for TransferNotificationTransferTracking +type TransferNotificationTransferTracking struct { + // The estimated time the beneficiary should have access to the funds. + EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` + // The tracking status of the transfer. + Status *string `json:"status,omitempty"` +} + +// NewTransferNotificationTransferTracking instantiates a new TransferNotificationTransferTracking 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 NewTransferNotificationTransferTracking() *TransferNotificationTransferTracking { + this := TransferNotificationTransferTracking{} + return &this +} + +// NewTransferNotificationTransferTrackingWithDefaults instantiates a new TransferNotificationTransferTracking 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 NewTransferNotificationTransferTrackingWithDefaults() *TransferNotificationTransferTracking { + this := TransferNotificationTransferTracking{} + return &this +} + +// GetEstimatedArrivalTime returns the EstimatedArrivalTime field value if set, zero value otherwise. +func (o *TransferNotificationTransferTracking) GetEstimatedArrivalTime() time.Time { + if o == nil || common.IsNil(o.EstimatedArrivalTime) { + var ret time.Time + return ret + } + return *o.EstimatedArrivalTime +} + +// GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationTransferTracking) GetEstimatedArrivalTimeOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.EstimatedArrivalTime) { + return nil, false + } + return o.EstimatedArrivalTime, true +} + +// HasEstimatedArrivalTime returns a boolean if a field has been set. +func (o *TransferNotificationTransferTracking) HasEstimatedArrivalTime() bool { + if o != nil && !common.IsNil(o.EstimatedArrivalTime) { + return true + } + + return false +} + +// SetEstimatedArrivalTime gets a reference to the given time.Time and assigns it to the EstimatedArrivalTime field. +func (o *TransferNotificationTransferTracking) SetEstimatedArrivalTime(v time.Time) { + o.EstimatedArrivalTime = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *TransferNotificationTransferTracking) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationTransferTracking) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *TransferNotificationTransferTracking) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *TransferNotificationTransferTracking) SetStatus(v string) { + o.Status = &v +} + +func (o TransferNotificationTransferTracking) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferNotificationTransferTracking) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.EstimatedArrivalTime) { + toSerialize["estimatedArrivalTime"] = o.EstimatedArrivalTime + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableTransferNotificationTransferTracking struct { + value *TransferNotificationTransferTracking + isSet bool +} + +func (v NullableTransferNotificationTransferTracking) Get() *TransferNotificationTransferTracking { + return v.value +} + +func (v *NullableTransferNotificationTransferTracking) Set(val *TransferNotificationTransferTracking) { + v.value = val + v.isSet = true +} + +func (v NullableTransferNotificationTransferTracking) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferNotificationTransferTracking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferNotificationTransferTracking(val *TransferNotificationTransferTracking) *NullableTransferNotificationTransferTracking { + return &NullableTransferNotificationTransferTracking{value: val, isSet: true} +} + +func (v NullableTransferNotificationTransferTracking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferNotificationTransferTracking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *TransferNotificationTransferTracking) isValidStatus() bool { + var allowedEnumValues = []string{ "credited" } + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_transfer_notification_validation_fact.go b/src/transferwebhooks/model_transfer_notification_validation_fact.go new file mode 100644 index 000000000..a4ca8bf52 --- /dev/null +++ b/src/transferwebhooks/model_transfer_notification_validation_fact.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/v8/src/common" +) + +// checks if the TransferNotificationValidationFact type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferNotificationValidationFact{} + +// TransferNotificationValidationFact struct for TransferNotificationValidationFact +type TransferNotificationValidationFact struct { + // The evaluation result of the validation fact. + Result *string `json:"result,omitempty"` + // The type of the validation fact. + Type *string `json:"type,omitempty"` +} + +// NewTransferNotificationValidationFact instantiates a new TransferNotificationValidationFact 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 NewTransferNotificationValidationFact() *TransferNotificationValidationFact { + this := TransferNotificationValidationFact{} + return &this +} + +// NewTransferNotificationValidationFactWithDefaults instantiates a new TransferNotificationValidationFact 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 NewTransferNotificationValidationFactWithDefaults() *TransferNotificationValidationFact { + this := TransferNotificationValidationFact{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *TransferNotificationValidationFact) GetResult() string { + if o == nil || common.IsNil(o.Result) { + var ret string + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationValidationFact) GetResultOk() (*string, bool) { + if o == nil || common.IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *TransferNotificationValidationFact) HasResult() bool { + if o != nil && !common.IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given string and assigns it to the Result field. +func (o *TransferNotificationValidationFact) SetResult(v string) { + o.Result = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TransferNotificationValidationFact) GetType() string { + if o == nil || common.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationValidationFact) GetTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TransferNotificationValidationFact) HasType() bool { + if o != nil && !common.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TransferNotificationValidationFact) SetType(v string) { + o.Type = &v +} + +func (o TransferNotificationValidationFact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferNotificationValidationFact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Result) { + toSerialize["result"] = o.Result + } + if !common.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableTransferNotificationValidationFact struct { + value *TransferNotificationValidationFact + isSet bool +} + +func (v NullableTransferNotificationValidationFact) Get() *TransferNotificationValidationFact { + return v.value +} + +func (v *NullableTransferNotificationValidationFact) Set(val *TransferNotificationValidationFact) { + v.value = val + v.isSet = true +} + +func (v NullableTransferNotificationValidationFact) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferNotificationValidationFact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferNotificationValidationFact(val *TransferNotificationValidationFact) *NullableTransferNotificationValidationFact { + return &NullableTransferNotificationValidationFact{value: val, isSet: true} +} + +func (v NullableTransferNotificationValidationFact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferNotificationValidationFact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + diff --git a/src/transferwebhooks/model_uk_local_account_identification.go b/src/transferwebhooks/model_uk_local_account_identification.go new file mode 100644 index 000000000..cd7d48af3 --- /dev/null +++ b/src/transferwebhooks/model_uk_local_account_identification.go @@ -0,0 +1,185 @@ +/* +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/v8/src/common" +) + +// checks if the UKLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &UKLocalAccountIdentification{} + +// UKLocalAccountIdentification struct for UKLocalAccountIdentification +type UKLocalAccountIdentification struct { + // The 8-digit bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + SortCode string `json:"sortCode"` + // **ukLocal** + Type string `json:"type"` +} + +// NewUKLocalAccountIdentification instantiates a new UKLocalAccountIdentification 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 NewUKLocalAccountIdentification(accountNumber string, sortCode string, type_ string) *UKLocalAccountIdentification { + this := UKLocalAccountIdentification{} + this.AccountNumber = accountNumber + this.SortCode = sortCode + this.Type = type_ + return &this +} + +// NewUKLocalAccountIdentificationWithDefaults instantiates a new UKLocalAccountIdentification 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 NewUKLocalAccountIdentificationWithDefaults() *UKLocalAccountIdentification { + this := UKLocalAccountIdentification{} + var type_ string = "ukLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *UKLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *UKLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *UKLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetSortCode returns the SortCode field value +func (o *UKLocalAccountIdentification) GetSortCode() string { + if o == nil { + var ret string + return ret + } + + return o.SortCode +} + +// GetSortCodeOk returns a tuple with the SortCode field value +// and a boolean to check if the value has been set. +func (o *UKLocalAccountIdentification) GetSortCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SortCode, true +} + +// SetSortCode sets field value +func (o *UKLocalAccountIdentification) SetSortCode(v string) { + o.SortCode = v +} + +// GetType returns the Type field value +func (o *UKLocalAccountIdentification) 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 *UKLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *UKLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o UKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + toSerialize["sortCode"] = o.SortCode + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableUKLocalAccountIdentification struct { + value *UKLocalAccountIdentification + isSet bool +} + +func (v NullableUKLocalAccountIdentification) Get() *UKLocalAccountIdentification { + return v.value +} + +func (v *NullableUKLocalAccountIdentification) Set(val *UKLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableUKLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableUKLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUKLocalAccountIdentification(val *UKLocalAccountIdentification) *NullableUKLocalAccountIdentification { + return &NullableUKLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableUKLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUKLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *UKLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "ukLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} + diff --git a/src/transferwebhooks/model_us_local_account_identification.go b/src/transferwebhooks/model_us_local_account_identification.go new file mode 100644 index 000000000..be12735e5 --- /dev/null +++ b/src/transferwebhooks/model_us_local_account_identification.go @@ -0,0 +1,235 @@ +/* +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/v8/src/common" +) + +// checks if the USLocalAccountIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &USLocalAccountIdentification{} + +// USLocalAccountIdentification struct for USLocalAccountIdentification +type USLocalAccountIdentification struct { + // The bank account number, without separators or whitespace. + AccountNumber string `json:"accountNumber"` + // The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + AccountType *string `json:"accountType,omitempty"` + // The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + RoutingNumber string `json:"routingNumber"` + // **usLocal** + Type string `json:"type"` +} + +// NewUSLocalAccountIdentification instantiates a new USLocalAccountIdentification 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 NewUSLocalAccountIdentification(accountNumber string, routingNumber string, type_ string) *USLocalAccountIdentification { + this := USLocalAccountIdentification{} + this.AccountNumber = accountNumber + var accountType string = "checking" + this.AccountType = &accountType + this.RoutingNumber = routingNumber + this.Type = type_ + return &this +} + +// NewUSLocalAccountIdentificationWithDefaults instantiates a new USLocalAccountIdentification 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 NewUSLocalAccountIdentificationWithDefaults() *USLocalAccountIdentification { + this := USLocalAccountIdentification{} + var accountType string = "checking" + this.AccountType = &accountType + var type_ string = "usLocal" + this.Type = type_ + return &this +} + +// GetAccountNumber returns the AccountNumber field value +func (o *USLocalAccountIdentification) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *USLocalAccountIdentification) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *USLocalAccountIdentification) GetAccountType() string { + if o == nil || common.IsNil(o.AccountType) { + var ret string + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetAccountTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *USLocalAccountIdentification) HasAccountType() bool { + if o != nil && !common.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given string and assigns it to the AccountType field. +func (o *USLocalAccountIdentification) SetAccountType(v string) { + o.AccountType = &v +} + +// GetRoutingNumber returns the RoutingNumber field value +func (o *USLocalAccountIdentification) GetRoutingNumber() string { + if o == nil { + var ret string + return ret + } + + return o.RoutingNumber +} + +// GetRoutingNumberOk returns a tuple with the RoutingNumber field value +// and a boolean to check if the value has been set. +func (o *USLocalAccountIdentification) GetRoutingNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoutingNumber, true +} + +// SetRoutingNumber sets field value +func (o *USLocalAccountIdentification) SetRoutingNumber(v string) { + o.RoutingNumber = v +} + +// GetType returns the Type field value +func (o *USLocalAccountIdentification) 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 *USLocalAccountIdentification) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *USLocalAccountIdentification) SetType(v string) { + o.Type = v +} + +func (o USLocalAccountIdentification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o USLocalAccountIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountNumber"] = o.AccountNumber + if !common.IsNil(o.AccountType) { + toSerialize["accountType"] = o.AccountType + } + toSerialize["routingNumber"] = o.RoutingNumber + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableUSLocalAccountIdentification struct { + value *USLocalAccountIdentification + isSet bool +} + +func (v NullableUSLocalAccountIdentification) Get() *USLocalAccountIdentification { + return v.value +} + +func (v *NullableUSLocalAccountIdentification) Set(val *USLocalAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableUSLocalAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableUSLocalAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUSLocalAccountIdentification(val *USLocalAccountIdentification) *NullableUSLocalAccountIdentification { + return &NullableUSLocalAccountIdentification{value: val, isSet: true} +} + +func (v NullableUSLocalAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUSLocalAccountIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +func (o *USLocalAccountIdentification) isValidAccountType() bool { + var allowedEnumValues = []string{ "checking", "savings" } + for _, allowed := range allowedEnumValues { + if o.GetAccountType() == allowed { + return true + } + } + return false +} +func (o *USLocalAccountIdentification) isValidType() bool { + var allowedEnumValues = []string{ "usLocal" } + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} +