From 0eeb06b51a26ede1ca7732195a2a4de7b27cc7ab Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Fri, 3 Nov 2023 10:53:41 +0000 Subject: [PATCH] [create-pull-request] automated change --- src/balanceplatform/api_account_holders.go | 129 +- src/balanceplatform/api_balance_accounts.go | 55 +- .../api_bank_account_validation.go | 4 - src/balanceplatform/api_grant_accounts.go | 5 - src/balanceplatform/api_grant_offers.go | 10 - src/balanceplatform/api_network_tokens.go | 8 - .../api_payment_instrument_groups.go | 15 - .../api_payment_instruments.go | 30 - src/balanceplatform/api_platform.go | 10 - src/balanceplatform/api_transaction_rules.go | 20 - src/balanceplatform/api_transfer_routes.go | 107 ++ src/balanceplatform/client.go | 3 + .../model_address_requirement.go | 202 +++ .../model_amount_min_max_requirement.go | 239 +++ src/balanceplatform/model_balance_account.go | 2 +- .../model_balance_account_base.go | 2 +- .../model_balance_account_info.go | 2 +- .../model_balance_account_update_request.go | 37 - src/balanceplatform/model_bank_account.go | 115 ++ ...del_bank_account_account_identification.go | 563 +++++++ ...account_identification_type_requirement.go | 202 +++ .../model_bank_identification.go | 206 +++ src/balanceplatform/model_counterparty.go | 161 ++ .../model_counterparty_bank_restriction.go | 153 ++ .../model_create_sweep_configuration_v2.go | 541 ++++++ src/balanceplatform/model_delivery_address.go | 6 +- .../model_get_tax_form_response.go | 163 ++ .../model_hk_local_account_identification.go | 30 +- .../model_nz_local_account_identification.go | 60 +- .../model_payment_instrument_requirement.go | 285 ++++ .../model_platform_payment_configuration.go | 4 +- .../model_sweep_configuration_v2.go | 2 +- .../model_sweep_counterparty.go | 4 +- src/balanceplatform/model_transaction_rule.go | 2 +- .../model_transaction_rule_info.go | 2 +- .../model_transaction_rule_restrictions.go | 36 + src/balanceplatform/model_transfer_route.go | 291 ++++ .../model_transfer_route_request.go | 329 ++++ .../model_transfer_route_requirements.go | 203 +++ .../model_transfer_route_response.go | 125 ++ .../model_update_sweep_configuration_v2.go | 2 +- src/binlookup/model_ds_public_key_detail.go | 37 + src/binlookup/model_recurring.go | 2 +- .../model_create_checkout_session_request.go | 89 +- .../model_create_checkout_session_response.go | 37 + .../model_donation_payment_request.go | 14 +- .../model_payment_amount_update_request.go | 38 +- src/checkout/model_payment_cancel_request.go | 36 + src/checkout/model_payment_capture_request.go | 38 +- src/checkout/model_payment_details.go | 2 +- src/checkout/model_payment_refund_request.go | 38 +- src/checkout/model_payment_request.go | 16 +- .../model_payment_reversal_request.go | 36 + .../model_payment_verification_response.go | 14 +- src/checkout/model_recurring.go | 2 +- src/checkout/model_service_error_details.go | 232 +++ src/checkout/model_split.go | 45 +- src/checkout/model_split_amount.go | 4 +- ...model_standalone_payment_cancel_request.go | 36 + .../model_three_ds2_request_fields.go | 1483 +++++++++++++++++ .../model_account_holder_capability.go | 37 - .../model_balance_account.go | 2 +- .../model_platform_payment_configuration.go | 4 +- .../model_sweep_configuration_v2.go | 2 +- .../model_sweep_counterparty.go | 4 +- src/disputes/api_general.go | 47 - src/legalentity/api_documents.go | 18 +- src/legalentity/api_legal_entities.go | 14 +- src/legalentity/api_pci_questionnaires.go | 4 +- src/legalentity/api_terms_of_service.go | 8 +- src/legalentity/api_transfer_instruments.go | 14 +- .../model_accept_terms_of_service_request.go | 2 +- .../model_accept_terms_of_service_response.go | 4 +- src/legalentity/model_bank_account_info.go | 37 + ...ank_account_info_account_identification.go | 30 + src/legalentity/model_business_line.go | 2 +- .../model_generate_pci_description_request.go | 37 + ...l_get_terms_of_service_document_request.go | 70 +- ..._get_terms_of_service_document_response.go | 2 +- .../model_hk_local_account_identification.go | 30 +- src/legalentity/model_identification_data.go | 4 +- src/legalentity/model_legal_entity.go | 2 +- .../model_legal_entity_capability.go | 6 +- .../model_nz_local_account_identification.go | 156 ++ src/legalentity/model_onboarding_link_info.go | 2 +- .../model_supporting_entity_capability.go | 4 +- src/legalentity/model_transfer_instrument.go | 4 +- src/management/api_account_company_level.go | 15 - src/management/api_account_merchant_level.go | 20 - src/management/api_account_store_level.go | 40 - .../api_allowed_origins_company_level.go | 20 - .../api_allowed_origins_merchant_level.go | 20 - .../api_android_files_company_level.go | 19 - .../api_api_credentials_company_level.go | 20 - .../api_api_credentials_merchant_level.go | 20 - src/management/api_api_key_company_level.go | 5 - src/management/api_api_key_merchant_level.go | 5 - .../api_client_key_company_level.go | 5 - .../api_client_key_merchant_level.go | 5 - src/management/api_my_api_credential.go | 30 - .../api_payment_methods_merchant_level.go | 30 - .../api_payout_settings_merchant_level.go | 25 - .../api_split_configuration_merchant_level.go | 45 - .../api_terminal_actions_company_level.go | 10 - .../api_terminal_actions_terminal_level.go | 5 - .../api_terminal_orders_company_level.go | 50 - .../api_terminal_orders_merchant_level.go | 50 - .../api_terminal_settings_company_level.go | 20 - .../api_terminal_settings_merchant_level.go | 20 - .../api_terminal_settings_store_level.go | 40 - .../api_terminal_settings_terminal_level.go | 20 - .../api_terminals_terminal_level.go | 10 - src/management/api_users_company_level.go | 20 - src/management/api_users_merchant_level.go | 20 - src/management/api_webhooks_company_level.go | 35 - src/management/api_webhooks_merchant_level.go | 35 - src/payments/api_payments.go | 260 +++ src/payments/client.go | 6 +- src/payments/model_additional_data_airline.go | 26 +- .../model_additional_data_car_rental.go | 24 +- src/payments/model_additional_data_level23.go | 34 +- src/payments/model_additional_data_lodging.go | 10 +- ...odel_additional_data_temporary_services.go | 4 +- src/payments/model_payment_request.go | 2 +- src/payments/model_payment_request3d.go | 2 +- src/payments/model_payment_request3ds2.go | 2 +- src/payments/model_payment_result.go | 4 +- src/payments/model_recurring.go | 2 +- src/payments/model_split.go | 47 +- src/payments/model_split_amount.go | 4 +- src/payments/model_three_ds2_result.go | 86 +- src/payout/model_recurring.go | 2 +- src/recurring/model_recurring.go | 2 +- src/transfers/api_capital.go | 18 - src/transfers/api_transactions.go | 8 - src/transfers/api_transfers.go | 8 - src/transfers/model_rest_service_error.go | 21 +- src/transfers/model_transaction.go | 37 - .../model_additional_bank_identification.go | 2 +- src/transferwebhook/model_address.go | 2 +- src/transferwebhook/model_amount.go | 2 +- .../model_amount_adjustment.go | 2 +- .../model_au_local_account_identification.go | 2 +- src/transferwebhook/model_balance_mutation.go | 2 +- ..._balance_platform_notification_response.go | 2 +- src/transferwebhook/model_bank_account_v3.go | 2 +- ..._bank_account_v3_account_identification.go | 2 +- .../model_bank_category_data.go | 185 ++ .../model_br_local_account_identification.go | 2 +- .../model_ca_local_account_identification.go | 2 +- src/transferwebhook/model_counterparty_v3.go | 2 +- .../model_cz_local_account_identification.go | 2 +- .../model_dk_local_account_identification.go | 2 +- .../model_hk_local_account_identification.go | 32 +- .../model_hu_local_account_identification.go | 2 +- .../model_iban_account_identification.go | 2 +- .../model_internal_category_data.go | 213 +++ src/transferwebhook/model_issued_card.go | 304 ++++ src/transferwebhook/model_merchant_data.go | 39 +- src/transferwebhook/model_modification.go | 283 ++++ src/transferwebhook/model_name_location.go | 2 +- .../model_no_local_account_identification.go | 2 +- ...l_number_and_bic_account_identification.go | 2 +- .../model_nz_local_account_identification.go | 62 +- .../model_party_identification.go | 2 +- .../model_payment_instrument.go | 2 +- .../model_pl_local_account_identification.go | 2 +- src/transferwebhook/model_platform_payment.go | 333 ++++ .../model_relayed_authorisation_data.go | 2 +- src/transferwebhook/model_resource.go | 2 +- .../model_resource_reference.go | 2 +- .../model_se_local_account_identification.go | 2 +- .../model_sg_local_account_identification.go | 2 +- .../model_transaction_event_violation.go | 2 +- .../model_transaction_rule_reference.go | 76 +- .../model_transaction_rule_source.go | 2 +- .../model_transaction_rules_result.go | 108 +- src/transferwebhook/model_transfer_data.go | 620 +------ .../model_transfer_data_category_data.go | 203 +++ src/transferwebhook/model_transfer_event.go | 156 +- .../model_transfer_notification_request.go | 2 +- ...transfer_notification_transfer_tracking.go | 2 +- ...l_transfer_notification_validation_fact.go | 2 +- .../model_uk_local_account_identification.go | 2 +- .../model_us_local_account_identification.go | 2 +- 185 files changed, 8897 insertions(+), 2163 deletions(-) create mode 100644 src/balanceplatform/api_transfer_routes.go create mode 100644 src/balanceplatform/model_address_requirement.go create mode 100644 src/balanceplatform/model_amount_min_max_requirement.go create mode 100644 src/balanceplatform/model_bank_account.go create mode 100644 src/balanceplatform/model_bank_account_account_identification.go create mode 100644 src/balanceplatform/model_bank_account_identification_type_requirement.go create mode 100644 src/balanceplatform/model_bank_identification.go create mode 100644 src/balanceplatform/model_counterparty.go create mode 100644 src/balanceplatform/model_counterparty_bank_restriction.go create mode 100644 src/balanceplatform/model_create_sweep_configuration_v2.go create mode 100644 src/balanceplatform/model_get_tax_form_response.go create mode 100644 src/balanceplatform/model_payment_instrument_requirement.go create mode 100644 src/balanceplatform/model_transfer_route.go create mode 100644 src/balanceplatform/model_transfer_route_request.go create mode 100644 src/balanceplatform/model_transfer_route_requirements.go create mode 100644 src/balanceplatform/model_transfer_route_response.go create mode 100644 src/checkout/model_service_error_details.go create mode 100644 src/checkout/model_three_ds2_request_fields.go create mode 100644 src/legalentity/model_nz_local_account_identification.go create mode 100644 src/payments/api_payments.go create mode 100644 src/transferwebhook/model_bank_category_data.go create mode 100644 src/transferwebhook/model_internal_category_data.go create mode 100644 src/transferwebhook/model_issued_card.go create mode 100644 src/transferwebhook/model_modification.go create mode 100644 src/transferwebhook/model_platform_payment.go create mode 100644 src/transferwebhook/model_transfer_data_category_data.go diff --git a/src/balanceplatform/api_account_holders.go b/src/balanceplatform/api_account_holders.go index d051e561b..d2f272e21 100644 --- a/src/balanceplatform/api_account_holders.go +++ b/src/balanceplatform/api_account_holders.go @@ -73,7 +73,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -82,7 +81,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +89,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +97,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +105,6 @@ func (a *AccountHoldersApi) CreateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -169,7 +164,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +172,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +180,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +188,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +196,6 @@ func (a *AccountHoldersApi) GetAccountHolder(ctx context.Context, r AccountHolde } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,117 @@ func (a *AccountHoldersApi) GetAllBalanceAccountsOfAccountHolder(ctx context.Con } return *res, httpRes, serviceError } + if httpRes.StatusCode == 500 { + body, _ := ioutil.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 + formType *string + year *int32 +} + +// The type of tax form you want to retrieve. Accepted values are **us1099k** and **us1099nec** +func (r AccountHoldersApiGetTaxFormInput) FormType(formType string) AccountHoldersApiGetTaxFormInput { + r.formType = &formType + return r +} + +// The tax year in YYYY format for the tax form you want to retrieve +func (r AccountHoldersApiGetTaxFormInput) Year(year int32) AccountHoldersApiGetTaxFormInput { + r.year = &year + return r +} + +/* +Prepare a request for GetTaxForm +@param id The unique identifier of the account holder. +@return AccountHoldersApiGetTaxFormInput +*/ +func (a *AccountHoldersApi) GetTaxFormInput(id string) AccountHoldersApiGetTaxFormInput { + return AccountHoldersApiGetTaxFormInput{ + id: id, + } +} + +/* +GetTaxForm Get a tax form + +Generates a tax form for account holders operating in the US. For more information, refer to [Providing tax forms](https://docs.adyen.com/marketplaces-and-platforms/us-tax-forms/). +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r AccountHoldersApiGetTaxFormInput - Request parameters, see GetTaxFormInput +@return GetTaxFormResponse, *http.Response, error +*/ +func (a *AccountHoldersApi) GetTaxForm(ctx context.Context, r AccountHoldersApiGetTaxFormInput) (GetTaxFormResponse, *http.Response, error) { + 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) @@ -389,7 +485,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -398,7 +493,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -407,7 +501,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +509,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +517,6 @@ func (a *AccountHoldersApi) UpdateAccountHolder(ctx context.Context, r AccountHo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index b612f9d62..44981ac51 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -71,7 +71,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -122,12 +117,12 @@ func (a *BalanceAccountsApi) CreateBalanceAccount(ctx context.Context, r Balance // All parameters accepted by BalanceAccountsApi.CreateSweep type BalanceAccountsApiCreateSweepInput struct { - balanceAccountId string - sweepConfigurationV2 *SweepConfigurationV2 + balanceAccountId string + createSweepConfigurationV2 *CreateSweepConfigurationV2 } -func (r BalanceAccountsApiCreateSweepInput) SweepConfigurationV2(sweepConfigurationV2 SweepConfigurationV2) BalanceAccountsApiCreateSweepInput { - r.sweepConfigurationV2 = &sweepConfigurationV2 +func (r BalanceAccountsApiCreateSweepInput) CreateSweepConfigurationV2(createSweepConfigurationV2 CreateSweepConfigurationV2) BalanceAccountsApiCreateSweepInput { + r.createSweepConfigurationV2 = &createSweepConfigurationV2 return r } @@ -162,7 +157,7 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA httpRes, err := common.SendAPIRequest( ctx, a.Client, - r.sweepConfigurationV2, + r.createSweepConfigurationV2, res, http.MethodPost, a.BasePath()+path, @@ -175,7 +170,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +178,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -193,7 +186,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -202,7 +194,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -211,7 +202,6 @@ func (a *BalanceAccountsApi) CreateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -274,7 +264,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -283,7 +272,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -292,7 +280,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -301,7 +288,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -310,7 +296,6 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -392,7 +377,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -401,7 +385,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -410,7 +393,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -419,7 +401,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +409,6 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +490,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +498,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +506,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +514,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -546,7 +522,6 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -606,7 +581,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -615,7 +589,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -624,7 +597,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -633,7 +605,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -642,7 +613,6 @@ func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAcc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -705,7 +675,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -714,7 +683,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -723,7 +691,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -732,7 +699,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -741,7 +707,6 @@ func (a *BalanceAccountsApi) GetSweep(ctx context.Context, r BalanceAccountsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -807,7 +772,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -816,7 +780,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -825,7 +788,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -834,7 +796,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -843,7 +804,6 @@ func (a *BalanceAccountsApi) UpdateBalanceAccount(ctx context.Context, r Balance } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -912,7 +872,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -921,7 +880,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -930,7 +888,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -939,7 +896,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -948,7 +904,6 @@ func (a *BalanceAccountsApi) UpdateSweep(ctx context.Context, r BalanceAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_bank_account_validation.go b/src/balanceplatform/api_bank_account_validation.go index 4b6571115..60dc68a92 100644 --- a/src/balanceplatform/api_bank_account_validation.go +++ b/src/balanceplatform/api_bank_account_validation.go @@ -70,7 +70,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -79,7 +78,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +86,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +94,6 @@ func (a *BankAccountValidationApi) ValidateBankAccountIdentification(ctx context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_grant_accounts.go b/src/balanceplatform/api_grant_accounts.go index 183b9c35a..f1673a092 100644 --- a/src/balanceplatform/api_grant_accounts.go +++ b/src/balanceplatform/api_grant_accounts.go @@ -69,7 +69,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -78,7 +77,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +85,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +93,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +101,6 @@ func (a *GrantAccountsApi) GetGrantAccount(ctx context.Context, r GrantAccountsA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_grant_offers.go b/src/balanceplatform/api_grant_offers.go index dc9d0637e..7ef6c3142 100644 --- a/src/balanceplatform/api_grant_offers.go +++ b/src/balanceplatform/api_grant_offers.go @@ -75,7 +75,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *GrantOffersApi) GetAllAvailableGrantOffers(ctx context.Context, r Grant } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -171,7 +166,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +190,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +198,6 @@ func (a *GrantOffersApi) GetGrantOffer(ctx context.Context, r GrantOffersApiGetG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_network_tokens.go b/src/balanceplatform/api_network_tokens.go index 591a29632..cd0062d0b 100644 --- a/src/balanceplatform/api_network_tokens.go +++ b/src/balanceplatform/api_network_tokens.go @@ -69,7 +69,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -78,7 +77,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +85,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +93,6 @@ func (a *NetworkTokensApi) GetNetworkToken(ctx context.Context, r NetworkTokensA } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -162,7 +158,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -171,7 +166,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *NetworkTokensApi) UpdateNetworkToken(ctx context.Context, r NetworkToke } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_payment_instrument_groups.go b/src/balanceplatform/api_payment_instrument_groups.go index ffbdb0f25..45f8fe373 100644 --- a/src/balanceplatform/api_payment_instrument_groups.go +++ b/src/balanceplatform/api_payment_instrument_groups.go @@ -71,7 +71,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *PaymentInstrumentGroupsApi) CreatePaymentInstrumentGroup(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *PaymentInstrumentGroupsApi) GetAllTransactionRulesForPaymentInstrumentG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -263,7 +253,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -272,7 +261,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -281,7 +269,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +277,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +285,6 @@ func (a *PaymentInstrumentGroupsApi) GetPaymentInstrumentGroup(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_payment_instruments.go b/src/balanceplatform/api_payment_instruments.go index 8228fddee..22f04a2df 100644 --- a/src/balanceplatform/api_payment_instruments.go +++ b/src/balanceplatform/api_payment_instruments.go @@ -73,7 +73,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -82,7 +81,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +89,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +97,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +105,6 @@ func (a *PaymentInstrumentsApi) CreatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -169,7 +164,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +172,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +180,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +188,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +196,6 @@ func (a *PaymentInstrumentsApi) GetAllTransactionRulesForPaymentInstrument(ctx c } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -269,7 +259,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -278,7 +267,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +275,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +283,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +291,6 @@ func (a *PaymentInstrumentsApi) GetPanOfPaymentInstrument(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -365,7 +350,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -374,7 +358,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -383,7 +366,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -392,7 +374,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -401,7 +382,6 @@ func (a *PaymentInstrumentsApi) GetPaymentInstrument(ctx context.Context, r Paym } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -461,7 +441,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -470,7 +449,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -479,7 +457,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -488,7 +465,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -497,7 +473,6 @@ func (a *PaymentInstrumentsApi) ListNetworkTokens(ctx context.Context, r Payment } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -563,7 +538,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -572,7 +546,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -581,7 +554,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -590,7 +562,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -599,7 +570,6 @@ func (a *PaymentInstrumentsApi) UpdatePaymentInstrument(ctx context.Context, r P } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_platform.go b/src/balanceplatform/api_platform.go index 423b78c72..3dab7f7b1 100644 --- a/src/balanceplatform/api_platform.go +++ b/src/balanceplatform/api_platform.go @@ -91,7 +91,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +99,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +107,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -118,7 +115,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -127,7 +123,6 @@ func (a *PlatformApi) GetAllAccountHoldersUnderBalancePlatform(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +182,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +190,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +198,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +206,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -223,7 +214,6 @@ func (a *PlatformApi) GetBalancePlatform(ctx context.Context, r PlatformApiGetBa } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_transaction_rules.go b/src/balanceplatform/api_transaction_rules.go index 44c23f8b2..27c676d54 100644 --- a/src/balanceplatform/api_transaction_rules.go +++ b/src/balanceplatform/api_transaction_rules.go @@ -71,7 +71,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -80,7 +79,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -89,7 +87,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -98,7 +95,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -107,7 +103,6 @@ func (a *TransactionRulesApi) CreateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *TransactionRulesApi) DeleteTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -263,7 +253,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -272,7 +261,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -281,7 +269,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +277,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +285,6 @@ func (a *TransactionRulesApi) GetTransactionRule(ctx context.Context, r Transact } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -369,7 +354,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -378,7 +362,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -387,7 +370,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -396,7 +378,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -405,7 +386,6 @@ func (a *TransactionRulesApi) UpdateTransactionRule(ctx context.Context, r Trans } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/balanceplatform/api_transfer_routes.go b/src/balanceplatform/api_transfer_routes.go new file mode 100644 index 000000000..505f739c5 --- /dev/null +++ b/src/balanceplatform/api_transfer_routes.go @@ -0,0 +1,107 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// TransferRoutesApi service +type TransferRoutesApi common.Service + +// All parameters accepted by TransferRoutesApi.CalculateTransferRoutes +type TransferRoutesApiCalculateTransferRoutesInput struct { + transferRouteRequest *TransferRouteRequest +} + +func (r TransferRoutesApiCalculateTransferRoutesInput) TransferRouteRequest(transferRouteRequest TransferRouteRequest) TransferRoutesApiCalculateTransferRoutesInput { + r.transferRouteRequest = &transferRouteRequest + return r +} + +/* +Prepare a request for CalculateTransferRoutes + +@return TransferRoutesApiCalculateTransferRoutesInput +*/ +func (a *TransferRoutesApi) CalculateTransferRoutesInput() TransferRoutesApiCalculateTransferRoutesInput { + return TransferRoutesApiCalculateTransferRoutesInput{} +} + +/* +CalculateTransferRoutes Calculate transfer routes + +Returns available transfer routes based on a combination of transfer `country`, `currency`, `counterparty`, and `priorities`. Use this endpoint to find optimal transfer priorities and associated requirements before you [make a transfer](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers). + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r TransferRoutesApiCalculateTransferRoutesInput - Request parameters, see CalculateTransferRoutesInput +@return TransferRouteResponse, *http.Response, error +*/ +func (a *TransferRoutesApi) CalculateTransferRoutes(ctx context.Context, r TransferRoutesApiCalculateTransferRoutesInput) (TransferRouteResponse, *http.Response, error) { + 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 +} diff --git a/src/balanceplatform/client.go b/src/balanceplatform/client.go index 1a44dc259..8785e817d 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -38,6 +38,8 @@ type APIClient struct { PlatformApi *PlatformApi TransactionRulesApi *TransactionRulesApi + + TransferRoutesApi *TransferRoutesApi } // NewAPIClient creates a new API client. @@ -59,6 +61,7 @@ func NewAPIClient(client *common.Client) *APIClient { c.PaymentInstrumentsApi = (*PaymentInstrumentsApi)(&c.common) c.PlatformApi = (*PlatformApi)(&c.common) c.TransactionRulesApi = (*TransactionRulesApi)(&c.common) + c.TransferRoutesApi = (*TransferRoutesApi)(&c.common) return c } \ No newline at end of file diff --git a/src/balanceplatform/model_address_requirement.go b/src/balanceplatform/model_address_requirement.go new file mode 100644 index 000000000..4d0d511cb --- /dev/null +++ b/src/balanceplatform/model_address_requirement.go @@ -0,0 +1,202 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AddressRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AddressRequirement{} + +// AddressRequirement struct for AddressRequirement +type AddressRequirement struct { + // Specifies the required address related fields for a particular route. + Description *string `json:"description,omitempty"` + // List of address fields. + RequiredAddressFields []string `json:"requiredAddressFields,omitempty"` + // **addressRequirement** + Type string `json:"type"` +} + +// NewAddressRequirement instantiates a new AddressRequirement 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 NewAddressRequirement(type_ string) *AddressRequirement { + this := AddressRequirement{} + this.Type = type_ + return &this +} + +// NewAddressRequirementWithDefaults instantiates a new AddressRequirement 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 NewAddressRequirementWithDefaults() *AddressRequirement { + this := AddressRequirement{} + var type_ string = "addressRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddressRequirement) 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 *AddressRequirement) 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 *AddressRequirement) 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 *AddressRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetRequiredAddressFields returns the RequiredAddressFields field value if set, zero value otherwise. +func (o *AddressRequirement) GetRequiredAddressFields() []string { + if o == nil || common.IsNil(o.RequiredAddressFields) { + var ret []string + return ret + } + return o.RequiredAddressFields +} + +// GetRequiredAddressFieldsOk returns a tuple with the RequiredAddressFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddressRequirement) GetRequiredAddressFieldsOk() ([]string, bool) { + if o == nil || common.IsNil(o.RequiredAddressFields) { + return nil, false + } + return o.RequiredAddressFields, true +} + +// HasRequiredAddressFields returns a boolean if a field has been set. +func (o *AddressRequirement) HasRequiredAddressFields() bool { + if o != nil && !common.IsNil(o.RequiredAddressFields) { + return true + } + + return false +} + +// SetRequiredAddressFields gets a reference to the given []string and assigns it to the RequiredAddressFields field. +func (o *AddressRequirement) SetRequiredAddressFields(v []string) { + o.RequiredAddressFields = v +} + +// GetType returns the Type field value +func (o *AddressRequirement) 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 *AddressRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AddressRequirement) SetType(v string) { + o.Type = v +} + +func (o AddressRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddressRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.RequiredAddressFields) { + toSerialize["requiredAddressFields"] = o.RequiredAddressFields + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAddressRequirement struct { + value *AddressRequirement + isSet bool +} + +func (v NullableAddressRequirement) Get() *AddressRequirement { + return v.value +} + +func (v *NullableAddressRequirement) Set(val *AddressRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAddressRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAddressRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddressRequirement(val *AddressRequirement) *NullableAddressRequirement { + return &NullableAddressRequirement{value: val, isSet: true} +} + +func (v NullableAddressRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddressRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_amount_min_max_requirement.go b/src/balanceplatform/model_amount_min_max_requirement.go new file mode 100644 index 000000000..23ec876cf --- /dev/null +++ b/src/balanceplatform/model_amount_min_max_requirement.go @@ -0,0 +1,239 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the AmountMinMaxRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &AmountMinMaxRequirement{} + +// AmountMinMaxRequirement struct for AmountMinMaxRequirement +type AmountMinMaxRequirement struct { + // Specifies the eligible amounts for a particular route. + Description *string `json:"description,omitempty"` + // Maximum amount. + Max *int64 `json:"max,omitempty"` + // Minimum amount. + Min *int64 `json:"min,omitempty"` + // **amountMinMaxRequirement** + Type string `json:"type"` +} + +// NewAmountMinMaxRequirement instantiates a new AmountMinMaxRequirement 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 NewAmountMinMaxRequirement(type_ string) *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + this.Type = type_ + return &this +} + +// NewAmountMinMaxRequirementWithDefaults instantiates a new AmountMinMaxRequirement 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 NewAmountMinMaxRequirementWithDefaults() *AmountMinMaxRequirement { + this := AmountMinMaxRequirement{} + var type_ string = "amountMinMaxRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMax() int64 { + if o == nil || common.IsNil(o.Max) { + var ret int64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMaxOk() (*int64, bool) { + if o == nil || common.IsNil(o.Max) { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMax() bool { + if o != nil && !common.IsNil(o.Max) { + return true + } + + return false +} + +// SetMax gets a reference to the given int64 and assigns it to the Max field. +func (o *AmountMinMaxRequirement) SetMax(v int64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *AmountMinMaxRequirement) GetMin() int64 { + if o == nil || common.IsNil(o.Min) { + var ret int64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AmountMinMaxRequirement) GetMinOk() (*int64, bool) { + if o == nil || common.IsNil(o.Min) { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *AmountMinMaxRequirement) HasMin() bool { + if o != nil && !common.IsNil(o.Min) { + return true + } + + return false +} + +// SetMin gets a reference to the given int64 and assigns it to the Min field. +func (o *AmountMinMaxRequirement) SetMin(v int64) { + o.Min = &v +} + +// GetType returns the Type field value +func (o *AmountMinMaxRequirement) 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 *AmountMinMaxRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AmountMinMaxRequirement) SetType(v string) { + o.Type = v +} + +func (o AmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AmountMinMaxRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Max) { + toSerialize["max"] = o.Max + } + if !common.IsNil(o.Min) { + toSerialize["min"] = o.Min + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAmountMinMaxRequirement struct { + value *AmountMinMaxRequirement + isSet bool +} + +func (v NullableAmountMinMaxRequirement) Get() *AmountMinMaxRequirement { + return v.value +} + +func (v *NullableAmountMinMaxRequirement) Set(val *AmountMinMaxRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableAmountMinMaxRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableAmountMinMaxRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAmountMinMaxRequirement(val *AmountMinMaxRequirement) *NullableAmountMinMaxRequirement { + return &NullableAmountMinMaxRequirement{value: val, isSet: true} +} + +func (v NullableAmountMinMaxRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAmountMinMaxRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_balance_account.go b/src/balanceplatform/model_balance_account.go index ec97eadd0..3c6453366 100644 --- a/src/balanceplatform/model_balance_account.go +++ b/src/balanceplatform/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { 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**. + // 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"` diff --git a/src/balanceplatform/model_balance_account_base.go b/src/balanceplatform/model_balance_account_base.go index c648c2607..441ce0b3f 100644 --- a/src/balanceplatform/model_balance_account_base.go +++ b/src/balanceplatform/model_balance_account_base.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountBase{} type BalanceAccountBase 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"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // 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"` diff --git a/src/balanceplatform/model_balance_account_info.go b/src/balanceplatform/model_balance_account_info.go index 365fa8833..e68ba81cb 100644 --- a/src/balanceplatform/model_balance_account_info.go +++ b/src/balanceplatform/model_balance_account_info.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &BalanceAccountInfo{} type BalanceAccountInfo 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"` - // The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + // 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"` diff --git a/src/balanceplatform/model_balance_account_update_request.go b/src/balanceplatform/model_balance_account_update_request.go index fd5cd1fcd..136322d03 100644 --- a/src/balanceplatform/model_balance_account_update_request.go +++ b/src/balanceplatform/model_balance_account_update_request.go @@ -21,8 +21,6 @@ var _ common.MappedNullable = &BalanceAccountUpdateRequest{} type BalanceAccountUpdateRequest 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,omitempty"` - // The default currency code of this balance account, in three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) format. The default value is **EUR**. - 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"` // 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. @@ -85,38 +83,6 @@ func (o *BalanceAccountUpdateRequest) SetAccountHolderId(v string) { o.AccountHolderId = &v } -// GetDefaultCurrencyCode returns the DefaultCurrencyCode field value if set, zero value otherwise. -func (o *BalanceAccountUpdateRequest) 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 *BalanceAccountUpdateRequest) 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 *BalanceAccountUpdateRequest) 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 *BalanceAccountUpdateRequest) SetDefaultCurrencyCode(v string) { - o.DefaultCurrencyCode = &v -} - // GetDescription returns the Description field value if set, zero value otherwise. func (o *BalanceAccountUpdateRequest) GetDescription() string { if o == nil || common.IsNil(o.Description) { @@ -322,9 +288,6 @@ func (o BalanceAccountUpdateRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountHolderId) { toSerialize["accountHolderId"] = o.AccountHolderId } - if !common.IsNil(o.DefaultCurrencyCode) { - toSerialize["defaultCurrencyCode"] = o.DefaultCurrencyCode - } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } diff --git a/src/balanceplatform/model_bank_account.go b/src/balanceplatform/model_bank_account.go new file mode 100644 index 000000000..41a3e744c --- /dev/null +++ b/src/balanceplatform/model_bank_account.go @@ -0,0 +1,115 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankAccount type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccount{} + +// BankAccount struct for BankAccount +type BankAccount struct { + AccountIdentification BankAccountAccountIdentification `json:"accountIdentification"` +} + +// NewBankAccount instantiates a new BankAccount 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 NewBankAccount(accountIdentification BankAccountAccountIdentification) *BankAccount { + this := BankAccount{} + this.AccountIdentification = accountIdentification + return &this +} + +// NewBankAccountWithDefaults instantiates a new BankAccount 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 NewBankAccountWithDefaults() *BankAccount { + this := BankAccount{} + return &this +} + +// GetAccountIdentification returns the AccountIdentification field value +func (o *BankAccount) GetAccountIdentification() BankAccountAccountIdentification { + if o == nil { + var ret BankAccountAccountIdentification + 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 *BankAccount) GetAccountIdentificationOk() (*BankAccountAccountIdentification, bool) { + if o == nil { + return nil, false + } + return &o.AccountIdentification, true +} + +// SetAccountIdentification sets field value +func (o *BankAccount) SetAccountIdentification(v BankAccountAccountIdentification) { + o.AccountIdentification = v +} + +func (o BankAccount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountIdentification"] = o.AccountIdentification + return toSerialize, nil +} + +type NullableBankAccount struct { + value *BankAccount + isSet bool +} + +func (v NullableBankAccount) Get() *BankAccount { + return v.value +} + +func (v *NullableBankAccount) Set(val *BankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccount(val *BankAccount) *NullableBankAccount { + return &NullableBankAccount{value: val, isSet: true} +} + +func (v NullableBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +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 new file mode 100644 index 000000000..3537d8b5a --- /dev/null +++ b/src/balanceplatform/model_bank_account_account_identification.go @@ -0,0 +1,563 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "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 + NumberAndBicAccountIdentification *NumberAndBicAccountIdentification + PLLocalAccountIdentification *PLLocalAccountIdentification + SELocalAccountIdentification *SELocalAccountIdentification + SGLocalAccountIdentification *SGLocalAccountIdentification + UKLocalAccountIdentification *UKLocalAccountIdentification + USLocalAccountIdentification *USLocalAccountIdentification +} + +// AULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns AULocalAccountIdentification wrapped in BankAccountAccountIdentification +func AULocalAccountIdentificationAsBankAccountAccountIdentification(v *AULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + AULocalAccountIdentification: v, + } +} + +// BRLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns BRLocalAccountIdentification wrapped in BankAccountAccountIdentification +func BRLocalAccountIdentificationAsBankAccountAccountIdentification(v *BRLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + BRLocalAccountIdentification: v, + } +} + +// CALocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CALocalAccountIdentification wrapped in BankAccountAccountIdentification +func CALocalAccountIdentificationAsBankAccountAccountIdentification(v *CALocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CALocalAccountIdentification: v, + } +} + +// CZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns CZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func CZLocalAccountIdentificationAsBankAccountAccountIdentification(v *CZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + CZLocalAccountIdentification: v, + } +} + +// DKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns DKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func DKLocalAccountIdentificationAsBankAccountAccountIdentification(v *DKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + DKLocalAccountIdentification: v, + } +} + +// HKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func HKLocalAccountIdentificationAsBankAccountAccountIdentification(v *HKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HKLocalAccountIdentification: v, + } +} + +// HULocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns HULocalAccountIdentification wrapped in BankAccountAccountIdentification +func HULocalAccountIdentificationAsBankAccountAccountIdentification(v *HULocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + HULocalAccountIdentification: v, + } +} + +// IbanAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns IbanAccountIdentification wrapped in BankAccountAccountIdentification +func IbanAccountIdentificationAsBankAccountAccountIdentification(v *IbanAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + IbanAccountIdentification: v, + } +} + +// NOLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NOLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NOLocalAccountIdentificationAsBankAccountAccountIdentification(v *NOLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NOLocalAccountIdentification: v, + } +} + +// NZLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountAccountIdentification +func NZLocalAccountIdentificationAsBankAccountAccountIdentification(v *NZLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + +// NumberAndBicAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountAccountIdentification +func NumberAndBicAccountIdentificationAsBankAccountAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + NumberAndBicAccountIdentification: v, + } +} + +// PLLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns PLLocalAccountIdentification wrapped in BankAccountAccountIdentification +func PLLocalAccountIdentificationAsBankAccountAccountIdentification(v *PLLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + PLLocalAccountIdentification: v, + } +} + +// SELocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SELocalAccountIdentification wrapped in BankAccountAccountIdentification +func SELocalAccountIdentificationAsBankAccountAccountIdentification(v *SELocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SELocalAccountIdentification: v, + } +} + +// SGLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns SGLocalAccountIdentification wrapped in BankAccountAccountIdentification +func SGLocalAccountIdentificationAsBankAccountAccountIdentification(v *SGLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + SGLocalAccountIdentification: v, + } +} + +// UKLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns UKLocalAccountIdentification wrapped in BankAccountAccountIdentification +func UKLocalAccountIdentificationAsBankAccountAccountIdentification(v *UKLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + UKLocalAccountIdentification: v, + } +} + +// USLocalAccountIdentificationAsBankAccountAccountIdentification is a convenience function that returns USLocalAccountIdentification wrapped in BankAccountAccountIdentification +func USLocalAccountIdentificationAsBankAccountAccountIdentification(v *USLocalAccountIdentification) BankAccountAccountIdentification { + return BankAccountAccountIdentification{ + USLocalAccountIdentification: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BankAccountAccountIdentification) 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(BankAccountAccountIdentification)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BankAccountAccountIdentification)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BankAccountAccountIdentification) 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 *BankAccountAccountIdentification) 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 NullableBankAccountAccountIdentification struct { + value *BankAccountAccountIdentification + isSet bool +} + +func (v NullableBankAccountAccountIdentification) Get() *BankAccountAccountIdentification { + return v.value +} + +func (v *NullableBankAccountAccountIdentification) Set(val *BankAccountAccountIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountAccountIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountAccountIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountAccountIdentification(val *BankAccountAccountIdentification) *NullableBankAccountAccountIdentification { + return &NullableBankAccountAccountIdentification{value: val, isSet: true} +} + +func (v NullableBankAccountAccountIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountAccountIdentification) UnmarshalJSON(src []byte) error { + 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 new file mode 100644 index 000000000..77e73bbf7 --- /dev/null +++ b/src/balanceplatform/model_bank_account_identification_type_requirement.go @@ -0,0 +1,202 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankAccountIdentificationTypeRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccountIdentificationTypeRequirement{} + +// BankAccountIdentificationTypeRequirement struct for BankAccountIdentificationTypeRequirement +type BankAccountIdentificationTypeRequirement struct { + // List of bank account identification types: eg.; [iban , numberAndBic] + BankAccountIdentificationTypes []string `json:"bankAccountIdentificationTypes,omitempty"` + // Specifies the bank account details for a particular route per required field in this object depending on the country of the bank account and the currency of the transfer. + Description *string `json:"description,omitempty"` + // **bankAccountIdentificationTypeRequirement** + Type string `json:"type"` +} + +// NewBankAccountIdentificationTypeRequirement instantiates a new BankAccountIdentificationTypeRequirement 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 NewBankAccountIdentificationTypeRequirement(type_ string) *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + this.Type = type_ + return &this +} + +// NewBankAccountIdentificationTypeRequirementWithDefaults instantiates a new BankAccountIdentificationTypeRequirement 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 NewBankAccountIdentificationTypeRequirementWithDefaults() *BankAccountIdentificationTypeRequirement { + this := BankAccountIdentificationTypeRequirement{} + var type_ string = "bankAccountIdentificationTypeRequirement" + this.Type = type_ + return &this +} + +// GetBankAccountIdentificationTypes returns the BankAccountIdentificationTypes field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypes() []string { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + var ret []string + return ret + } + return o.BankAccountIdentificationTypes +} + +// GetBankAccountIdentificationTypesOk returns a tuple with the BankAccountIdentificationTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountIdentificationTypeRequirement) GetBankAccountIdentificationTypesOk() ([]string, bool) { + if o == nil || common.IsNil(o.BankAccountIdentificationTypes) { + return nil, false + } + return o.BankAccountIdentificationTypes, true +} + +// HasBankAccountIdentificationTypes returns a boolean if a field has been set. +func (o *BankAccountIdentificationTypeRequirement) HasBankAccountIdentificationTypes() bool { + if o != nil && !common.IsNil(o.BankAccountIdentificationTypes) { + return true + } + + return false +} + +// SetBankAccountIdentificationTypes gets a reference to the given []string and assigns it to the BankAccountIdentificationTypes field. +func (o *BankAccountIdentificationTypeRequirement) SetBankAccountIdentificationTypes(v []string) { + o.BankAccountIdentificationTypes = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetType returns the Type field value +func (o *BankAccountIdentificationTypeRequirement) 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 *BankAccountIdentificationTypeRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BankAccountIdentificationTypeRequirement) SetType(v string) { + o.Type = v +} + +func (o BankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccountIdentificationTypeRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccountIdentificationTypes) { + toSerialize["bankAccountIdentificationTypes"] = o.BankAccountIdentificationTypes + } + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBankAccountIdentificationTypeRequirement struct { + value *BankAccountIdentificationTypeRequirement + isSet bool +} + +func (v NullableBankAccountIdentificationTypeRequirement) Get() *BankAccountIdentificationTypeRequirement { + return v.value +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Set(val *BankAccountIdentificationTypeRequirement) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountIdentificationTypeRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountIdentificationTypeRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountIdentificationTypeRequirement(val *BankAccountIdentificationTypeRequirement) *NullableBankAccountIdentificationTypeRequirement { + return &NullableBankAccountIdentificationTypeRequirement{value: val, isSet: true} +} + +func (v NullableBankAccountIdentificationTypeRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountIdentificationTypeRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_bank_identification.go b/src/balanceplatform/model_bank_identification.go new file mode 100644 index 000000000..b32216178 --- /dev/null +++ b/src/balanceplatform/model_bank_identification.go @@ -0,0 +1,206 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the BankIdentification type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankIdentification{} + +// BankIdentification struct for BankIdentification +type BankIdentification struct { + Country *string `json:"country,omitempty"` + Identification *string `json:"identification,omitempty"` + IdentificationType *string `json:"identificationType,omitempty"` +} + +// NewBankIdentification instantiates a new BankIdentification 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 NewBankIdentification() *BankIdentification { + this := BankIdentification{} + return &this +} + +// NewBankIdentificationWithDefaults instantiates a new BankIdentification 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 NewBankIdentificationWithDefaults() *BankIdentification { + this := BankIdentification{} + return &this +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *BankIdentification) 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 *BankIdentification) 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 *BankIdentification) 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 *BankIdentification) SetCountry(v string) { + o.Country = &v +} + +// GetIdentification returns the Identification field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentification() string { + if o == nil || common.IsNil(o.Identification) { + var ret string + return ret + } + return *o.Identification +} + +// GetIdentificationOk returns a tuple with the Identification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationOk() (*string, bool) { + if o == nil || common.IsNil(o.Identification) { + return nil, false + } + return o.Identification, true +} + +// HasIdentification returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentification() bool { + if o != nil && !common.IsNil(o.Identification) { + return true + } + + return false +} + +// SetIdentification gets a reference to the given string and assigns it to the Identification field. +func (o *BankIdentification) SetIdentification(v string) { + o.Identification = &v +} + +// GetIdentificationType returns the IdentificationType field value if set, zero value otherwise. +func (o *BankIdentification) GetIdentificationType() string { + if o == nil || common.IsNil(o.IdentificationType) { + var ret string + return ret + } + return *o.IdentificationType +} + +// GetIdentificationTypeOk returns a tuple with the IdentificationType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankIdentification) GetIdentificationTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.IdentificationType) { + return nil, false + } + return o.IdentificationType, true +} + +// HasIdentificationType returns a boolean if a field has been set. +func (o *BankIdentification) HasIdentificationType() bool { + if o != nil && !common.IsNil(o.IdentificationType) { + return true + } + + return false +} + +// SetIdentificationType gets a reference to the given string and assigns it to the IdentificationType field. +func (o *BankIdentification) SetIdentificationType(v string) { + o.IdentificationType = &v +} + +func (o BankIdentification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankIdentification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Identification) { + toSerialize["identification"] = o.Identification + } + if !common.IsNil(o.IdentificationType) { + toSerialize["identificationType"] = o.IdentificationType + } + return toSerialize, nil +} + +type NullableBankIdentification struct { + value *BankIdentification + isSet bool +} + +func (v NullableBankIdentification) Get() *BankIdentification { + return v.value +} + +func (v *NullableBankIdentification) Set(val *BankIdentification) { + v.value = val + v.isSet = true +} + +func (v NullableBankIdentification) IsSet() bool { + return v.isSet +} + +func (v *NullableBankIdentification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankIdentification(val *BankIdentification) *NullableBankIdentification { + return &NullableBankIdentification{value: val, isSet: true} +} + +func (v NullableBankIdentification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankIdentification) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_counterparty.go b/src/balanceplatform/model_counterparty.go new file mode 100644 index 000000000..d1d386cf6 --- /dev/null +++ b/src/balanceplatform/model_counterparty.go @@ -0,0 +1,161 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Counterparty type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Counterparty{} + +// Counterparty struct for Counterparty +type Counterparty struct { + BankAccount *BankAccount `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"` +} + +// NewCounterparty instantiates a new Counterparty 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 NewCounterparty() *Counterparty { + this := Counterparty{} + return &this +} + +// NewCounterpartyWithDefaults instantiates a new Counterparty 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 NewCounterpartyWithDefaults() *Counterparty { + this := Counterparty{} + return &this +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *Counterparty) GetBankAccount() BankAccount { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccount + 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 *Counterparty) GetBankAccountOk() (*BankAccount, 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 *Counterparty) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccount and assigns it to the BankAccount field. +func (o *Counterparty) SetBankAccount(v BankAccount) { + o.BankAccount = &v +} + +// GetTransferInstrumentId returns the TransferInstrumentId field value if set, zero value otherwise. +func (o *Counterparty) 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 *Counterparty) 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 *Counterparty) 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 *Counterparty) SetTransferInstrumentId(v string) { + o.TransferInstrumentId = &v +} + +func (o Counterparty) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Counterparty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } + if !common.IsNil(o.TransferInstrumentId) { + toSerialize["transferInstrumentId"] = o.TransferInstrumentId + } + return toSerialize, nil +} + +type NullableCounterparty struct { + value *Counterparty + isSet bool +} + +func (v NullableCounterparty) Get() *Counterparty { + return v.value +} + +func (v *NullableCounterparty) Set(val *Counterparty) { + v.value = val + v.isSet = true +} + +func (v NullableCounterparty) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterparty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterparty(val *Counterparty) *NullableCounterparty { + return &NullableCounterparty{value: val, isSet: true} +} + +func (v NullableCounterparty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +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 new file mode 100644 index 000000000..8a65eafa2 --- /dev/null +++ b/src/balanceplatform/model_counterparty_bank_restriction.go @@ -0,0 +1,153 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CounterpartyBankRestriction type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CounterpartyBankRestriction{} + +// CounterpartyBankRestriction struct for CounterpartyBankRestriction +type CounterpartyBankRestriction struct { + // Defines how the condition must be evaluated. + Operation string `json:"operation"` + // List of counterparty Bank Institutions and the operation. + Value []BankIdentification `json:"value,omitempty"` +} + +// NewCounterpartyBankRestriction instantiates a new CounterpartyBankRestriction 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 NewCounterpartyBankRestriction(operation string) *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + this.Operation = operation + return &this +} + +// NewCounterpartyBankRestrictionWithDefaults instantiates a new CounterpartyBankRestriction 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 NewCounterpartyBankRestrictionWithDefaults() *CounterpartyBankRestriction { + this := CounterpartyBankRestriction{} + return &this +} + +// GetOperation returns the Operation field value +func (o *CounterpartyBankRestriction) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *CounterpartyBankRestriction) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *CounterpartyBankRestriction) SetOperation(v string) { + o.Operation = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CounterpartyBankRestriction) GetValue() []BankIdentification { + if o == nil || common.IsNil(o.Value) { + var ret []BankIdentification + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyBankRestriction) GetValueOk() ([]BankIdentification, bool) { + if o == nil || common.IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CounterpartyBankRestriction) HasValue() bool { + if o != nil && !common.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given []BankIdentification and assigns it to the Value field. +func (o *CounterpartyBankRestriction) SetValue(v []BankIdentification) { + o.Value = v +} + +func (o CounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyBankRestriction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["operation"] = o.Operation + if !common.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableCounterpartyBankRestriction struct { + value *CounterpartyBankRestriction + isSet bool +} + +func (v NullableCounterpartyBankRestriction) Get() *CounterpartyBankRestriction { + return v.value +} + +func (v *NullableCounterpartyBankRestriction) Set(val *CounterpartyBankRestriction) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyBankRestriction) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyBankRestriction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyBankRestriction(val *CounterpartyBankRestriction) *NullableCounterpartyBankRestriction { + return &NullableCounterpartyBankRestriction{value: val, isSet: true} +} + +func (v NullableCounterpartyBankRestriction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyBankRestriction) 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 new file mode 100644 index 000000000..57fbc2a00 --- /dev/null +++ b/src/balanceplatform/model_create_sweep_configuration_v2.go @@ -0,0 +1,541 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CreateSweepConfigurationV2 type satisfies the MappedNullable interface at compile time +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"` + 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 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"` + 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"` +} + +// NewCreateSweepConfigurationV2 instantiates a new CreateSweepConfigurationV2 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 NewCreateSweepConfigurationV2(counterparty SweepCounterparty, currency string, schedule SweepSchedule) *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + this.Counterparty = counterparty + this.Currency = currency + this.Schedule = schedule + var type_ string = "push" + this.Type = &type_ + return &this +} + +// NewCreateSweepConfigurationV2WithDefaults instantiates a new CreateSweepConfigurationV2 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 NewCreateSweepConfigurationV2WithDefaults() *CreateSweepConfigurationV2 { + this := CreateSweepConfigurationV2{} + var type_ string = "push" + this.Type = &type_ + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *CreateSweepConfigurationV2) SetCategory(v string) { + o.Category = &v +} + +// GetCounterparty returns the Counterparty field value +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) GetCounterpartyOk() (*SweepCounterparty, bool) { + if o == nil { + return nil, false + } + return &o.Counterparty, true +} + +// SetCounterparty sets field value +func (o *CreateSweepConfigurationV2) SetCounterparty(v SweepCounterparty) { + o.Counterparty = v +} + +// GetCurrency returns the Currency field value +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *CreateSweepConfigurationV2) SetCurrency(v string) { + o.Currency = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetDescription(v string) { + o.Description = &v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSweepConfigurationV2) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *CreateSweepConfigurationV2) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *CreateSweepConfigurationV2) SetPriorities(v []string) { + o.Priorities = v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetReason(v string) { + o.Reason = &v +} + +// GetSchedule returns the Schedule field value +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) GetScheduleOk() (*SweepSchedule, bool) { + if o == nil { + return nil, false + } + return &o.Schedule, true +} + +// SetSchedule sets field value +func (o *CreateSweepConfigurationV2) SetSchedule(v SweepSchedule) { + o.Schedule = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetStatus(v string) { + o.Status = &v +} + +// GetSweepAmount returns the SweepAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetSweepAmount(v Amount) { + o.SweepAmount = &v +} + +// GetTargetAmount returns the TargetAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetTargetAmount(v Amount) { + o.TargetAmount = &v +} + +// GetTriggerAmount returns the TriggerAmount field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetTriggerAmount(v Amount) { + o.TriggerAmount = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) 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 *CreateSweepConfigurationV2) SetType(v string) { + o.Type = &v +} + +func (o CreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSweepConfigurationV2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + toSerialize["counterparty"] = o.Counterparty + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + 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 NullableCreateSweepConfigurationV2 struct { + value *CreateSweepConfigurationV2 + isSet bool +} + +func (v NullableCreateSweepConfigurationV2) Get() *CreateSweepConfigurationV2 { + return v.value +} + +func (v *NullableCreateSweepConfigurationV2) Set(val *CreateSweepConfigurationV2) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSweepConfigurationV2) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSweepConfigurationV2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSweepConfigurationV2(val *CreateSweepConfigurationV2) *NullableCreateSweepConfigurationV2 { + return &NullableCreateSweepConfigurationV2{value: val, isSet: true} +} + +func (v NullableCreateSweepConfigurationV2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSweepConfigurationV2) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} +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 +} +func (o *CreateSweepConfigurationV2) isValidStatus() bool { + 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 +} diff --git a/src/balanceplatform/model_delivery_address.go b/src/balanceplatform/model_delivery_address.go index c3aa9827a..559831ea8 100644 --- a/src/balanceplatform/model_delivery_address.go +++ b/src/balanceplatform/model_delivery_address.go @@ -23,11 +23,11 @@ type DeliveryAddress struct { City *string `json:"city,omitempty"` // 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"` - // First line of the address. + // The street name. For example, if the address is \"Rokin 49\", provide \"Rokin\". Line1 *string `json:"line1,omitempty"` - // Second line of the address. + // The house number or name. For example, if the address is \"Rokin 49\", provide \"49\". Line2 *string `json:"line2,omitempty"` - // Third line of the address. + // Optional information about the address. Line3 *string `json:"line3,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"` diff --git a/src/balanceplatform/model_get_tax_form_response.go b/src/balanceplatform/model_get_tax_form_response.go new file mode 100644 index 000000000..3daa40e9a --- /dev/null +++ b/src/balanceplatform/model_get_tax_form_response.go @@ -0,0 +1,163 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the GetTaxFormResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &GetTaxFormResponse{} + +// GetTaxFormResponse struct for 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** + ContentType *string `json:"contentType,omitempty"` +} + +// NewGetTaxFormResponse instantiates a new GetTaxFormResponse 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 NewGetTaxFormResponse(content string) *GetTaxFormResponse { + this := GetTaxFormResponse{} + this.Content = content + return &this +} + +// NewGetTaxFormResponseWithDefaults instantiates a new GetTaxFormResponse 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 NewGetTaxFormResponseWithDefaults() *GetTaxFormResponse { + this := GetTaxFormResponse{} + return &this +} + +// GetContent returns the Content field value +func (o *GetTaxFormResponse) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *GetTaxFormResponse) SetContent(v string) { + o.Content = v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *GetTaxFormResponse) GetContentType() string { + if o == nil || common.IsNil(o.ContentType) { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTaxFormResponse) GetContentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *GetTaxFormResponse) HasContentType() bool { + if o != nil && !common.IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *GetTaxFormResponse) SetContentType(v string) { + o.ContentType = &v +} + +func (o GetTaxFormResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTaxFormResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content"] = o.Content + if !common.IsNil(o.ContentType) { + toSerialize["contentType"] = o.ContentType + } + return toSerialize, nil +} + +type NullableGetTaxFormResponse struct { + value *GetTaxFormResponse + isSet bool +} + +func (v NullableGetTaxFormResponse) Get() *GetTaxFormResponse { + return v.value +} + +func (v *NullableGetTaxFormResponse) Set(val *GetTaxFormResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTaxFormResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTaxFormResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTaxFormResponse(val *GetTaxFormResponse) *NullableGetTaxFormResponse { + return &NullableGetTaxFormResponse{value: val, isSet: true} +} + +func (v NullableGetTaxFormResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTaxFormResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_hk_local_account_identification.go b/src/balanceplatform/model_hk_local_account_identification.go index ed428fdc7..d59ee7d48 100644 --- a/src/balanceplatform/model_hk_local_account_identification.go +++ b/src/balanceplatform/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // 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 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // 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, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_nz_local_account_identification.go b/src/balanceplatform/model_nz_local_account_identification.go index 5ce8d0e2c..0017e8726 100644 --- a/src/balanceplatform/model_nz_local_account_identification.go +++ b/src/balanceplatform/model_nz_local_account_identification.go @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // 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"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification struct { // 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, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) 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 *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/balanceplatform/model_payment_instrument_requirement.go b/src/balanceplatform/model_payment_instrument_requirement.go new file mode 100644 index 000000000..99a73768f --- /dev/null +++ b/src/balanceplatform/model_payment_instrument_requirement.go @@ -0,0 +1,285 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the PaymentInstrumentRequirement type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaymentInstrumentRequirement{} + +// PaymentInstrumentRequirement struct for PaymentInstrumentRequirement +type PaymentInstrumentRequirement struct { + // Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + Description *string `json:"description,omitempty"` + // The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + IssuingCountryCode *string `json:"issuingCountryCode,omitempty"` + // Specifies if the requirement only applies to transfers to another balance platform. + OnlyForCrossBalancePlatform *bool `json:"onlyForCrossBalancePlatform,omitempty"` + // The type of the payment instrument. For example, \"BankAccount\" or \"Card\". + PaymentInstrumentType *string `json:"paymentInstrumentType,omitempty"` + // **paymentInstrumentRequirement** + Type string `json:"type"` +} + +// NewPaymentInstrumentRequirement instantiates a new PaymentInstrumentRequirement 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 NewPaymentInstrumentRequirement(type_ string) *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + this.Type = type_ + return &this +} + +// NewPaymentInstrumentRequirementWithDefaults instantiates a new PaymentInstrumentRequirement 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 NewPaymentInstrumentRequirementWithDefaults() *PaymentInstrumentRequirement { + this := PaymentInstrumentRequirement{} + var type_ string = "paymentInstrumentRequirement" + this.Type = type_ + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) SetDescription(v string) { + o.Description = &v +} + +// GetIssuingCountryCode returns the IssuingCountryCode field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCode() string { + if o == nil || common.IsNil(o.IssuingCountryCode) { + var ret string + return ret + } + return *o.IssuingCountryCode +} + +// GetIssuingCountryCodeOk returns a tuple with the IssuingCountryCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetIssuingCountryCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.IssuingCountryCode) { + return nil, false + } + return o.IssuingCountryCode, true +} + +// HasIssuingCountryCode returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasIssuingCountryCode() bool { + if o != nil && !common.IsNil(o.IssuingCountryCode) { + return true + } + + return false +} + +// SetIssuingCountryCode gets a reference to the given string and assigns it to the IssuingCountryCode field. +func (o *PaymentInstrumentRequirement) SetIssuingCountryCode(v string) { + o.IssuingCountryCode = &v +} + +// GetOnlyForCrossBalancePlatform returns the OnlyForCrossBalancePlatform field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatform() bool { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + var ret bool + return ret + } + return *o.OnlyForCrossBalancePlatform +} + +// GetOnlyForCrossBalancePlatformOk returns a tuple with the OnlyForCrossBalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetOnlyForCrossBalancePlatformOk() (*bool, bool) { + if o == nil || common.IsNil(o.OnlyForCrossBalancePlatform) { + return nil, false + } + return o.OnlyForCrossBalancePlatform, true +} + +// HasOnlyForCrossBalancePlatform returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasOnlyForCrossBalancePlatform() bool { + if o != nil && !common.IsNil(o.OnlyForCrossBalancePlatform) { + return true + } + + return false +} + +// SetOnlyForCrossBalancePlatform gets a reference to the given bool and assigns it to the OnlyForCrossBalancePlatform field. +func (o *PaymentInstrumentRequirement) SetOnlyForCrossBalancePlatform(v bool) { + o.OnlyForCrossBalancePlatform = &v +} + +// GetPaymentInstrumentType returns the PaymentInstrumentType field value if set, zero value otherwise. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentType() string { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + var ret string + return ret + } + return *o.PaymentInstrumentType +} + +// GetPaymentInstrumentTypeOk returns a tuple with the PaymentInstrumentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentInstrumentRequirement) GetPaymentInstrumentTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentType) { + return nil, false + } + return o.PaymentInstrumentType, true +} + +// HasPaymentInstrumentType returns a boolean if a field has been set. +func (o *PaymentInstrumentRequirement) HasPaymentInstrumentType() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentType) { + return true + } + + return false +} + +// SetPaymentInstrumentType gets a reference to the given string and assigns it to the PaymentInstrumentType field. +func (o *PaymentInstrumentRequirement) SetPaymentInstrumentType(v string) { + o.PaymentInstrumentType = &v +} + +// GetType returns the Type field value +func (o *PaymentInstrumentRequirement) 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 *PaymentInstrumentRequirement) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentInstrumentRequirement) SetType(v string) { + o.Type = v +} + +func (o PaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentInstrumentRequirement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !common.IsNil(o.IssuingCountryCode) { + toSerialize["issuingCountryCode"] = o.IssuingCountryCode + } + if !common.IsNil(o.OnlyForCrossBalancePlatform) { + toSerialize["onlyForCrossBalancePlatform"] = o.OnlyForCrossBalancePlatform + } + if !common.IsNil(o.PaymentInstrumentType) { + toSerialize["paymentInstrumentType"] = o.PaymentInstrumentType + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullablePaymentInstrumentRequirement struct { + value *PaymentInstrumentRequirement + isSet bool +} + +func (v NullablePaymentInstrumentRequirement) Get() *PaymentInstrumentRequirement { + return v.value +} + +func (v *NullablePaymentInstrumentRequirement) Set(val *PaymentInstrumentRequirement) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentInstrumentRequirement) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentInstrumentRequirement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentInstrumentRequirement(val *PaymentInstrumentRequirement) *NullablePaymentInstrumentRequirement { + return &NullablePaymentInstrumentRequirement{value: val, isSet: true} +} + +func (v NullablePaymentInstrumentRequirement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentInstrumentRequirement) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} +func (o *PaymentInstrumentRequirement) isValidType() bool { + var allowedEnumValues = []string{"paymentInstrumentRequirement"} + 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 3ca3a239b..e536afeea 100644 --- a/src/balanceplatform/model_platform_payment_configuration.go +++ b/src/balanceplatform/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ 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/receive-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\"**. + // 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/receive-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/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // 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"` } diff --git a/src/balanceplatform/model_sweep_configuration_v2.go b/src/balanceplatform/model_sweep_configuration_v2.go index 958ef22a0..256a531d7 100644 --- a/src/balanceplatform/model_sweep_configuration_v2.go +++ b/src/balanceplatform/model_sweep_configuration_v2.go @@ -541,7 +541,7 @@ func (o *SweepConfigurationV2) isValidCategory() bool { return false } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + 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 diff --git a/src/balanceplatform/model_sweep_counterparty.go b/src/balanceplatform/model_sweep_counterparty.go index 5b1661360..439d19a30 100644 --- a/src/balanceplatform/model_sweep_counterparty.go +++ b/src/balanceplatform/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &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, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // 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/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // 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"` } diff --git a/src/balanceplatform/model_transaction_rule.go b/src/balanceplatform/model_transaction_rule.go index 5d8d16d24..9d37299d9 100644 --- a/src/balanceplatform/model_transaction_rule.go +++ b/src/balanceplatform/model_transaction_rule.go @@ -33,7 +33,7 @@ type TransactionRule struct { 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. Possible values: **authorization**, **authentication**, **tokenization**. + // 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"` 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**. diff --git a/src/balanceplatform/model_transaction_rule_info.go b/src/balanceplatform/model_transaction_rule_info.go index 73ef9bf3d..b0b09402f 100644 --- a/src/balanceplatform/model_transaction_rule_info.go +++ b/src/balanceplatform/model_transaction_rule_info.go @@ -31,7 +31,7 @@ type TransactionRuleInfo struct { 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. Possible values: **authorization**, **authentication**, **tokenization**. + // 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"` 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**. diff --git a/src/balanceplatform/model_transaction_rule_restrictions.go b/src/balanceplatform/model_transaction_rule_restrictions.go index 9cfc81a9e..04b9c830b 100644 --- a/src/balanceplatform/model_transaction_rule_restrictions.go +++ b/src/balanceplatform/model_transaction_rule_restrictions.go @@ -21,6 +21,7 @@ var _ common.MappedNullable = &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"` @@ -116,6 +117,38 @@ func (o *TransactionRuleRestrictions) SetBrandVariants(v BrandVariantsRestrictio o.BrandVariants = &v } +// GetCounterpartyBank returns the CounterpartyBank field value if set, zero value otherwise. +func (o *TransactionRuleRestrictions) GetCounterpartyBank() CounterpartyBankRestriction { + if o == nil || common.IsNil(o.CounterpartyBank) { + var ret CounterpartyBankRestriction + return ret + } + return *o.CounterpartyBank +} + +// GetCounterpartyBankOk returns a tuple with the CounterpartyBank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionRuleRestrictions) GetCounterpartyBankOk() (*CounterpartyBankRestriction, bool) { + if o == nil || common.IsNil(o.CounterpartyBank) { + return nil, false + } + return o.CounterpartyBank, true +} + +// HasCounterpartyBank returns a boolean if a field has been set. +func (o *TransactionRuleRestrictions) HasCounterpartyBank() bool { + if o != nil && !common.IsNil(o.CounterpartyBank) { + return true + } + + return false +} + +// SetCounterpartyBank gets a reference to the given CounterpartyBankRestriction and assigns it to the CounterpartyBank field. +func (o *TransactionRuleRestrictions) SetCounterpartyBank(v CounterpartyBankRestriction) { + o.CounterpartyBank = &v +} + // GetCountries returns the Countries field value if set, zero value otherwise. func (o *TransactionRuleRestrictions) GetCountries() CountriesRestriction { if o == nil || common.IsNil(o.Countries) { @@ -516,6 +549,9 @@ func (o TransactionRuleRestrictions) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BrandVariants) { toSerialize["brandVariants"] = o.BrandVariants } + if !common.IsNil(o.CounterpartyBank) { + toSerialize["counterpartyBank"] = o.CounterpartyBank + } if !common.IsNil(o.Countries) { toSerialize["countries"] = o.Countries } diff --git a/src/balanceplatform/model_transfer_route.go b/src/balanceplatform/model_transfer_route.go new file mode 100644 index 000000000..d6e82ef49 --- /dev/null +++ b/src/balanceplatform/model_transfer_route.go @@ -0,0 +1,291 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRoute type satisfies the MappedNullable interface at compile time +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. + 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"` + Requirements *TransferRouteRequirements `json:"requirements,omitempty"` +} + +// NewTransferRoute instantiates a new TransferRoute 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 NewTransferRoute() *TransferRoute { + this := TransferRoute{} + return &this +} + +// NewTransferRouteWithDefaults instantiates a new TransferRoute 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 NewTransferRouteWithDefaults() *TransferRoute { + this := TransferRoute{} + return &this +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *TransferRoute) GetCategory() string { + if o == nil || common.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetCategoryOk() (*string, bool) { + if o == nil || common.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *TransferRoute) HasCategory() bool { + if o != nil && !common.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *TransferRoute) SetCategory(v string) { + o.Category = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) SetCurrency(v string) { + o.Currency = &v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) 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 *TransferRoute) SetPriority(v string) { + o.Priority = &v +} + +// GetRequirements returns the Requirements field value if set, zero value otherwise. +func (o *TransferRoute) GetRequirements() TransferRouteRequirements { + if o == nil || common.IsNil(o.Requirements) { + var ret TransferRouteRequirements + return ret + } + return *o.Requirements +} + +// GetRequirementsOk returns a tuple with the Requirements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRoute) GetRequirementsOk() (*TransferRouteRequirements, bool) { + if o == nil || common.IsNil(o.Requirements) { + return nil, false + } + return o.Requirements, true +} + +// HasRequirements returns a boolean if a field has been set. +func (o *TransferRoute) HasRequirements() bool { + if o != nil && !common.IsNil(o.Requirements) { + return true + } + + return false +} + +// SetRequirements gets a reference to the given TransferRouteRequirements and assigns it to the Requirements field. +func (o *TransferRoute) SetRequirements(v TransferRouteRequirements) { + o.Requirements = &v +} + +func (o TransferRoute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRoute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !common.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !common.IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !common.IsNil(o.Requirements) { + toSerialize["requirements"] = o.Requirements + } + return toSerialize, nil +} + +type NullableTransferRoute struct { + value *TransferRoute + isSet bool +} + +func (v NullableTransferRoute) Get() *TransferRoute { + return v.value +} + +func (v *NullableTransferRoute) Set(val *TransferRoute) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRoute(val *TransferRoute) *NullableTransferRoute { + return &NullableTransferRoute{value: val, isSet: true} +} + +func (v NullableTransferRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *TransferRoute) isValidCategory() bool { + var allowedEnumValues = []string{"bank", "card", "grants", "internal", "issuedCard", "migration", "platformPayment", "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 +} diff --git a/src/balanceplatform/model_transfer_route_request.go b/src/balanceplatform/model_transfer_route_request.go new file mode 100644 index 000000000..2f6c76195 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_request.go @@ -0,0 +1,329 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRouteRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteRequest{} + +// TransferRouteRequest struct for TransferRouteRequest +type TransferRouteRequest struct { + // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). Required if `counterparty` is **transferInstrumentId**. + 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"` + 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"` + // The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + Currency string `json:"currency"` + // The list of priorities for the bank transfer. Priorities set the speed at which the transfer is sent and the fees that you have to pay. Multiple values can be provided. 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). + Priorities []string `json:"priorities,omitempty"` +} + +// NewTransferRouteRequest instantiates a new TransferRouteRequest 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 NewTransferRouteRequest(balancePlatform string, category string, currency string) *TransferRouteRequest { + this := TransferRouteRequest{} + this.BalancePlatform = balancePlatform + this.Category = category + this.Currency = currency + return &this +} + +// NewTransferRouteRequestWithDefaults instantiates a new TransferRouteRequest 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 NewTransferRouteRequestWithDefaults() *TransferRouteRequest { + this := TransferRouteRequest{} + return &this +} + +// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. +func (o *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) SetBalanceAccountId(v string) { + o.BalanceAccountId = &v +} + +// GetBalancePlatform returns the BalancePlatform field value +func (o *TransferRouteRequest) 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 *TransferRouteRequest) GetBalancePlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BalancePlatform, true +} + +// SetBalancePlatform sets field value +func (o *TransferRouteRequest) SetBalancePlatform(v string) { + o.BalancePlatform = v +} + +// GetCategory returns the Category field value +func (o *TransferRouteRequest) 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 *TransferRouteRequest) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *TransferRouteRequest) SetCategory(v string) { + o.Category = v +} + +// GetCounterparty returns the Counterparty field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetCounterparty() Counterparty { + if o == nil || common.IsNil(o.Counterparty) { + var ret Counterparty + 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 *TransferRouteRequest) GetCounterpartyOk() (*Counterparty, 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 *TransferRouteRequest) HasCounterparty() bool { + if o != nil && !common.IsNil(o.Counterparty) { + return true + } + + return false +} + +// SetCounterparty gets a reference to the given Counterparty and assigns it to the Counterparty field. +func (o *TransferRouteRequest) SetCounterparty(v Counterparty) { + o.Counterparty = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) 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 *TransferRouteRequest) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value +func (o *TransferRouteRequest) 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 *TransferRouteRequest) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *TransferRouteRequest) SetCurrency(v string) { + o.Currency = v +} + +// GetPriorities returns the Priorities field value if set, zero value otherwise. +func (o *TransferRouteRequest) GetPriorities() []string { + if o == nil || common.IsNil(o.Priorities) { + var ret []string + return ret + } + return o.Priorities +} + +// GetPrioritiesOk returns a tuple with the Priorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteRequest) GetPrioritiesOk() ([]string, bool) { + if o == nil || common.IsNil(o.Priorities) { + return nil, false + } + return o.Priorities, true +} + +// HasPriorities returns a boolean if a field has been set. +func (o *TransferRouteRequest) HasPriorities() bool { + if o != nil && !common.IsNil(o.Priorities) { + return true + } + + return false +} + +// SetPriorities gets a reference to the given []string and assigns it to the Priorities field. +func (o *TransferRouteRequest) SetPriorities(v []string) { + o.Priorities = v +} + +func (o TransferRouteRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalanceAccountId) { + toSerialize["balanceAccountId"] = o.BalanceAccountId + } + toSerialize["balancePlatform"] = o.BalancePlatform + toSerialize["category"] = o.Category + if !common.IsNil(o.Counterparty) { + toSerialize["counterparty"] = o.Counterparty + } + if !common.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + toSerialize["currency"] = o.Currency + if !common.IsNil(o.Priorities) { + toSerialize["priorities"] = o.Priorities + } + return toSerialize, nil +} + +type NullableTransferRouteRequest struct { + value *TransferRouteRequest + isSet bool +} + +func (v NullableTransferRouteRequest) Get() *TransferRouteRequest { + return v.value +} + +func (v *NullableTransferRouteRequest) Set(val *TransferRouteRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequest(val *TransferRouteRequest) *NullableTransferRouteRequest { + return &NullableTransferRouteRequest{value: val, isSet: true} +} + +func (v NullableTransferRouteRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} diff --git a/src/balanceplatform/model_transfer_route_requirements.go b/src/balanceplatform/model_transfer_route_requirements.go new file mode 100644 index 000000000..052b22446 --- /dev/null +++ b/src/balanceplatform/model_transfer_route_requirements.go @@ -0,0 +1,203 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "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 + BankAccountIdentificationTypeRequirement *BankAccountIdentificationTypeRequirement + PaymentInstrumentRequirement *PaymentInstrumentRequirement +} + +// AddressRequirementAsTransferRouteRequirements is a convenience function that returns AddressRequirement wrapped in TransferRouteRequirements +func AddressRequirementAsTransferRouteRequirements(v *AddressRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AddressRequirement: v, + } +} + +// AmountMinMaxRequirementAsTransferRouteRequirements is a convenience function that returns AmountMinMaxRequirement wrapped in TransferRouteRequirements +func AmountMinMaxRequirementAsTransferRouteRequirements(v *AmountMinMaxRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + AmountMinMaxRequirement: v, + } +} + +// BankAccountIdentificationTypeRequirementAsTransferRouteRequirements is a convenience function that returns BankAccountIdentificationTypeRequirement wrapped in TransferRouteRequirements +func BankAccountIdentificationTypeRequirementAsTransferRouteRequirements(v *BankAccountIdentificationTypeRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + BankAccountIdentificationTypeRequirement: v, + } +} + +// PaymentInstrumentRequirementAsTransferRouteRequirements is a convenience function that returns PaymentInstrumentRequirement wrapped in TransferRouteRequirements +func PaymentInstrumentRequirementAsTransferRouteRequirements(v *PaymentInstrumentRequirement) TransferRouteRequirements { + return TransferRouteRequirements{ + PaymentInstrumentRequirement: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferRouteRequirements) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AddressRequirement + err = json.Unmarshal(data, &dst.AddressRequirement) + if err == nil { + jsonAddressRequirement, _ := json.Marshal(dst.AddressRequirement) + if string(jsonAddressRequirement) == "{}" || !dst.AddressRequirement.isValidType() { // empty struct + dst.AddressRequirement = nil + } else { + match++ + } + } else { + dst.AddressRequirement = nil + } + + // try to unmarshal data into AmountMinMaxRequirement + err = json.Unmarshal(data, &dst.AmountMinMaxRequirement) + if err == nil { + jsonAmountMinMaxRequirement, _ := json.Marshal(dst.AmountMinMaxRequirement) + if string(jsonAmountMinMaxRequirement) == "{}" || !dst.AmountMinMaxRequirement.isValidType() { // empty struct + dst.AmountMinMaxRequirement = nil + } else { + match++ + } + } else { + dst.AmountMinMaxRequirement = nil + } + + // try to unmarshal data into BankAccountIdentificationTypeRequirement + err = json.Unmarshal(data, &dst.BankAccountIdentificationTypeRequirement) + if err == nil { + jsonBankAccountIdentificationTypeRequirement, _ := json.Marshal(dst.BankAccountIdentificationTypeRequirement) + if string(jsonBankAccountIdentificationTypeRequirement) == "{}" || !dst.BankAccountIdentificationTypeRequirement.isValidType() { // empty struct + dst.BankAccountIdentificationTypeRequirement = nil + } else { + match++ + } + } else { + dst.BankAccountIdentificationTypeRequirement = nil + } + + // try to unmarshal data into PaymentInstrumentRequirement + err = json.Unmarshal(data, &dst.PaymentInstrumentRequirement) + if err == nil { + jsonPaymentInstrumentRequirement, _ := json.Marshal(dst.PaymentInstrumentRequirement) + if string(jsonPaymentInstrumentRequirement) == "{}" || !dst.PaymentInstrumentRequirement.isValidType() { // empty struct + dst.PaymentInstrumentRequirement = nil + } else { + match++ + } + } else { + dst.PaymentInstrumentRequirement = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AddressRequirement = nil + dst.AmountMinMaxRequirement = nil + dst.BankAccountIdentificationTypeRequirement = nil + dst.PaymentInstrumentRequirement = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferRouteRequirements)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferRouteRequirements)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferRouteRequirements) MarshalJSON() ([]byte, error) { + if src.AddressRequirement != nil { + return json.Marshal(&src.AddressRequirement) + } + + if src.AmountMinMaxRequirement != nil { + return json.Marshal(&src.AmountMinMaxRequirement) + } + + if src.BankAccountIdentificationTypeRequirement != nil { + return json.Marshal(&src.BankAccountIdentificationTypeRequirement) + } + + if src.PaymentInstrumentRequirement != nil { + return json.Marshal(&src.PaymentInstrumentRequirement) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferRouteRequirements) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AddressRequirement != nil { + return obj.AddressRequirement + } + + if obj.AmountMinMaxRequirement != nil { + return obj.AmountMinMaxRequirement + } + + if obj.BankAccountIdentificationTypeRequirement != nil { + return obj.BankAccountIdentificationTypeRequirement + } + + if obj.PaymentInstrumentRequirement != nil { + return obj.PaymentInstrumentRequirement + } + + // all schemas are nil + return nil +} + +type NullableTransferRouteRequirements struct { + value *TransferRouteRequirements + isSet bool +} + +func (v NullableTransferRouteRequirements) Get() *TransferRouteRequirements { + return v.value +} + +func (v *NullableTransferRouteRequirements) Set(val *TransferRouteRequirements) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteRequirements) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteRequirements) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteRequirements(val *TransferRouteRequirements) *NullableTransferRouteRequirements { + return &NullableTransferRouteRequirements{value: val, isSet: true} +} + +func (v NullableTransferRouteRequirements) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +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 new file mode 100644 index 000000000..16bca6daf --- /dev/null +++ b/src/balanceplatform/model_transfer_route_response.go @@ -0,0 +1,125 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the TransferRouteResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TransferRouteResponse{} + +// TransferRouteResponse struct for TransferRouteResponse +type TransferRouteResponse struct { + // List of available priorities for a transfer, along with requirements. Use this information to initiate a transfer. + TransferRoutes []TransferRoute `json:"transferRoutes,omitempty"` +} + +// NewTransferRouteResponse instantiates a new TransferRouteResponse 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 NewTransferRouteResponse() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// NewTransferRouteResponseWithDefaults instantiates a new TransferRouteResponse 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 NewTransferRouteResponseWithDefaults() *TransferRouteResponse { + this := TransferRouteResponse{} + return &this +} + +// GetTransferRoutes returns the TransferRoutes field value if set, zero value otherwise. +func (o *TransferRouteResponse) GetTransferRoutes() []TransferRoute { + if o == nil || common.IsNil(o.TransferRoutes) { + var ret []TransferRoute + return ret + } + return o.TransferRoutes +} + +// GetTransferRoutesOk returns a tuple with the TransferRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRouteResponse) GetTransferRoutesOk() ([]TransferRoute, bool) { + if o == nil || common.IsNil(o.TransferRoutes) { + return nil, false + } + return o.TransferRoutes, true +} + +// HasTransferRoutes returns a boolean if a field has been set. +func (o *TransferRouteResponse) HasTransferRoutes() bool { + if o != nil && !common.IsNil(o.TransferRoutes) { + return true + } + + return false +} + +// SetTransferRoutes gets a reference to the given []TransferRoute and assigns it to the TransferRoutes field. +func (o *TransferRouteResponse) SetTransferRoutes(v []TransferRoute) { + o.TransferRoutes = v +} + +func (o TransferRouteResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRouteResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.TransferRoutes) { + toSerialize["transferRoutes"] = o.TransferRoutes + } + return toSerialize, nil +} + +type NullableTransferRouteResponse struct { + value *TransferRouteResponse + isSet bool +} + +func (v NullableTransferRouteResponse) Get() *TransferRouteResponse { + return v.value +} + +func (v *NullableTransferRouteResponse) Set(val *TransferRouteResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRouteResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRouteResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRouteResponse(val *TransferRouteResponse) *NullableTransferRouteResponse { + return &NullableTransferRouteResponse{value: val, isSet: true} +} + +func (v NullableTransferRouteResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRouteResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_update_sweep_configuration_v2.go b/src/balanceplatform/model_update_sweep_configuration_v2.go index 2a78a5d5d..23f34ed9f 100644 --- a/src/balanceplatform/model_update_sweep_configuration_v2.go +++ b/src/balanceplatform/model_update_sweep_configuration_v2.go @@ -577,7 +577,7 @@ func (o *UpdateSweepConfigurationV2) isValidCategory() bool { return false } func (o *UpdateSweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + 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 diff --git a/src/binlookup/model_ds_public_key_detail.go b/src/binlookup/model_ds_public_key_detail.go index 84e97b2c0..3edc29169 100644 --- a/src/binlookup/model_ds_public_key_detail.go +++ b/src/binlookup/model_ds_public_key_detail.go @@ -27,6 +27,8 @@ type DSPublicKeyDetail struct { FromSDKVersion *string `json:"fromSDKVersion,omitempty"` // Public key. The 3D Secure 2 SDK encrypts the device information by using the DS public key. PublicKey *string `json:"publicKey,omitempty"` + // Directory Server root certificates. The 3D Secure 2 SDK verifies the ACS signed content using the rootCertificates. + RootCertificates *string `json:"rootCertificates,omitempty"` } // NewDSPublicKeyDetail instantiates a new DSPublicKeyDetail object @@ -174,6 +176,38 @@ func (o *DSPublicKeyDetail) SetPublicKey(v string) { o.PublicKey = &v } +// GetRootCertificates returns the RootCertificates field value if set, zero value otherwise. +func (o *DSPublicKeyDetail) GetRootCertificates() string { + if o == nil || common.IsNil(o.RootCertificates) { + var ret string + return ret + } + return *o.RootCertificates +} + +// GetRootCertificatesOk returns a tuple with the RootCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DSPublicKeyDetail) GetRootCertificatesOk() (*string, bool) { + if o == nil || common.IsNil(o.RootCertificates) { + return nil, false + } + return o.RootCertificates, true +} + +// HasRootCertificates returns a boolean if a field has been set. +func (o *DSPublicKeyDetail) HasRootCertificates() bool { + if o != nil && !common.IsNil(o.RootCertificates) { + return true + } + + return false +} + +// SetRootCertificates gets a reference to the given string and assigns it to the RootCertificates field. +func (o *DSPublicKeyDetail) SetRootCertificates(v string) { + o.RootCertificates = &v +} + func (o DSPublicKeyDetail) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -196,6 +230,9 @@ func (o DSPublicKeyDetail) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.PublicKey) { toSerialize["publicKey"] = o.PublicKey } + if !common.IsNil(o.RootCertificates) { + toSerialize["rootCertificates"] = o.RootCertificates + } return toSerialize, nil } diff --git a/src/binlookup/model_recurring.go b/src/binlookup/model_recurring.go index b69a533ee..dccf2a73c 100644 --- a/src/binlookup/model_recurring.go +++ b/src/binlookup/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/checkout/model_create_checkout_session_request.go b/src/checkout/model_create_checkout_session_request.go index 2b12d4406..727e67cf6 100644 --- a/src/checkout/model_create_checkout_session_request.go +++ b/src/checkout/model_create_checkout_session_request.go @@ -66,7 +66,9 @@ type CreateCheckoutSessionRequest struct { // 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 *map[string]string `json:"metadata,omitempty"` + 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"` PlatformChargebackLogic *PlatformChargebackLogic `json:"platformChargebackLogic,omitempty"` // Date after which no further authorisations shall be performed. Only for 3D Secure 2. @@ -97,6 +99,8 @@ type CreateCheckoutSessionRequest struct { 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 **. , ' _ - ? + * /_**. ShopperStatement *string `json:"shopperStatement,omitempty"` + // Set to true to show the payment amount per installment. + ShowInstallmentAmount *bool `json:"showInstallmentAmount,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. @@ -126,6 +130,8 @@ func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, refe this := CreateCheckoutSessionRequest{} this.Amount = amount this.MerchantAccount = merchantAccount + var mode string = "embedded" + this.Mode = &mode this.Reference = reference this.ReturnUrl = returnUrl var splitCardFundingSources bool = false @@ -140,6 +146,8 @@ func NewCreateCheckoutSessionRequest(amount Amount, merchantAccount string, refe // but it doesn't guarantee that properties required by API are set func NewCreateCheckoutSessionRequestWithDefaults() *CreateCheckoutSessionRequest { this := CreateCheckoutSessionRequest{} + var mode string = "embedded" + this.Mode = &mode var splitCardFundingSources bool = false this.SplitCardFundingSources = &splitCardFundingSources var threeDSAuthenticationOnly bool = false @@ -1059,6 +1067,38 @@ func (o *CreateCheckoutSessionRequest) SetMetadata(v map[string]string) { o.Metadata = &v } +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetMode() string { + if o == nil || common.IsNil(o.Mode) { + var ret string + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetModeOk() (*string, bool) { + if o == nil || common.IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasMode() bool { + if o != nil && !common.IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given string and assigns it to the Mode field. +func (o *CreateCheckoutSessionRequest) SetMode(v string) { + o.Mode = &v +} + // GetMpiData returns the MpiData field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetMpiData() ThreeDSecureData { if o == nil || common.IsNil(o.MpiData) { @@ -1587,6 +1627,38 @@ func (o *CreateCheckoutSessionRequest) SetShopperStatement(v string) { o.ShopperStatement = &v } +// GetShowInstallmentAmount returns the ShowInstallmentAmount field value if set, zero value otherwise. +func (o *CreateCheckoutSessionRequest) GetShowInstallmentAmount() bool { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + var ret bool + return ret + } + return *o.ShowInstallmentAmount +} + +// GetShowInstallmentAmountOk returns a tuple with the ShowInstallmentAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionRequest) GetShowInstallmentAmountOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + return nil, false + } + return o.ShowInstallmentAmount, true +} + +// HasShowInstallmentAmount returns a boolean if a field has been set. +func (o *CreateCheckoutSessionRequest) HasShowInstallmentAmount() bool { + if o != nil && !common.IsNil(o.ShowInstallmentAmount) { + return true + } + + return false +} + +// SetShowInstallmentAmount gets a reference to the given bool and assigns it to the ShowInstallmentAmount field. +func (o *CreateCheckoutSessionRequest) SetShowInstallmentAmount(v bool) { + o.ShowInstallmentAmount = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionRequest) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -1971,6 +2043,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } + if !common.IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } if !common.IsNil(o.MpiData) { toSerialize["mpiData"] = o.MpiData } @@ -2018,6 +2093,9 @@ func (o CreateCheckoutSessionRequest) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShopperStatement) { toSerialize["shopperStatement"] = o.ShopperStatement } + if !common.IsNil(o.ShowInstallmentAmount) { + toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount + } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } @@ -2093,6 +2171,15 @@ func (o *CreateCheckoutSessionRequest) isValidChannel() bool { } return false } +func (o *CreateCheckoutSessionRequest) isValidMode() bool { + 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 { diff --git a/src/checkout/model_create_checkout_session_response.go b/src/checkout/model_create_checkout_session_response.go index 01e488960..87566c2f8 100644 --- a/src/checkout/model_create_checkout_session_response.go +++ b/src/checkout/model_create_checkout_session_response.go @@ -103,6 +103,8 @@ type CreateCheckoutSessionResponse struct { 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 **. , ' _ - ? + * /_**. ShopperStatement *string `json:"shopperStatement,omitempty"` + // Set to true to show the payment amount per installment. + ShowInstallmentAmount *bool `json:"showInstallmentAmount,omitempty"` // The shopper's social security number. SocialSecurityNumber *string `json:"socialSecurityNumber,omitempty"` // Boolean value indicating whether the card payment method should be split into separate debit and credit options. @@ -1679,6 +1681,38 @@ func (o *CreateCheckoutSessionResponse) SetShopperStatement(v string) { o.ShopperStatement = &v } +// GetShowInstallmentAmount returns the ShowInstallmentAmount field value if set, zero value otherwise. +func (o *CreateCheckoutSessionResponse) GetShowInstallmentAmount() bool { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + var ret bool + return ret + } + return *o.ShowInstallmentAmount +} + +// GetShowInstallmentAmountOk returns a tuple with the ShowInstallmentAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCheckoutSessionResponse) GetShowInstallmentAmountOk() (*bool, bool) { + if o == nil || common.IsNil(o.ShowInstallmentAmount) { + return nil, false + } + return o.ShowInstallmentAmount, true +} + +// HasShowInstallmentAmount returns a boolean if a field has been set. +func (o *CreateCheckoutSessionResponse) HasShowInstallmentAmount() bool { + if o != nil && !common.IsNil(o.ShowInstallmentAmount) { + return true + } + + return false +} + +// SetShowInstallmentAmount gets a reference to the given bool and assigns it to the ShowInstallmentAmount field. +func (o *CreateCheckoutSessionResponse) SetShowInstallmentAmount(v bool) { + o.ShowInstallmentAmount = &v +} + // GetSocialSecurityNumber returns the SocialSecurityNumber field value if set, zero value otherwise. func (o *CreateCheckoutSessionResponse) GetSocialSecurityNumber() string { if o == nil || common.IsNil(o.SocialSecurityNumber) { @@ -2115,6 +2149,9 @@ func (o CreateCheckoutSessionResponse) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ShopperStatement) { toSerialize["shopperStatement"] = o.ShopperStatement } + if !common.IsNil(o.ShowInstallmentAmount) { + toSerialize["showInstallmentAmount"] = o.ShowInstallmentAmount + } if !common.IsNil(o.SocialSecurityNumber) { toSerialize["socialSecurityNumber"] = o.SocialSecurityNumber } diff --git a/src/checkout/model_donation_payment_request.go b/src/checkout/model_donation_payment_request.go index d6e27b80c..524528f50 100644 --- a/src/checkout/model_donation_payment_request.go +++ b/src/checkout/model_donation_payment_request.go @@ -141,8 +141,8 @@ type DonationPaymentRequest 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"` - ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,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 ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -2405,9 +2405,9 @@ func (o *DonationPaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { +func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestFields { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData2 + var ret ThreeDS2RequestFields return ret } return *o.ThreeDS2RequestData @@ -2415,7 +2415,7 @@ func (o *DonationPaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { // GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { +func (o *DonationPaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestFields, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2431,8 +2431,8 @@ func (o *DonationPaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. -func (o *DonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestFields and assigns it to the ThreeDS2RequestData field. +func (o *DonationPaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestFields) { o.ThreeDS2RequestData = &v } diff --git a/src/checkout/model_payment_amount_update_request.go b/src/checkout/model_payment_amount_update_request.go index 2061b4d11..620310600 100644 --- a/src/checkout/model_payment_amount_update_request.go +++ b/src/checkout/model_payment_amount_update_request.go @@ -19,7 +19,8 @@ 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"` // 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. @@ -75,6 +76,38 @@ func (o *PaymentAmountUpdateRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentAmountUpdateRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentAmountUpdateRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentAmountUpdateRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentAmountUpdateRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetIndustryUsage returns the IndustryUsage field value if set, zero value otherwise. func (o *PaymentAmountUpdateRequest) GetIndustryUsage() string { if o == nil || common.IsNil(o.IndustryUsage) { @@ -238,6 +271,9 @@ func (o PaymentAmountUpdateRequest) MarshalJSON() ([]byte, error) { func (o PaymentAmountUpdateRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.IndustryUsage) { toSerialize["industryUsage"] = o.IndustryUsage } diff --git a/src/checkout/model_payment_cancel_request.go b/src/checkout/model_payment_cancel_request.go index e466d50f3..42aa856c7 100644 --- a/src/checkout/model_payment_cancel_request.go +++ b/src/checkout/model_payment_cancel_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &PaymentCancelRequest{} // PaymentCancelRequest struct for PaymentCancelRequest type PaymentCancelRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // Your reference for the cancel request. Maximum length: 80 characters. @@ -43,6 +44,38 @@ func NewPaymentCancelRequestWithDefaults() *PaymentCancelRequest { return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentCancelRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCancelRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentCancelRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentCancelRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *PaymentCancelRequest) GetMerchantAccount() string { if o == nil { @@ -109,6 +142,9 @@ func (o PaymentCancelRequest) MarshalJSON() ([]byte, error) { func (o PaymentCancelRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference diff --git a/src/checkout/model_payment_capture_request.go b/src/checkout/model_payment_capture_request.go index 80f2de18f..0b1be6715 100644 --- a/src/checkout/model_payment_capture_request.go +++ b/src/checkout/model_payment_capture_request.go @@ -19,7 +19,8 @@ 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. @@ -76,6 +77,38 @@ func (o *PaymentCaptureRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentCaptureRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCaptureRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentCaptureRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentCaptureRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetLineItems returns the LineItems field value if set, zero value otherwise. func (o *PaymentCaptureRequest) GetLineItems() []LineItem { if o == nil || common.IsNil(o.LineItems) { @@ -271,6 +304,9 @@ func (o PaymentCaptureRequest) MarshalJSON() ([]byte, error) { func (o PaymentCaptureRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.LineItems) { toSerialize["lineItems"] = o.LineItems } diff --git a/src/checkout/model_payment_details.go b/src/checkout/model_payment_details.go index 428554319..1d8f0c25f 100644 --- a/src/checkout/model_payment_details.go +++ b/src/checkout/model_payment_details.go @@ -162,7 +162,7 @@ func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { } 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", "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"} + 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 diff --git a/src/checkout/model_payment_refund_request.go b/src/checkout/model_payment_refund_request.go index 630288cbb..824bf95f1 100644 --- a/src/checkout/model_payment_refund_request.go +++ b/src/checkout/model_payment_refund_request.go @@ -19,7 +19,8 @@ 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"` // The merchant account that is used to process the payment. @@ -75,6 +76,38 @@ func (o *PaymentRefundRequest) SetAmount(v Amount) { o.Amount = v } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentRefundRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRefundRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentRefundRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentRefundRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetLineItems returns the LineItems field value if set, zero value otherwise. func (o *PaymentRefundRequest) GetLineItems() []LineItem { if o == nil || common.IsNil(o.LineItems) { @@ -238,6 +271,9 @@ func (o PaymentRefundRequest) MarshalJSON() ([]byte, error) { func (o PaymentRefundRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["amount"] = o.Amount + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } if !common.IsNil(o.LineItems) { toSerialize["lineItems"] = o.LineItems } diff --git a/src/checkout/model_payment_request.go b/src/checkout/model_payment_request.go index f6157c2b0..b2d512ac2 100644 --- a/src/checkout/model_payment_request.go +++ b/src/checkout/model_payment_request.go @@ -101,7 +101,7 @@ type PaymentRequest struct { RedirectToIssuerMethod *string `json:"redirectToIssuerMethod,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 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` + // 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"` // 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 @@ -128,8 +128,8 @@ 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"` - ThreeDS2RequestData *ThreeDS2RequestData2 `json:"threeDS2RequestData,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 ThreeDSAuthenticationOnly *bool `json:"threeDSAuthenticationOnly,omitempty"` @@ -2178,9 +2178,9 @@ func (o *PaymentRequest) SetTelephoneNumber(v string) { } // GetThreeDS2RequestData returns the ThreeDS2RequestData field value if set, zero value otherwise. -func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { +func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestFields { if o == nil || common.IsNil(o.ThreeDS2RequestData) { - var ret ThreeDS2RequestData2 + var ret ThreeDS2RequestFields return ret } return *o.ThreeDS2RequestData @@ -2188,7 +2188,7 @@ func (o *PaymentRequest) GetThreeDS2RequestData() ThreeDS2RequestData2 { // GetThreeDS2RequestDataOk returns a tuple with the ThreeDS2RequestData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestData2, bool) { +func (o *PaymentRequest) GetThreeDS2RequestDataOk() (*ThreeDS2RequestFields, bool) { if o == nil || common.IsNil(o.ThreeDS2RequestData) { return nil, false } @@ -2204,8 +2204,8 @@ func (o *PaymentRequest) HasThreeDS2RequestData() bool { return false } -// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestData2 and assigns it to the ThreeDS2RequestData field. -func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestData2) { +// SetThreeDS2RequestData gets a reference to the given ThreeDS2RequestFields and assigns it to the ThreeDS2RequestData field. +func (o *PaymentRequest) SetThreeDS2RequestData(v ThreeDS2RequestFields) { o.ThreeDS2RequestData = &v } diff --git a/src/checkout/model_payment_reversal_request.go b/src/checkout/model_payment_reversal_request.go index 9ed640e54..8aed58819 100644 --- a/src/checkout/model_payment_reversal_request.go +++ b/src/checkout/model_payment_reversal_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &PaymentReversalRequest{} // PaymentReversalRequest struct for PaymentReversalRequest type PaymentReversalRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // Your reference for the reversal request. Maximum length: 80 characters. @@ -43,6 +44,38 @@ func NewPaymentReversalRequestWithDefaults() *PaymentReversalRequest { return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *PaymentReversalRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentReversalRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *PaymentReversalRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *PaymentReversalRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *PaymentReversalRequest) GetMerchantAccount() string { if o == nil { @@ -109,6 +142,9 @@ func (o PaymentReversalRequest) MarshalJSON() ([]byte, error) { func (o PaymentReversalRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount if !common.IsNil(o.Reference) { toSerialize["reference"] = o.Reference diff --git a/src/checkout/model_payment_verification_response.go b/src/checkout/model_payment_verification_response.go index 5e39e03d2..77783f435 100644 --- a/src/checkout/model_payment_verification_response.go +++ b/src/checkout/model_payment_verification_response.go @@ -32,8 +32,8 @@ 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"` - ServiceError *ServiceError2 `json:"serviceError,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` + ServiceError *ServiceErrorDetails `json:"serviceError,omitempty"` // The shopperLocale value provided in the payment request. ShopperLocale string `json:"shopperLocale"` } @@ -306,9 +306,9 @@ func (o *PaymentVerificationResponse) SetResultCode(v string) { } // GetServiceError returns the ServiceError field value if set, zero value otherwise. -func (o *PaymentVerificationResponse) GetServiceError() ServiceError2 { +func (o *PaymentVerificationResponse) GetServiceError() ServiceErrorDetails { if o == nil || common.IsNil(o.ServiceError) { - var ret ServiceError2 + var ret ServiceErrorDetails return ret } return *o.ServiceError @@ -316,7 +316,7 @@ func (o *PaymentVerificationResponse) GetServiceError() ServiceError2 { // GetServiceErrorOk returns a tuple with the ServiceError field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PaymentVerificationResponse) GetServiceErrorOk() (*ServiceError2, bool) { +func (o *PaymentVerificationResponse) GetServiceErrorOk() (*ServiceErrorDetails, bool) { if o == nil || common.IsNil(o.ServiceError) { return nil, false } @@ -332,8 +332,8 @@ func (o *PaymentVerificationResponse) HasServiceError() bool { return false } -// SetServiceError gets a reference to the given ServiceError2 and assigns it to the ServiceError field. -func (o *PaymentVerificationResponse) SetServiceError(v ServiceError2) { +// SetServiceError gets a reference to the given ServiceErrorDetails and assigns it to the ServiceError field. +func (o *PaymentVerificationResponse) SetServiceError(v ServiceErrorDetails) { o.ServiceError = &v } diff --git a/src/checkout/model_recurring.go b/src/checkout/model_recurring.go index ac3c31d9f..7a1fcfd3f 100644 --- a/src/checkout/model_recurring.go +++ b/src/checkout/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/checkout/model_service_error_details.go b/src/checkout/model_service_error_details.go new file mode 100644 index 000000000..3426ee6c7 --- /dev/null +++ b/src/checkout/model_service_error_details.go @@ -0,0 +1,232 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ServiceErrorDetails type satisfies the MappedNullable interface at compile time +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"` + PspReference *string `json:"pspReference,omitempty"` +} + +// NewServiceErrorDetails instantiates a new ServiceErrorDetails 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 NewServiceErrorDetails() *ServiceErrorDetails { + this := ServiceErrorDetails{} + return &this +} + +// NewServiceErrorDetailsWithDefaults instantiates a new ServiceErrorDetails 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 NewServiceErrorDetailsWithDefaults() *ServiceErrorDetails { + this := ServiceErrorDetails{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *ServiceErrorDetails) GetErrorCode() string { + if o == nil || common.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceErrorDetails) GetErrorCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *ServiceErrorDetails) HasErrorCode() bool { + if o != nil && !common.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *ServiceErrorDetails) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetErrorType returns the ErrorType field value if set, zero value otherwise. +func (o *ServiceErrorDetails) GetErrorType() string { + if o == nil || common.IsNil(o.ErrorType) { + var ret string + return ret + } + return *o.ErrorType +} + +// GetErrorTypeOk returns a tuple with the ErrorType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceErrorDetails) GetErrorTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorType) { + return nil, false + } + return o.ErrorType, true +} + +// HasErrorType returns a boolean if a field has been set. +func (o *ServiceErrorDetails) HasErrorType() bool { + if o != nil && !common.IsNil(o.ErrorType) { + return true + } + + return false +} + +// SetErrorType gets a reference to the given string and assigns it to the ErrorType field. +func (o *ServiceErrorDetails) SetErrorType(v string) { + o.ErrorType = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ServiceErrorDetails) 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 *ServiceErrorDetails) 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 *ServiceErrorDetails) 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 *ServiceErrorDetails) SetMessage(v string) { + o.Message = &v +} + +// GetPspReference returns the PspReference field value if set, zero value otherwise. +func (o *ServiceErrorDetails) GetPspReference() string { + if o == nil || common.IsNil(o.PspReference) { + var ret string + return ret + } + return *o.PspReference +} + +// GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceErrorDetails) GetPspReferenceOk() (*string, bool) { + if o == nil || common.IsNil(o.PspReference) { + return nil, false + } + return o.PspReference, true +} + +// HasPspReference returns a boolean if a field has been set. +func (o *ServiceErrorDetails) HasPspReference() bool { + if o != nil && !common.IsNil(o.PspReference) { + return true + } + + return false +} + +// SetPspReference gets a reference to the given string and assigns it to the PspReference field. +func (o *ServiceErrorDetails) SetPspReference(v string) { + o.PspReference = &v +} + +func (o ServiceErrorDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceErrorDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ErrorCode) { + toSerialize["errorCode"] = o.ErrorCode + } + if !common.IsNil(o.ErrorType) { + toSerialize["errorType"] = o.ErrorType + } + if !common.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !common.IsNil(o.PspReference) { + toSerialize["pspReference"] = o.PspReference + } + return toSerialize, nil +} + +type NullableServiceErrorDetails struct { + value *ServiceErrorDetails + isSet bool +} + +func (v NullableServiceErrorDetails) Get() *ServiceErrorDetails { + return v.value +} + +func (v *NullableServiceErrorDetails) Set(val *ServiceErrorDetails) { + v.value = val + v.isSet = true +} + +func (v NullableServiceErrorDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceErrorDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceErrorDetails(val *ServiceErrorDetails) *NullableServiceErrorDetails { + return &NullableServiceErrorDetails{value: val, isSet: true} +} + +func (v NullableServiceErrorDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceErrorDetails) 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 b647c0201..513463d4f 100644 --- a/src/checkout/model_split.go +++ b/src/checkout/model_split.go @@ -19,14 +19,14 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` - // A description of this split. + // 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"` + // Your description for the split item. Description *string `json:"description,omitempty"` - // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + // Your 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 sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. Reference *string `json:"reference,omitempty"` - // The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + // The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. Type string `json:"type"` } @@ -34,9 +34,8 @@ type Split struct { // 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 NewSplit(amount SplitAmount, type_ string) *Split { +func NewSplit(type_ string) *Split { this := Split{} - this.Amount = amount this.Type = type_ return &this } @@ -81,28 +80,36 @@ func (o *Split) SetAccount(v string) { o.Account = &v } -// GetAmount returns the Amount field value +// GetAmount returns the Amount field value if set, zero value otherwise. func (o *Split) GetAmount() SplitAmount { - if o == nil { + if o == nil || common.IsNil(o.Amount) { var ret SplitAmount return ret } - - return o.Amount + return *o.Amount } -// GetAmountOk returns a tuple with the Amount field value +// 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 *Split) GetAmountOk() (*SplitAmount, bool) { - if o == nil { + if o == nil || common.IsNil(o.Amount) { return nil, false } - return &o.Amount, true + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Split) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false } -// SetAmount sets field value +// SetAmount gets a reference to the given SplitAmount and assigns it to the Amount field. func (o *Split) SetAmount(v SplitAmount) { - o.Amount = v + o.Amount = &v } // GetDescription returns the Description field value if set, zero value otherwise. @@ -206,7 +213,9 @@ func (o Split) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Account) { toSerialize["account"] = o.Account } - toSerialize["amount"] = o.Amount + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } diff --git a/src/checkout/model_split_amount.go b/src/checkout/model_split_amount.go index 0a8d4f14f..d413fd197 100644 --- a/src/checkout/model_split_amount.go +++ b/src/checkout/model_split_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &SplitAmount{} // SplitAmount struct for SplitAmount type SplitAmount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. Currency *string `json:"currency,omitempty"` - // The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). Value int64 `json:"value"` } diff --git a/src/checkout/model_standalone_payment_cancel_request.go b/src/checkout/model_standalone_payment_cancel_request.go index fd7137ecc..22d47d117 100644 --- a/src/checkout/model_standalone_payment_cancel_request.go +++ b/src/checkout/model_standalone_payment_cancel_request.go @@ -19,6 +19,7 @@ var _ common.MappedNullable = &StandalonePaymentCancelRequest{} // StandalonePaymentCancelRequest struct for StandalonePaymentCancelRequest type StandalonePaymentCancelRequest struct { + ApplicationInfo *ApplicationInfo `json:"applicationInfo,omitempty"` // The merchant account that is used to process the payment. MerchantAccount string `json:"merchantAccount"` // The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. @@ -46,6 +47,38 @@ func NewStandalonePaymentCancelRequestWithDefaults() *StandalonePaymentCancelReq return &this } +// GetApplicationInfo returns the ApplicationInfo field value if set, zero value otherwise. +func (o *StandalonePaymentCancelRequest) GetApplicationInfo() ApplicationInfo { + if o == nil || common.IsNil(o.ApplicationInfo) { + var ret ApplicationInfo + return ret + } + return *o.ApplicationInfo +} + +// GetApplicationInfoOk returns a tuple with the ApplicationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StandalonePaymentCancelRequest) GetApplicationInfoOk() (*ApplicationInfo, bool) { + if o == nil || common.IsNil(o.ApplicationInfo) { + return nil, false + } + return o.ApplicationInfo, true +} + +// HasApplicationInfo returns a boolean if a field has been set. +func (o *StandalonePaymentCancelRequest) HasApplicationInfo() bool { + if o != nil && !common.IsNil(o.ApplicationInfo) { + return true + } + + return false +} + +// SetApplicationInfo gets a reference to the given ApplicationInfo and assigns it to the ApplicationInfo field. +func (o *StandalonePaymentCancelRequest) SetApplicationInfo(v ApplicationInfo) { + o.ApplicationInfo = &v +} + // GetMerchantAccount returns the MerchantAccount field value func (o *StandalonePaymentCancelRequest) GetMerchantAccount() string { if o == nil { @@ -136,6 +169,9 @@ func (o StandalonePaymentCancelRequest) MarshalJSON() ([]byte, error) { func (o StandalonePaymentCancelRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.ApplicationInfo) { + toSerialize["applicationInfo"] = o.ApplicationInfo + } toSerialize["merchantAccount"] = o.MerchantAccount toSerialize["paymentReference"] = o.PaymentReference if !common.IsNil(o.Reference) { diff --git a/src/checkout/model_three_ds2_request_fields.go b/src/checkout/model_three_ds2_request_fields.go new file mode 100644 index 000000000..f9d48fbc7 --- /dev/null +++ b/src/checkout/model_three_ds2_request_fields.go @@ -0,0 +1,1483 @@ +/* +Adyen Checkout API + +API version: 70 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package checkout + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the ThreeDS2RequestFields type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &ThreeDS2RequestFields{} + +// ThreeDS2RequestFields struct for ThreeDS2RequestFields +type ThreeDS2RequestFields struct { + AcctInfo *AcctInfo `json:"acctInfo,omitempty"` + // Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + AcctType *string `json:"acctType,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + AcquirerBIN *string `json:"acquirerBIN,omitempty"` + // Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + AcquirerMerchantID *string `json:"acquirerMerchantID,omitempty"` + // Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + AddrMatch *string `json:"addrMatch,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 + AuthenticationOnly *bool `json:"authenticationOnly,omitempty"` + // Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + // Deprecated + ChallengeIndicator *string `json:"challengeIndicator,omitempty"` + DeviceRenderOptions *DeviceRenderOptions `json:"deviceRenderOptions,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"` + // 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. + PayTokenInd *bool `json:"payTokenInd,omitempty"` + // Indicates the type of payment for which an authentication is requested (message extension) + PaymentAuthenticationUseCase *string `json:"paymentAuthenticationUseCase,omitempty"` + // Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + PurchaseInstalData *string `json:"purchaseInstalData,omitempty"` + // Date after which no further authorisations shall be performed. Format: YYYYMMDD + RecurringExpiry *string `json:"recurringExpiry,omitempty"` + // 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"` + 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"` + // The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. + SdkReferenceNumber *string `json:"sdkReferenceNumber,omitempty"` + // The `sdkTransID` value as received from the 3D Secure 2 SDK. + SdkTransID *string `json:"sdkTransID,omitempty"` + // Completion indicator for the device fingerprinting. + ThreeDSCompInd *string `json:"threeDSCompInd,omitempty"` + // Indicates the type of Authentication request. + 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"` + 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"` + // Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + TransType *string `json:"transType,omitempty"` + // Identify the type of the transaction being authenticated. + 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"` +} + +// NewThreeDS2RequestFields instantiates a new ThreeDS2RequestFields 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 NewThreeDS2RequestFields() *ThreeDS2RequestFields { + this := ThreeDS2RequestFields{} + var authenticationOnly bool = false + this.AuthenticationOnly = &authenticationOnly + var sdkMaxTimeout int32 = 60 + this.SdkMaxTimeout = &sdkMaxTimeout + return &this +} + +// NewThreeDS2RequestFieldsWithDefaults instantiates a new ThreeDS2RequestFields 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 NewThreeDS2RequestFieldsWithDefaults() *ThreeDS2RequestFields { + this := ThreeDS2RequestFields{} + var authenticationOnly bool = false + this.AuthenticationOnly = &authenticationOnly + var sdkMaxTimeout int32 = 60 + this.SdkMaxTimeout = &sdkMaxTimeout + return &this +} + +// GetAcctInfo returns the AcctInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetAcctInfo() AcctInfo { + if o == nil || common.IsNil(o.AcctInfo) { + var ret AcctInfo + return ret + } + return *o.AcctInfo +} + +// GetAcctInfoOk returns a tuple with the AcctInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetAcctInfoOk() (*AcctInfo, bool) { + if o == nil || common.IsNil(o.AcctInfo) { + return nil, false + } + return o.AcctInfo, true +} + +// HasAcctInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAcctInfo() bool { + if o != nil && !common.IsNil(o.AcctInfo) { + return true + } + + return false +} + +// SetAcctInfo gets a reference to the given AcctInfo and assigns it to the AcctInfo field. +func (o *ThreeDS2RequestFields) SetAcctInfo(v AcctInfo) { + o.AcctInfo = &v +} + +// GetAcctType returns the AcctType field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetAcctType() string { + if o == nil || common.IsNil(o.AcctType) { + var ret string + return ret + } + return *o.AcctType +} + +// GetAcctTypeOk returns a tuple with the AcctType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetAcctTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.AcctType) { + return nil, false + } + return o.AcctType, true +} + +// HasAcctType returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAcctType() bool { + if o != nil && !common.IsNil(o.AcctType) { + return true + } + + return false +} + +// SetAcctType gets a reference to the given string and assigns it to the AcctType field. +func (o *ThreeDS2RequestFields) SetAcctType(v string) { + o.AcctType = &v +} + +// GetAcquirerBIN returns the AcquirerBIN field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetAcquirerBIN() string { + if o == nil || common.IsNil(o.AcquirerBIN) { + var ret string + return ret + } + return *o.AcquirerBIN +} + +// GetAcquirerBINOk returns a tuple with the AcquirerBIN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetAcquirerBINOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerBIN) { + return nil, false + } + return o.AcquirerBIN, true +} + +// HasAcquirerBIN returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAcquirerBIN() bool { + if o != nil && !common.IsNil(o.AcquirerBIN) { + return true + } + + return false +} + +// SetAcquirerBIN gets a reference to the given string and assigns it to the AcquirerBIN field. +func (o *ThreeDS2RequestFields) SetAcquirerBIN(v string) { + o.AcquirerBIN = &v +} + +// GetAcquirerMerchantID returns the AcquirerMerchantID field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetAcquirerMerchantID() string { + if o == nil || common.IsNil(o.AcquirerMerchantID) { + var ret string + return ret + } + return *o.AcquirerMerchantID +} + +// GetAcquirerMerchantIDOk returns a tuple with the AcquirerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetAcquirerMerchantIDOk() (*string, bool) { + if o == nil || common.IsNil(o.AcquirerMerchantID) { + return nil, false + } + return o.AcquirerMerchantID, true +} + +// HasAcquirerMerchantID returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAcquirerMerchantID() bool { + if o != nil && !common.IsNil(o.AcquirerMerchantID) { + return true + } + + return false +} + +// SetAcquirerMerchantID gets a reference to the given string and assigns it to the AcquirerMerchantID field. +func (o *ThreeDS2RequestFields) SetAcquirerMerchantID(v string) { + o.AcquirerMerchantID = &v +} + +// GetAddrMatch returns the AddrMatch field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetAddrMatch() string { + if o == nil || common.IsNil(o.AddrMatch) { + var ret string + return ret + } + return *o.AddrMatch +} + +// GetAddrMatchOk returns a tuple with the AddrMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetAddrMatchOk() (*string, bool) { + if o == nil || common.IsNil(o.AddrMatch) { + return nil, false + } + return o.AddrMatch, true +} + +// HasAddrMatch returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAddrMatch() bool { + if o != nil && !common.IsNil(o.AddrMatch) { + return true + } + + return false +} + +// SetAddrMatch gets a reference to the given string and assigns it to the AddrMatch field. +func (o *ThreeDS2RequestFields) SetAddrMatch(v string) { + o.AddrMatch = &v +} + +// GetAuthenticationOnly returns the AuthenticationOnly field value if set, zero value otherwise. +// Deprecated +func (o *ThreeDS2RequestFields) GetAuthenticationOnly() bool { + if o == nil || common.IsNil(o.AuthenticationOnly) { + var ret bool + return ret + } + return *o.AuthenticationOnly +} + +// GetAuthenticationOnlyOk returns a tuple with the AuthenticationOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ThreeDS2RequestFields) GetAuthenticationOnlyOk() (*bool, bool) { + if o == nil || common.IsNil(o.AuthenticationOnly) { + return nil, false + } + return o.AuthenticationOnly, true +} + +// HasAuthenticationOnly returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasAuthenticationOnly() bool { + if o != nil && !common.IsNil(o.AuthenticationOnly) { + return true + } + + return false +} + +// SetAuthenticationOnly gets a reference to the given bool and assigns it to the AuthenticationOnly field. +// Deprecated +func (o *ThreeDS2RequestFields) SetAuthenticationOnly(v bool) { + o.AuthenticationOnly = &v +} + +// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. +// Deprecated +func (o *ThreeDS2RequestFields) GetChallengeIndicator() string { + if o == nil || common.IsNil(o.ChallengeIndicator) { + var ret string + return ret + } + return *o.ChallengeIndicator +} + +// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ThreeDS2RequestFields) GetChallengeIndicatorOk() (*string, bool) { + if o == nil || common.IsNil(o.ChallengeIndicator) { + return nil, false + } + return o.ChallengeIndicator, true +} + +// HasChallengeIndicator returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasChallengeIndicator() bool { + if o != nil && !common.IsNil(o.ChallengeIndicator) { + return true + } + + return false +} + +// SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. +// Deprecated +func (o *ThreeDS2RequestFields) SetChallengeIndicator(v string) { + o.ChallengeIndicator = &v +} + +// GetDeviceRenderOptions returns the DeviceRenderOptions field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetDeviceRenderOptions() DeviceRenderOptions { + if o == nil || common.IsNil(o.DeviceRenderOptions) { + var ret DeviceRenderOptions + return ret + } + return *o.DeviceRenderOptions +} + +// GetDeviceRenderOptionsOk returns a tuple with the DeviceRenderOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetDeviceRenderOptionsOk() (*DeviceRenderOptions, bool) { + if o == nil || common.IsNil(o.DeviceRenderOptions) { + return nil, false + } + return o.DeviceRenderOptions, true +} + +// HasDeviceRenderOptions returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasDeviceRenderOptions() bool { + if o != nil && !common.IsNil(o.DeviceRenderOptions) { + return true + } + + return false +} + +// SetDeviceRenderOptions gets a reference to the given DeviceRenderOptions and assigns it to the DeviceRenderOptions field. +func (o *ThreeDS2RequestFields) SetDeviceRenderOptions(v DeviceRenderOptions) { + o.DeviceRenderOptions = &v +} + +// GetHomePhone returns the HomePhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetHomePhone() Phone { + if o == nil || common.IsNil(o.HomePhone) { + var ret Phone + return ret + } + return *o.HomePhone +} + +// GetHomePhoneOk returns a tuple with the HomePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetHomePhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.HomePhone) { + return nil, false + } + return o.HomePhone, true +} + +// HasHomePhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasHomePhone() bool { + if o != nil && !common.IsNil(o.HomePhone) { + return true + } + + return false +} + +// SetHomePhone gets a reference to the given Phone and assigns it to the HomePhone field. +func (o *ThreeDS2RequestFields) SetHomePhone(v Phone) { + o.HomePhone = &v +} + +// GetMcc returns the Mcc field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) 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 *ThreeDS2RequestFields) 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 *ThreeDS2RequestFields) 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 *ThreeDS2RequestFields) SetMcc(v string) { + o.Mcc = &v +} + +// GetMerchantName returns the MerchantName field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetMerchantName() string { + if o == nil || common.IsNil(o.MerchantName) { + var ret string + return ret + } + return *o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetMerchantNameOk() (*string, bool) { + if o == nil || common.IsNil(o.MerchantName) { + return nil, false + } + return o.MerchantName, true +} + +// HasMerchantName returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasMerchantName() bool { + if o != nil && !common.IsNil(o.MerchantName) { + return true + } + + return false +} + +// SetMerchantName gets a reference to the given string and assigns it to the MerchantName field. +func (o *ThreeDS2RequestFields) SetMerchantName(v string) { + o.MerchantName = &v +} + +// GetMessageVersion returns the MessageVersion field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetMessageVersion() string { + if o == nil || common.IsNil(o.MessageVersion) { + var ret string + return ret + } + return *o.MessageVersion +} + +// GetMessageVersionOk returns a tuple with the MessageVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetMessageVersionOk() (*string, bool) { + if o == nil || common.IsNil(o.MessageVersion) { + return nil, false + } + return o.MessageVersion, true +} + +// HasMessageVersion returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasMessageVersion() bool { + if o != nil && !common.IsNil(o.MessageVersion) { + return true + } + + return false +} + +// SetMessageVersion gets a reference to the given string and assigns it to the MessageVersion field. +func (o *ThreeDS2RequestFields) SetMessageVersion(v string) { + o.MessageVersion = &v +} + +// GetMobilePhone returns the MobilePhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetMobilePhone() Phone { + if o == nil || common.IsNil(o.MobilePhone) { + var ret Phone + return ret + } + return *o.MobilePhone +} + +// GetMobilePhoneOk returns a tuple with the MobilePhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetMobilePhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.MobilePhone) { + return nil, false + } + return o.MobilePhone, true +} + +// HasMobilePhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasMobilePhone() bool { + if o != nil && !common.IsNil(o.MobilePhone) { + return true + } + + return false +} + +// SetMobilePhone gets a reference to the given Phone and assigns it to the MobilePhone field. +func (o *ThreeDS2RequestFields) SetMobilePhone(v Phone) { + o.MobilePhone = &v +} + +// GetNotificationURL returns the NotificationURL field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetNotificationURL() string { + if o == nil || common.IsNil(o.NotificationURL) { + var ret string + return ret + } + return *o.NotificationURL +} + +// GetNotificationURLOk returns a tuple with the NotificationURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetNotificationURLOk() (*string, bool) { + if o == nil || common.IsNil(o.NotificationURL) { + return nil, false + } + return o.NotificationURL, true +} + +// HasNotificationURL returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasNotificationURL() bool { + if o != nil && !common.IsNil(o.NotificationURL) { + return true + } + + return false +} + +// SetNotificationURL gets a reference to the given string and assigns it to the NotificationURL field. +func (o *ThreeDS2RequestFields) SetNotificationURL(v string) { + o.NotificationURL = &v +} + +// GetPayTokenInd returns the PayTokenInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetPayTokenInd() bool { + if o == nil || common.IsNil(o.PayTokenInd) { + var ret bool + return ret + } + return *o.PayTokenInd +} + +// GetPayTokenIndOk returns a tuple with the PayTokenInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetPayTokenIndOk() (*bool, bool) { + if o == nil || common.IsNil(o.PayTokenInd) { + return nil, false + } + return o.PayTokenInd, true +} + +// HasPayTokenInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasPayTokenInd() bool { + if o != nil && !common.IsNil(o.PayTokenInd) { + return true + } + + return false +} + +// SetPayTokenInd gets a reference to the given bool and assigns it to the PayTokenInd field. +func (o *ThreeDS2RequestFields) SetPayTokenInd(v bool) { + o.PayTokenInd = &v +} + +// GetPaymentAuthenticationUseCase returns the PaymentAuthenticationUseCase field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetPaymentAuthenticationUseCase() string { + if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { + var ret string + return ret + } + return *o.PaymentAuthenticationUseCase +} + +// GetPaymentAuthenticationUseCaseOk returns a tuple with the PaymentAuthenticationUseCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetPaymentAuthenticationUseCaseOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentAuthenticationUseCase) { + return nil, false + } + return o.PaymentAuthenticationUseCase, true +} + +// HasPaymentAuthenticationUseCase returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasPaymentAuthenticationUseCase() bool { + if o != nil && !common.IsNil(o.PaymentAuthenticationUseCase) { + return true + } + + return false +} + +// SetPaymentAuthenticationUseCase gets a reference to the given string and assigns it to the PaymentAuthenticationUseCase field. +func (o *ThreeDS2RequestFields) SetPaymentAuthenticationUseCase(v string) { + o.PaymentAuthenticationUseCase = &v +} + +// GetPurchaseInstalData returns the PurchaseInstalData field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetPurchaseInstalData() string { + if o == nil || common.IsNil(o.PurchaseInstalData) { + var ret string + return ret + } + return *o.PurchaseInstalData +} + +// GetPurchaseInstalDataOk returns a tuple with the PurchaseInstalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetPurchaseInstalDataOk() (*string, bool) { + if o == nil || common.IsNil(o.PurchaseInstalData) { + return nil, false + } + return o.PurchaseInstalData, true +} + +// HasPurchaseInstalData returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasPurchaseInstalData() bool { + if o != nil && !common.IsNil(o.PurchaseInstalData) { + return true + } + + return false +} + +// SetPurchaseInstalData gets a reference to the given string and assigns it to the PurchaseInstalData field. +func (o *ThreeDS2RequestFields) SetPurchaseInstalData(v string) { + o.PurchaseInstalData = &v +} + +// GetRecurringExpiry returns the RecurringExpiry field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetRecurringExpiry() string { + if o == nil || common.IsNil(o.RecurringExpiry) { + var ret string + return ret + } + return *o.RecurringExpiry +} + +// GetRecurringExpiryOk returns a tuple with the RecurringExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetRecurringExpiryOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringExpiry) { + return nil, false + } + return o.RecurringExpiry, true +} + +// HasRecurringExpiry returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasRecurringExpiry() bool { + if o != nil && !common.IsNil(o.RecurringExpiry) { + return true + } + + return false +} + +// SetRecurringExpiry gets a reference to the given string and assigns it to the RecurringExpiry field. +func (o *ThreeDS2RequestFields) SetRecurringExpiry(v string) { + o.RecurringExpiry = &v +} + +// GetRecurringFrequency returns the RecurringFrequency field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetRecurringFrequency() string { + if o == nil || common.IsNil(o.RecurringFrequency) { + var ret string + return ret + } + return *o.RecurringFrequency +} + +// GetRecurringFrequencyOk returns a tuple with the RecurringFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetRecurringFrequencyOk() (*string, bool) { + if o == nil || common.IsNil(o.RecurringFrequency) { + return nil, false + } + return o.RecurringFrequency, true +} + +// HasRecurringFrequency returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasRecurringFrequency() bool { + if o != nil && !common.IsNil(o.RecurringFrequency) { + return true + } + + return false +} + +// SetRecurringFrequency gets a reference to the given string and assigns it to the RecurringFrequency field. +func (o *ThreeDS2RequestFields) SetRecurringFrequency(v string) { + o.RecurringFrequency = &v +} + +// GetSdkAppID returns the SdkAppID field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetSdkAppID() string { + if o == nil || common.IsNil(o.SdkAppID) { + var ret string + return ret + } + return *o.SdkAppID +} + +// GetSdkAppIDOk returns a tuple with the SdkAppID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetSdkAppIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkAppID) { + return nil, false + } + return o.SdkAppID, true +} + +// HasSdkAppID returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasSdkAppID() bool { + if o != nil && !common.IsNil(o.SdkAppID) { + return true + } + + return false +} + +// SetSdkAppID gets a reference to the given string and assigns it to the SdkAppID field. +func (o *ThreeDS2RequestFields) SetSdkAppID(v string) { + o.SdkAppID = &v +} + +// GetSdkEphemPubKey returns the SdkEphemPubKey field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetSdkEphemPubKey() SDKEphemPubKey { + if o == nil || common.IsNil(o.SdkEphemPubKey) { + var ret SDKEphemPubKey + return ret + } + return *o.SdkEphemPubKey +} + +// GetSdkEphemPubKeyOk returns a tuple with the SdkEphemPubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetSdkEphemPubKeyOk() (*SDKEphemPubKey, bool) { + if o == nil || common.IsNil(o.SdkEphemPubKey) { + return nil, false + } + return o.SdkEphemPubKey, true +} + +// HasSdkEphemPubKey returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasSdkEphemPubKey() bool { + if o != nil && !common.IsNil(o.SdkEphemPubKey) { + return true + } + + return false +} + +// SetSdkEphemPubKey gets a reference to the given SDKEphemPubKey and assigns it to the SdkEphemPubKey field. +func (o *ThreeDS2RequestFields) SetSdkEphemPubKey(v SDKEphemPubKey) { + o.SdkEphemPubKey = &v +} + +// GetSdkMaxTimeout returns the SdkMaxTimeout field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetSdkMaxTimeout() int32 { + if o == nil || common.IsNil(o.SdkMaxTimeout) { + var ret int32 + return ret + } + return *o.SdkMaxTimeout +} + +// GetSdkMaxTimeoutOk returns a tuple with the SdkMaxTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetSdkMaxTimeoutOk() (*int32, bool) { + if o == nil || common.IsNil(o.SdkMaxTimeout) { + return nil, false + } + return o.SdkMaxTimeout, true +} + +// HasSdkMaxTimeout returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasSdkMaxTimeout() bool { + if o != nil && !common.IsNil(o.SdkMaxTimeout) { + return true + } + + return false +} + +// SetSdkMaxTimeout gets a reference to the given int32 and assigns it to the SdkMaxTimeout field. +func (o *ThreeDS2RequestFields) SetSdkMaxTimeout(v int32) { + o.SdkMaxTimeout = &v +} + +// GetSdkReferenceNumber returns the SdkReferenceNumber field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetSdkReferenceNumber() string { + if o == nil || common.IsNil(o.SdkReferenceNumber) { + var ret string + return ret + } + return *o.SdkReferenceNumber +} + +// GetSdkReferenceNumberOk returns a tuple with the SdkReferenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetSdkReferenceNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkReferenceNumber) { + return nil, false + } + return o.SdkReferenceNumber, true +} + +// HasSdkReferenceNumber returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasSdkReferenceNumber() bool { + if o != nil && !common.IsNil(o.SdkReferenceNumber) { + return true + } + + return false +} + +// SetSdkReferenceNumber gets a reference to the given string and assigns it to the SdkReferenceNumber field. +func (o *ThreeDS2RequestFields) SetSdkReferenceNumber(v string) { + o.SdkReferenceNumber = &v +} + +// GetSdkTransID returns the SdkTransID field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetSdkTransID() string { + if o == nil || common.IsNil(o.SdkTransID) { + var ret string + return ret + } + return *o.SdkTransID +} + +// GetSdkTransIDOk returns a tuple with the SdkTransID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetSdkTransIDOk() (*string, bool) { + if o == nil || common.IsNil(o.SdkTransID) { + return nil, false + } + return o.SdkTransID, true +} + +// HasSdkTransID returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasSdkTransID() bool { + if o != nil && !common.IsNil(o.SdkTransID) { + return true + } + + return false +} + +// SetSdkTransID gets a reference to the given string and assigns it to the SdkTransID field. +func (o *ThreeDS2RequestFields) SetSdkTransID(v string) { + o.SdkTransID = &v +} + +// GetThreeDSCompInd returns the ThreeDSCompInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSCompInd() string { + if o == nil || common.IsNil(o.ThreeDSCompInd) { + var ret string + return ret + } + return *o.ThreeDSCompInd +} + +// GetThreeDSCompIndOk returns a tuple with the ThreeDSCompInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSCompIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSCompInd) { + return nil, false + } + return o.ThreeDSCompInd, true +} + +// HasThreeDSCompInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSCompInd() bool { + if o != nil && !common.IsNil(o.ThreeDSCompInd) { + return true + } + + return false +} + +// SetThreeDSCompInd gets a reference to the given string and assigns it to the ThreeDSCompInd field. +func (o *ThreeDS2RequestFields) SetThreeDSCompInd(v string) { + o.ThreeDSCompInd = &v +} + +// GetThreeDSRequestorAuthenticationInd returns the ThreeDSRequestorAuthenticationInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorAuthenticationInd +} + +// GetThreeDSRequestorAuthenticationIndOk returns a tuple with the ThreeDSRequestorAuthenticationInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + return nil, false + } + return o.ThreeDSRequestorAuthenticationInd, true +} + +// HasThreeDSRequestorAuthenticationInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorAuthenticationInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + return true + } + + return false +} + +// SetThreeDSRequestorAuthenticationInd gets a reference to the given string and assigns it to the ThreeDSRequestorAuthenticationInd field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorAuthenticationInd(v string) { + o.ThreeDSRequestorAuthenticationInd = &v +} + +// GetThreeDSRequestorAuthenticationInfo returns the ThreeDSRequestorAuthenticationInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInfo() ThreeDSRequestorAuthenticationInfo { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + var ret ThreeDSRequestorAuthenticationInfo + return ret + } + return *o.ThreeDSRequestorAuthenticationInfo +} + +// GetThreeDSRequestorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorAuthenticationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorAuthenticationInfoOk() (*ThreeDSRequestorAuthenticationInfo, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + return nil, false + } + return o.ThreeDSRequestorAuthenticationInfo, true +} + +// HasThreeDSRequestorAuthenticationInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorAuthenticationInfo() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + return true + } + + return false +} + +// SetThreeDSRequestorAuthenticationInfo gets a reference to the given ThreeDSRequestorAuthenticationInfo and assigns it to the ThreeDSRequestorAuthenticationInfo field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorAuthenticationInfo(v ThreeDSRequestorAuthenticationInfo) { + o.ThreeDSRequestorAuthenticationInfo = &v +} + +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorChallengeInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorChallengeInd +} + +// GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorChallengeIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + return nil, false + } + return o.ThreeDSRequestorChallengeInd, true +} + +// HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorChallengeInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { + return true + } + + return false +} + +// SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + +// GetThreeDSRequestorID returns the ThreeDSRequestorID field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorID() string { + if o == nil || common.IsNil(o.ThreeDSRequestorID) { + var ret string + return ret + } + return *o.ThreeDSRequestorID +} + +// GetThreeDSRequestorIDOk returns a tuple with the ThreeDSRequestorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorIDOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorID) { + return nil, false + } + return o.ThreeDSRequestorID, true +} + +// HasThreeDSRequestorID returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorID() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorID) { + return true + } + + return false +} + +// SetThreeDSRequestorID gets a reference to the given string and assigns it to the ThreeDSRequestorID field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorID(v string) { + o.ThreeDSRequestorID = &v +} + +// GetThreeDSRequestorName returns the ThreeDSRequestorName field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorName() string { + if o == nil || common.IsNil(o.ThreeDSRequestorName) { + var ret string + return ret + } + return *o.ThreeDSRequestorName +} + +// GetThreeDSRequestorNameOk returns a tuple with the ThreeDSRequestorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorNameOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorName) { + return nil, false + } + return o.ThreeDSRequestorName, true +} + +// HasThreeDSRequestorName returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorName() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorName) { + return true + } + + return false +} + +// SetThreeDSRequestorName gets a reference to the given string and assigns it to the ThreeDSRequestorName field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorName(v string) { + o.ThreeDSRequestorName = &v +} + +// GetThreeDSRequestorPriorAuthenticationInfo returns the ThreeDSRequestorPriorAuthenticationInfo field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorPriorAuthenticationInfo() ThreeDSRequestorPriorAuthenticationInfo { + if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + var ret ThreeDSRequestorPriorAuthenticationInfo + return ret + } + return *o.ThreeDSRequestorPriorAuthenticationInfo +} + +// GetThreeDSRequestorPriorAuthenticationInfoOk returns a tuple with the ThreeDSRequestorPriorAuthenticationInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorPriorAuthenticationInfoOk() (*ThreeDSRequestorPriorAuthenticationInfo, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + return nil, false + } + return o.ThreeDSRequestorPriorAuthenticationInfo, true +} + +// HasThreeDSRequestorPriorAuthenticationInfo returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorPriorAuthenticationInfo() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + return true + } + + return false +} + +// SetThreeDSRequestorPriorAuthenticationInfo gets a reference to the given ThreeDSRequestorPriorAuthenticationInfo and assigns it to the ThreeDSRequestorPriorAuthenticationInfo field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorPriorAuthenticationInfo(v ThreeDSRequestorPriorAuthenticationInfo) { + o.ThreeDSRequestorPriorAuthenticationInfo = &v +} + +// GetThreeDSRequestorURL returns the ThreeDSRequestorURL field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorURL() string { + if o == nil || common.IsNil(o.ThreeDSRequestorURL) { + var ret string + return ret + } + return *o.ThreeDSRequestorURL +} + +// GetThreeDSRequestorURLOk returns a tuple with the ThreeDSRequestorURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetThreeDSRequestorURLOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorURL) { + return nil, false + } + return o.ThreeDSRequestorURL, true +} + +// HasThreeDSRequestorURL returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasThreeDSRequestorURL() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorURL) { + return true + } + + return false +} + +// SetThreeDSRequestorURL gets a reference to the given string and assigns it to the ThreeDSRequestorURL field. +func (o *ThreeDS2RequestFields) SetThreeDSRequestorURL(v string) { + o.ThreeDSRequestorURL = &v +} + +// GetTransType returns the TransType field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetTransType() string { + if o == nil || common.IsNil(o.TransType) { + var ret string + return ret + } + return *o.TransType +} + +// GetTransTypeOk returns a tuple with the TransType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetTransTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.TransType) { + return nil, false + } + return o.TransType, true +} + +// HasTransType returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasTransType() bool { + if o != nil && !common.IsNil(o.TransType) { + return true + } + + return false +} + +// SetTransType gets a reference to the given string and assigns it to the TransType field. +func (o *ThreeDS2RequestFields) SetTransType(v string) { + o.TransType = &v +} + +// GetTransactionType returns the TransactionType field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetTransactionType() string { + if o == nil || common.IsNil(o.TransactionType) { + var ret string + return ret + } + return *o.TransactionType +} + +// GetTransactionTypeOk returns a tuple with the TransactionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetTransactionTypeOk() (*string, bool) { + if o == nil || common.IsNil(o.TransactionType) { + return nil, false + } + return o.TransactionType, true +} + +// HasTransactionType returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasTransactionType() bool { + if o != nil && !common.IsNil(o.TransactionType) { + return true + } + + return false +} + +// SetTransactionType gets a reference to the given string and assigns it to the TransactionType field. +func (o *ThreeDS2RequestFields) SetTransactionType(v string) { + o.TransactionType = &v +} + +// GetWhiteListStatus returns the WhiteListStatus field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetWhiteListStatus() string { + if o == nil || common.IsNil(o.WhiteListStatus) { + var ret string + return ret + } + return *o.WhiteListStatus +} + +// GetWhiteListStatusOk returns a tuple with the WhiteListStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetWhiteListStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.WhiteListStatus) { + return nil, false + } + return o.WhiteListStatus, true +} + +// HasWhiteListStatus returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasWhiteListStatus() bool { + if o != nil && !common.IsNil(o.WhiteListStatus) { + return true + } + + return false +} + +// SetWhiteListStatus gets a reference to the given string and assigns it to the WhiteListStatus field. +func (o *ThreeDS2RequestFields) SetWhiteListStatus(v string) { + o.WhiteListStatus = &v +} + +// GetWorkPhone returns the WorkPhone field value if set, zero value otherwise. +func (o *ThreeDS2RequestFields) GetWorkPhone() Phone { + if o == nil || common.IsNil(o.WorkPhone) { + var ret Phone + return ret + } + return *o.WorkPhone +} + +// GetWorkPhoneOk returns a tuple with the WorkPhone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2RequestFields) GetWorkPhoneOk() (*Phone, bool) { + if o == nil || common.IsNil(o.WorkPhone) { + return nil, false + } + return o.WorkPhone, true +} + +// HasWorkPhone returns a boolean if a field has been set. +func (o *ThreeDS2RequestFields) HasWorkPhone() bool { + if o != nil && !common.IsNil(o.WorkPhone) { + return true + } + + return false +} + +// SetWorkPhone gets a reference to the given Phone and assigns it to the WorkPhone field. +func (o *ThreeDS2RequestFields) SetWorkPhone(v Phone) { + o.WorkPhone = &v +} + +func (o ThreeDS2RequestFields) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ThreeDS2RequestFields) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.AcctInfo) { + toSerialize["acctInfo"] = o.AcctInfo + } + if !common.IsNil(o.AcctType) { + toSerialize["acctType"] = o.AcctType + } + if !common.IsNil(o.AcquirerBIN) { + toSerialize["acquirerBIN"] = o.AcquirerBIN + } + if !common.IsNil(o.AcquirerMerchantID) { + toSerialize["acquirerMerchantID"] = o.AcquirerMerchantID + } + if !common.IsNil(o.AddrMatch) { + toSerialize["addrMatch"] = o.AddrMatch + } + if !common.IsNil(o.AuthenticationOnly) { + toSerialize["authenticationOnly"] = o.AuthenticationOnly + } + if !common.IsNil(o.ChallengeIndicator) { + toSerialize["challengeIndicator"] = o.ChallengeIndicator + } + if !common.IsNil(o.DeviceRenderOptions) { + toSerialize["deviceRenderOptions"] = o.DeviceRenderOptions + } + if !common.IsNil(o.HomePhone) { + toSerialize["homePhone"] = o.HomePhone + } + if !common.IsNil(o.Mcc) { + toSerialize["mcc"] = o.Mcc + } + if !common.IsNil(o.MerchantName) { + toSerialize["merchantName"] = o.MerchantName + } + if !common.IsNil(o.MessageVersion) { + toSerialize["messageVersion"] = o.MessageVersion + } + if !common.IsNil(o.MobilePhone) { + toSerialize["mobilePhone"] = o.MobilePhone + } + if !common.IsNil(o.NotificationURL) { + toSerialize["notificationURL"] = o.NotificationURL + } + if !common.IsNil(o.PayTokenInd) { + toSerialize["payTokenInd"] = o.PayTokenInd + } + if !common.IsNil(o.PaymentAuthenticationUseCase) { + toSerialize["paymentAuthenticationUseCase"] = o.PaymentAuthenticationUseCase + } + if !common.IsNil(o.PurchaseInstalData) { + toSerialize["purchaseInstalData"] = o.PurchaseInstalData + } + if !common.IsNil(o.RecurringExpiry) { + toSerialize["recurringExpiry"] = o.RecurringExpiry + } + if !common.IsNil(o.RecurringFrequency) { + toSerialize["recurringFrequency"] = o.RecurringFrequency + } + if !common.IsNil(o.SdkAppID) { + toSerialize["sdkAppID"] = o.SdkAppID + } + if !common.IsNil(o.SdkEphemPubKey) { + toSerialize["sdkEphemPubKey"] = o.SdkEphemPubKey + } + if !common.IsNil(o.SdkMaxTimeout) { + toSerialize["sdkMaxTimeout"] = o.SdkMaxTimeout + } + if !common.IsNil(o.SdkReferenceNumber) { + toSerialize["sdkReferenceNumber"] = o.SdkReferenceNumber + } + if !common.IsNil(o.SdkTransID) { + toSerialize["sdkTransID"] = o.SdkTransID + } + if !common.IsNil(o.ThreeDSCompInd) { + toSerialize["threeDSCompInd"] = o.ThreeDSCompInd + } + if !common.IsNil(o.ThreeDSRequestorAuthenticationInd) { + toSerialize["threeDSRequestorAuthenticationInd"] = o.ThreeDSRequestorAuthenticationInd + } + if !common.IsNil(o.ThreeDSRequestorAuthenticationInfo) { + toSerialize["threeDSRequestorAuthenticationInfo"] = o.ThreeDSRequestorAuthenticationInfo + } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } + if !common.IsNil(o.ThreeDSRequestorID) { + toSerialize["threeDSRequestorID"] = o.ThreeDSRequestorID + } + if !common.IsNil(o.ThreeDSRequestorName) { + toSerialize["threeDSRequestorName"] = o.ThreeDSRequestorName + } + if !common.IsNil(o.ThreeDSRequestorPriorAuthenticationInfo) { + toSerialize["threeDSRequestorPriorAuthenticationInfo"] = o.ThreeDSRequestorPriorAuthenticationInfo + } + if !common.IsNil(o.ThreeDSRequestorURL) { + toSerialize["threeDSRequestorURL"] = o.ThreeDSRequestorURL + } + if !common.IsNil(o.TransType) { + toSerialize["transType"] = o.TransType + } + if !common.IsNil(o.TransactionType) { + toSerialize["transactionType"] = o.TransactionType + } + if !common.IsNil(o.WhiteListStatus) { + toSerialize["whiteListStatus"] = o.WhiteListStatus + } + if !common.IsNil(o.WorkPhone) { + toSerialize["workPhone"] = o.WorkPhone + } + return toSerialize, nil +} + +type NullableThreeDS2RequestFields struct { + value *ThreeDS2RequestFields + isSet bool +} + +func (v NullableThreeDS2RequestFields) Get() *ThreeDS2RequestFields { + return v.value +} + +func (v *NullableThreeDS2RequestFields) Set(val *ThreeDS2RequestFields) { + v.value = val + v.isSet = true +} + +func (v NullableThreeDS2RequestFields) IsSet() bool { + return v.isSet +} + +func (v *NullableThreeDS2RequestFields) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableThreeDS2RequestFields(val *ThreeDS2RequestFields) *NullableThreeDS2RequestFields { + return &NullableThreeDS2RequestFields{value: val, isSet: true} +} + +func (v NullableThreeDS2RequestFields) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableThreeDS2RequestFields) UnmarshalJSON(src []byte) error { + v.isSet = true + 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 +} +func (o *ThreeDS2RequestFields) isValidAddrMatch() bool { + 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 +} +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 +} +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 +} +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 +} diff --git a/src/configurationwebhook/model_account_holder_capability.go b/src/configurationwebhook/model_account_holder_capability.go index 34f36ef24..f9f3dc10c 100644 --- a/src/configurationwebhook/model_account_holder_capability.go +++ b/src/configurationwebhook/model_account_holder_capability.go @@ -33,8 +33,6 @@ type AccountHolderCapability struct { // 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"` } @@ -312,38 +310,6 @@ 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) { @@ -410,9 +376,6 @@ func (o AccountHolderCapability) ToMap() (map[string]interface{}, error) { 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 } diff --git a/src/configurationwebhook/model_balance_account.go b/src/configurationwebhook/model_balance_account.go index 1fdefcce4..fb22f8fed 100644 --- a/src/configurationwebhook/model_balance_account.go +++ b/src/configurationwebhook/model_balance_account.go @@ -23,7 +23,7 @@ type BalanceAccount struct { 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**. + // 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"` diff --git a/src/configurationwebhook/model_platform_payment_configuration.go b/src/configurationwebhook/model_platform_payment_configuration.go index 9e96c6dcc..7385015f4 100644 --- a/src/configurationwebhook/model_platform_payment_configuration.go +++ b/src/configurationwebhook/model_platform_payment_configuration.go @@ -19,9 +19,9 @@ 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/receive-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\"**. + // 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/receive-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/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + // 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"` } diff --git a/src/configurationwebhook/model_sweep_configuration_v2.go b/src/configurationwebhook/model_sweep_configuration_v2.go index 18a8d0bcb..6cb37c491 100644 --- a/src/configurationwebhook/model_sweep_configuration_v2.go +++ b/src/configurationwebhook/model_sweep_configuration_v2.go @@ -458,7 +458,7 @@ func (v *NullableSweepConfigurationV2) UnmarshalJSON(src []byte) error { } func (o *SweepConfigurationV2) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + 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 diff --git a/src/configurationwebhook/model_sweep_counterparty.go b/src/configurationwebhook/model_sweep_counterparty.go index 20d3ab6fa..025d95528 100644 --- a/src/configurationwebhook/model_sweep_counterparty.go +++ b/src/configurationwebhook/model_sweep_counterparty.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &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, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + // 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/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + // 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"` } diff --git a/src/disputes/api_general.go b/src/disputes/api_general.go index b92caa90c..c687e30ff 100644 --- a/src/disputes/api_general.go +++ b/src/disputes/api_general.go @@ -160,53 +160,6 @@ func (a *GeneralApi) DeleteDisputeDefenseDocument(ctx context.Context, r General return *res, httpRes, err } -// All parameters accepted by GeneralApi.DownloadDisputeDefenseDocument -type GeneralApiDownloadDisputeDefenseDocumentInput struct { - downloadDefenseDocumentRequest *DownloadDefenseDocumentRequest -} - -func (r GeneralApiDownloadDisputeDefenseDocumentInput) DownloadDefenseDocumentRequest(downloadDefenseDocumentRequest DownloadDefenseDocumentRequest) GeneralApiDownloadDisputeDefenseDocumentInput { - r.downloadDefenseDocumentRequest = &downloadDefenseDocumentRequest - return r -} - -/* -Prepare a request for DownloadDisputeDefenseDocument - -@return GeneralApiDownloadDisputeDefenseDocumentInput -*/ -func (a *GeneralApi) DownloadDisputeDefenseDocumentInput() GeneralApiDownloadDisputeDefenseDocumentInput { - return GeneralApiDownloadDisputeDefenseDocumentInput{} -} - -/* -DownloadDisputeDefenseDocument Download a defense document - -Downloads a specific dispute defense document that was supplied earlier. - -@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r GeneralApiDownloadDisputeDefenseDocumentInput - Request parameters, see DownloadDisputeDefenseDocumentInput -@return DownloadDefenseDocumentResponse, *http.Response, error -*/ -func (a *GeneralApi) DownloadDisputeDefenseDocument(ctx context.Context, r GeneralApiDownloadDisputeDefenseDocumentInput) (DownloadDefenseDocumentResponse, *http.Response, error) { - res := &DownloadDefenseDocumentResponse{} - path := "/downloadDisputeDefenseDocument" - queryParams := url.Values{} - headerParams := make(map[string]string) - httpRes, err := common.SendAPIRequest( - ctx, - a.Client, - r.downloadDefenseDocumentRequest, - res, - http.MethodPost, - a.BasePath()+path, - queryParams, - headerParams, - ) - - return *res, httpRes, err -} - // All parameters accepted by GeneralApi.RetrieveApplicableDefenseReasons type GeneralApiRetrieveApplicableDefenseReasonsInput struct { defenseReasonsRequest *DefenseReasonsRequest diff --git a/src/legalentity/api_documents.go b/src/legalentity/api_documents.go index e040092fe..13158172f 100644 --- a/src/legalentity/api_documents.go +++ b/src/legalentity/api_documents.go @@ -112,8 +112,15 @@ func (a *DocumentsApi) GetDocument(ctx context.Context, r DocumentsApiGetDocumen // All parameters accepted by DocumentsApi.UpdateDocument type DocumentsApiUpdateDocumentInput struct { - id string - document *Document + id string + xRequestedVerificationCode *string + 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. +func (r DocumentsApiUpdateDocumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) DocumentsApiUpdateDocumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r DocumentsApiUpdateDocumentInput) Document(document Document) DocumentsApiUpdateDocumentInput { @@ -137,6 +144,8 @@ UpdateDocument Update a document Updates a document. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUpdateDocumentInput - Request parameters, see UpdateDocumentInput @return Document, *http.Response, error @@ -147,6 +156,9 @@ func (a *DocumentsApi) UpdateDocument(ctx context.Context, r DocumentsApiUpdateD 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, @@ -196,6 +208,8 @@ Uploads a document for verification checks. You should only upload documents when Adyen requests additional information for the legal entity. + >You can upload a maximum of 15 pages for photo IDs. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r DocumentsApiUploadDocumentForVerificationChecksInput - Request parameters, see UploadDocumentForVerificationChecksInput @return Document, *http.Response, error diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index 448b74e98..df48c9006 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -220,8 +220,15 @@ func (a *LegalEntitiesApi) GetLegalEntity(ctx context.Context, r LegalEntitiesAp // All parameters accepted by LegalEntitiesApi.UpdateLegalEntity type LegalEntitiesApiUpdateLegalEntityInput struct { - id string - legalEntityInfo *LegalEntityInfo + id string + xRequestedVerificationCode *string + 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. +func (r LegalEntitiesApiUpdateLegalEntityInput) XRequestedVerificationCode(xRequestedVerificationCode string) LegalEntitiesApiUpdateLegalEntityInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r LegalEntitiesApiUpdateLegalEntityInput) LegalEntityInfo(legalEntityInfo LegalEntityInfo) LegalEntitiesApiUpdateLegalEntityInput { @@ -257,6 +264,9 @@ func (a *LegalEntitiesApi) UpdateLegalEntity(ctx context.Context, r LegalEntitie 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, diff --git a/src/legalentity/api_pci_questionnaires.go b/src/legalentity/api_pci_questionnaires.go index 238ce1faa..b82fcc2d1 100644 --- a/src/legalentity/api_pci_questionnaires.go +++ b/src/legalentity/api_pci_questionnaires.go @@ -33,7 +33,7 @@ func (r PCIQuestionnairesApiGeneratePciQuestionnaireInput) GeneratePciDescriptio /* Prepare a request for GeneratePciQuestionnaire -@param id The legal entity ID of the individual who will sign the PCI questionnaire. +@param id The unique identifier of the legal entity to get PCI questionnaire information. @return PCIQuestionnairesApiGeneratePciQuestionnaireInput */ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuestionnairesApiGeneratePciQuestionnaireInput { @@ -45,7 +45,7 @@ func (a *PCIQuestionnairesApi) GeneratePciQuestionnaireInput(id string) PCIQuest /* GeneratePciQuestionnaire Generate PCI questionnaire -Generates the required PCI questionnaire based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). If multiple questionnaires are required, this request creates a single consodilated document to be signed. +Generates the required PCI questionnaires based on the user's [salesChannel](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businessLines__reqParam_salesChannels). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param r PCIQuestionnairesApiGeneratePciQuestionnaireInput - Request parameters, see GeneratePciQuestionnaireInput diff --git a/src/legalentity/api_terms_of_service.go b/src/legalentity/api_terms_of_service.go index df787b600..914359de3 100644 --- a/src/legalentity/api_terms_of_service.go +++ b/src/legalentity/api_terms_of_service.go @@ -34,7 +34,7 @@ func (r TermsOfServiceApiAcceptTermsOfServiceInput) AcceptTermsOfServiceRequest( /* Prepare a request for AcceptTermsOfService -@param id The unique identifier of the legal entity.@param termsofservicedocumentid The unique identifier of the Terms of Service document. +@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. @return TermsOfServiceApiAcceptTermsOfServiceInput */ func (a *TermsOfServiceApi) AcceptTermsOfServiceInput(id string, termsofservicedocumentid string) TermsOfServiceApiAcceptTermsOfServiceInput { @@ -87,7 +87,7 @@ func (r TermsOfServiceApiGetTermsOfServiceDocumentInput) GetTermsOfServiceDocume /* Prepare a request for GetTermsOfServiceDocument -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceDocumentInput */ func (a *TermsOfServiceApi) GetTermsOfServiceDocumentInput(id string) TermsOfServiceApiGetTermsOfServiceDocumentInput { @@ -132,7 +132,7 @@ type TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput struct { /* Prepare a request for GetTermsOfServiceInformationForLegalEntity -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput */ func (a *TermsOfServiceApi) GetTermsOfServiceInformationForLegalEntityInput(id string) TermsOfServiceApiGetTermsOfServiceInformationForLegalEntityInput { @@ -177,7 +177,7 @@ type TermsOfServiceApiGetTermsOfServiceStatusInput struct { /* Prepare a request for GetTermsOfServiceStatus -@param id The unique identifier of the legal entity. +@param id The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. @return TermsOfServiceApiGetTermsOfServiceStatusInput */ func (a *TermsOfServiceApi) GetTermsOfServiceStatusInput(id string) TermsOfServiceApiGetTermsOfServiceStatusInput { diff --git a/src/legalentity/api_transfer_instruments.go b/src/legalentity/api_transfer_instruments.go index a46c35fde..81376a6ab 100644 --- a/src/legalentity/api_transfer_instruments.go +++ b/src/legalentity/api_transfer_instruments.go @@ -173,8 +173,15 @@ func (a *TransferInstrumentsApi) GetTransferInstrument(ctx context.Context, r Tr // All parameters accepted by TransferInstrumentsApi.UpdateTransferInstrument type TransferInstrumentsApiUpdateTransferInstrumentInput struct { - id string - transferInstrumentInfo *TransferInstrumentInfo + id string + xRequestedVerificationCode *string + 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. +func (r TransferInstrumentsApiUpdateTransferInstrumentInput) XRequestedVerificationCode(xRequestedVerificationCode string) TransferInstrumentsApiUpdateTransferInstrumentInput { + r.xRequestedVerificationCode = &xRequestedVerificationCode + return r } func (r TransferInstrumentsApiUpdateTransferInstrumentInput) TransferInstrumentInfo(transferInstrumentInfo TransferInstrumentInfo) TransferInstrumentsApiUpdateTransferInstrumentInput { @@ -208,6 +215,9 @@ func (a *TransferInstrumentsApi) UpdateTransferInstrument(ctx context.Context, r 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, diff --git a/src/legalentity/model_accept_terms_of_service_request.go b/src/legalentity/model_accept_terms_of_service_request.go index 88ee92570..eb7584e99 100644 --- a/src/legalentity/model_accept_terms_of_service_request.go +++ b/src/legalentity/model_accept_terms_of_service_request.go @@ -19,7 +19,7 @@ var _ common.MappedNullable = &AcceptTermsOfServiceRequest{} // AcceptTermsOfServiceRequest struct for AcceptTermsOfServiceRequest type AcceptTermsOfServiceRequest struct { - // The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. + // The legal entity ID of the user accepting the Terms of Service. For organizations, this must be the individual legal entity ID of an authorized signatory for the organization. For sole proprietorships, this must be the individual legal entity ID of the owner. AcceptedBy string `json:"acceptedBy"` // The IP address of the user accepting the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` diff --git a/src/legalentity/model_accept_terms_of_service_response.go b/src/legalentity/model_accept_terms_of_service_response.go index 5d301c62b..8f8245435 100644 --- a/src/legalentity/model_accept_terms_of_service_response.go +++ b/src/legalentity/model_accept_terms_of_service_response.go @@ -25,11 +25,11 @@ type AcceptTermsOfServiceResponse struct { Id *string `json:"id,omitempty"` // The IP address of the user that accepted the Terms of Service. IpAddress *string `json:"ipAddress,omitempty"` - // The language 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. For example, **nl** for Dutch. + // The language 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,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` - // The type of Terms of Service. + // The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** Type *string `json:"type,omitempty"` } diff --git a/src/legalentity/model_bank_account_info.go b/src/legalentity/model_bank_account_info.go index 49db7668a..923d097dd 100644 --- a/src/legalentity/model_bank_account_info.go +++ b/src/legalentity/model_bank_account_info.go @@ -23,6 +23,8 @@ type BankAccountInfo struct { // The type of bank account. // Deprecated AccountType *string `json:"accountType,omitempty"` + // The name of the banking institution where the bank account is held. + BankName *string `json:"bankName,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the bank account is registered. For example, **NL**. CountryCode *string `json:"countryCode,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). @@ -113,6 +115,38 @@ func (o *BankAccountInfo) SetAccountType(v string) { o.AccountType = &v } +// GetBankName returns the BankName field value if set, zero value otherwise. +func (o *BankAccountInfo) GetBankName() string { + if o == nil || common.IsNil(o.BankName) { + var ret string + return ret + } + return *o.BankName +} + +// GetBankNameOk returns a tuple with the BankName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountInfo) GetBankNameOk() (*string, bool) { + if o == nil || common.IsNil(o.BankName) { + return nil, false + } + return o.BankName, true +} + +// HasBankName returns a boolean if a field has been set. +func (o *BankAccountInfo) HasBankName() bool { + if o != nil && !common.IsNil(o.BankName) { + return true + } + + return false +} + +// SetBankName gets a reference to the given string and assigns it to the BankName field. +func (o *BankAccountInfo) SetBankName(v string) { + o.BankName = &v +} + // GetCountryCode returns the CountryCode field value if set, zero value otherwise. func (o *BankAccountInfo) GetCountryCode() string { if o == nil || common.IsNil(o.CountryCode) { @@ -193,6 +227,9 @@ func (o BankAccountInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.AccountType) { toSerialize["accountType"] = o.AccountType } + if !common.IsNil(o.BankName) { + toSerialize["bankName"] = o.BankName + } if !common.IsNil(o.CountryCode) { toSerialize["countryCode"] = o.CountryCode } diff --git a/src/legalentity/model_bank_account_info_account_identification.go b/src/legalentity/model_bank_account_info_account_identification.go index 207e2462b..6d0f54e95 100644 --- a/src/legalentity/model_bank_account_info_account_identification.go +++ b/src/legalentity/model_bank_account_info_account_identification.go @@ -23,6 +23,7 @@ type BankAccountInfoAccountIdentification struct { HULocalAccountIdentification *HULocalAccountIdentification IbanAccountIdentification *IbanAccountIdentification NOLocalAccountIdentification *NOLocalAccountIdentification + NZLocalAccountIdentification *NZLocalAccountIdentification NumberAndBicAccountIdentification *NumberAndBicAccountIdentification PLLocalAccountIdentification *PLLocalAccountIdentification SELocalAccountIdentification *SELocalAccountIdentification @@ -87,6 +88,13 @@ func NOLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NOLoc } } +// NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NZLocalAccountIdentification wrapped in BankAccountInfoAccountIdentification +func NZLocalAccountIdentificationAsBankAccountInfoAccountIdentification(v *NZLocalAccountIdentification) BankAccountInfoAccountIdentification { + return BankAccountInfoAccountIdentification{ + NZLocalAccountIdentification: v, + } +} + // NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification is a convenience function that returns NumberAndBicAccountIdentification wrapped in BankAccountInfoAccountIdentification func NumberAndBicAccountIdentificationAsBankAccountInfoAccountIdentification(v *NumberAndBicAccountIdentification) BankAccountInfoAccountIdentification { return BankAccountInfoAccountIdentification{ @@ -237,6 +245,19 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro 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 { @@ -325,6 +346,7 @@ func (dst *BankAccountInfoAccountIdentification) UnmarshalJSON(data []byte) erro dst.HULocalAccountIdentification = nil dst.IbanAccountIdentification = nil dst.NOLocalAccountIdentification = nil + dst.NZLocalAccountIdentification = nil dst.NumberAndBicAccountIdentification = nil dst.PLLocalAccountIdentification = nil dst.SELocalAccountIdentification = nil @@ -374,6 +396,10 @@ func (src BankAccountInfoAccountIdentification) MarshalJSON() ([]byte, error) { return json.Marshal(&src.NOLocalAccountIdentification) } + if src.NZLocalAccountIdentification != nil { + return json.Marshal(&src.NZLocalAccountIdentification) + } + if src.NumberAndBicAccountIdentification != nil { return json.Marshal(&src.NumberAndBicAccountIdentification) } @@ -438,6 +464,10 @@ func (obj *BankAccountInfoAccountIdentification) GetActualInstance() interface{} return obj.NOLocalAccountIdentification } + if obj.NZLocalAccountIdentification != nil { + return obj.NZLocalAccountIdentification + } + if obj.NumberAndBicAccountIdentification != nil { return obj.NumberAndBicAccountIdentification } diff --git a/src/legalentity/model_business_line.go b/src/legalentity/model_business_line.go index ad63814c5..4b51b4d24 100644 --- a/src/legalentity/model_business_line.go +++ b/src/legalentity/model_business_line.go @@ -28,7 +28,7 @@ type BusinessLine struct { IndustryCode string `json:"industryCode"` // Unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) that owns the business line. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this supporting entity. 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"` diff --git a/src/legalentity/model_generate_pci_description_request.go b/src/legalentity/model_generate_pci_description_request.go index 962c0c2bd..dfc6232b6 100644 --- a/src/legalentity/model_generate_pci_description_request.go +++ b/src/legalentity/model_generate_pci_description_request.go @@ -19,6 +19,8 @@ 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/) for your user. 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"` } @@ -40,6 +42,38 @@ func NewGeneratePciDescriptionRequestWithDefaults() *GeneratePciDescriptionReque return &this } +// GetAdditionalSalesChannels returns the AdditionalSalesChannels field value if set, zero value otherwise. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannels() []string { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + var ret []string + return ret + } + return o.AdditionalSalesChannels +} + +// GetAdditionalSalesChannelsOk returns a tuple with the AdditionalSalesChannels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeneratePciDescriptionRequest) GetAdditionalSalesChannelsOk() ([]string, bool) { + if o == nil || common.IsNil(o.AdditionalSalesChannels) { + return nil, false + } + return o.AdditionalSalesChannels, true +} + +// HasAdditionalSalesChannels returns a boolean if a field has been set. +func (o *GeneratePciDescriptionRequest) HasAdditionalSalesChannels() bool { + if o != nil && !common.IsNil(o.AdditionalSalesChannels) { + return true + } + + return false +} + +// SetAdditionalSalesChannels gets a reference to the given []string and assigns it to the AdditionalSalesChannels field. +func (o *GeneratePciDescriptionRequest) SetAdditionalSalesChannels(v []string) { + o.AdditionalSalesChannels = v +} + // GetLanguage returns the Language field value if set, zero value otherwise. func (o *GeneratePciDescriptionRequest) GetLanguage() string { if o == nil || common.IsNil(o.Language) { @@ -82,6 +116,9 @@ func (o GeneratePciDescriptionRequest) MarshalJSON() ([]byte, error) { func (o GeneratePciDescriptionRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !common.IsNil(o.AdditionalSalesChannels) { + toSerialize["additionalSalesChannels"] = o.AdditionalSalesChannels + } if !common.IsNil(o.Language) { toSerialize["language"] = o.Language } 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 f7dc763e8..b478465bf 100644 --- a/src/legalentity/model_get_terms_of_service_document_request.go +++ b/src/legalentity/model_get_terms_of_service_document_request.go @@ -19,18 +19,20 @@ var _ common.MappedNullable = &GetTermsOfServiceDocumentRequest{} // GetTermsOfServiceDocumentRequest struct for 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. For example, **nl** for Dutch. - Language *string `json:"language,omitempty"` + // 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. - Type *string `json:"type,omitempty"` + Type string `json:"type"` } // NewGetTermsOfServiceDocumentRequest instantiates a new GetTermsOfServiceDocumentRequest 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 NewGetTermsOfServiceDocumentRequest() *GetTermsOfServiceDocumentRequest { +func NewGetTermsOfServiceDocumentRequest(language string, type_ string) *GetTermsOfServiceDocumentRequest { this := GetTermsOfServiceDocumentRequest{} + this.Language = language + this.Type = type_ return &this } @@ -42,68 +44,52 @@ func NewGetTermsOfServiceDocumentRequestWithDefaults() *GetTermsOfServiceDocumen return &this } -// GetLanguage returns the Language field value if set, zero value otherwise. +// GetLanguage returns the Language field value func (o *GetTermsOfServiceDocumentRequest) GetLanguage() string { - if o == nil || common.IsNil(o.Language) { + if o == nil { var ret string return ret } - return *o.Language + + return o.Language } -// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise +// GetLanguageOk returns a tuple with the Language field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetLanguageOk() (*string, bool) { - if o == nil || common.IsNil(o.Language) { + if o == nil { return nil, false } - return o.Language, true + return &o.Language, true } -// HasLanguage returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) 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. +// SetLanguage sets field value func (o *GetTermsOfServiceDocumentRequest) SetLanguage(v string) { - o.Language = &v + o.Language = v } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value func (o *GetTermsOfServiceDocumentRequest) GetType() string { - if o == nil || common.IsNil(o.Type) { + if o == nil { var ret string return ret } - return *o.Type + + return o.Type } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *GetTermsOfServiceDocumentRequest) GetTypeOk() (*string, bool) { - if o == nil || common.IsNil(o.Type) { + if o == nil { return nil, false } - return o.Type, true + return &o.Type, true } -// HasType returns a boolean if a field has been set. -func (o *GetTermsOfServiceDocumentRequest) 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. +// SetType sets field value func (o *GetTermsOfServiceDocumentRequest) SetType(v string) { - o.Type = &v + o.Type = v } func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { @@ -116,12 +102,8 @@ func (o GetTermsOfServiceDocumentRequest) MarshalJSON() ([]byte, error) { func (o GetTermsOfServiceDocumentRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !common.IsNil(o.Language) { - toSerialize["language"] = o.Language - } - if !common.IsNil(o.Type) { - toSerialize["type"] = o.Type - } + toSerialize["language"] = o.Language + toSerialize["type"] = o.Type return toSerialize, nil } 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 4ef64ce62..686edf4bb 100644 --- a/src/legalentity/model_get_terms_of_service_document_response.go +++ b/src/legalentity/model_get_terms_of_service_document_response.go @@ -23,7 +23,7 @@ type GetTermsOfServiceDocumentResponse struct { Document *string `json:"document,omitempty"` // The unique identifier of the legal entity. Id *string `json:"id,omitempty"` - // The language 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. For example, **nl** for Dutch. + // The language 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,omitempty"` // The unique identifier of the Terms of Service document. TermsOfServiceDocumentId *string `json:"termsOfServiceDocumentId,omitempty"` diff --git a/src/legalentity/model_hk_local_account_identification.go b/src/legalentity/model_hk_local_account_identification.go index cc5234fe1..af026b211 100644 --- a/src/legalentity/model_hk_local_account_identification.go +++ b/src/legalentity/model_hk_local_account_identification.go @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // 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 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // 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, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/legalentity/model_identification_data.go b/src/legalentity/model_identification_data.go index 06b376179..398b2aa24 100644 --- a/src/legalentity/model_identification_data.go +++ b/src/legalentity/model_identification_data.go @@ -33,7 +33,7 @@ type IdentificationData struct { NationalIdExempt *bool `json:"nationalIdExempt,omitempty"` // The number in the document. Number *string `json:"number,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 of identity data. For **individual**, the `type` value is **nationalIdNumber**. Type string `json:"type"` } @@ -346,7 +346,7 @@ func (v *NullableIdentificationData) UnmarshalJSON(src []byte) error { } func (o *IdentificationData) isValidType() bool { - var allowedEnumValues = []string{"bankStatement", "driversLicense", "identityCard", "nationalIdNumber", "passport", "proofOfAddress", "proofOfNationalIdNumber", "proofOfResidency", "registrationDocument", "vatDocument", "proofOfOrganizationTaxInfo", "proofOfIndustry", "constitutionalDocument", "proofOfFundingOrWealthSource"} + var allowedEnumValues = []string{"nationalIdNumber"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/legalentity/model_legal_entity.go b/src/legalentity/model_legal_entity.go index 4d866cfb0..ec173b9d9 100644 --- a/src/legalentity/model_legal_entity.go +++ b/src/legalentity/model_legal_entity.go @@ -32,7 +32,7 @@ type LegalEntity struct { Id string `json:"id"` Individual *Individual `json:"individual,omitempty"` Organization *Organization `json:"organization,omitempty"` - // List of the verification errors from capabilities for the legal entity. + // 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"` diff --git a/src/legalentity/model_legal_entity_capability.go b/src/legalentity/model_legal_entity_capability.go index 2d59edb3d..92e0c15c5 100644 --- a/src/legalentity/model_legal_entity_capability.go +++ b/src/legalentity/model_legal_entity_capability.go @@ -19,17 +19,17 @@ var _ common.MappedNullable = &LegalEntityCapability{} // LegalEntityCapability struct for LegalEntityCapability type LegalEntityCapability struct { - // Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful + // 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"` AllowedSettings *CapabilitySettings `json:"allowedSettings,omitempty"` - // Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, + // 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"` RequestedSettings *CapabilitySettings `json:"requestedSettings,omitempty"` - // Capability status for transfer instruments associated with legal entity + // 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. VerificationStatus *string `json:"verificationStatus,omitempty"` diff --git a/src/legalentity/model_nz_local_account_identification.go b/src/legalentity/model_nz_local_account_identification.go new file mode 100644 index 000000000..28da05b01 --- /dev/null +++ b/src/legalentity/model_nz_local_account_identification.go @@ -0,0 +1,156 @@ +/* +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 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/legalentity/model_onboarding_link_info.go b/src/legalentity/model_onboarding_link_info.go index 604f9d9e1..e0cecf57b 100644 --- a/src/legalentity/model_onboarding_link_info.go +++ b/src/legalentity/model_onboarding_link_info.go @@ -23,7 +23,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, this value is 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. + // 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"` diff --git a/src/legalentity/model_supporting_entity_capability.go b/src/legalentity/model_supporting_entity_capability.go index 7267ffdb2..95246967a 100644 --- a/src/legalentity/model_supporting_entity_capability.go +++ b/src/legalentity/model_supporting_entity_capability.go @@ -19,13 +19,13 @@ var _ common.MappedNullable = &SupportingEntityCapability{} // SupportingEntityCapability struct for SupportingEntityCapability type SupportingEntityCapability struct { - // Indicates whether the supporting entity capability is allowed. If a supporting entity is allowed but its parent legal entity is not, it means there are other supporting entities that failed validation. **The allowed supporting entity can still be used** + // 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 Id *string `json:"id,omitempty"` // Indicates whether the supporting entity capability is requested. Requested *bool `json:"requested,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 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"` } diff --git a/src/legalentity/model_transfer_instrument.go b/src/legalentity/model_transfer_instrument.go index eea788f49..96b78cf26 100644 --- a/src/legalentity/model_transfer_instrument.go +++ b/src/legalentity/model_transfer_instrument.go @@ -20,7 +20,7 @@ var _ common.MappedNullable = &TransferInstrument{} // TransferInstrument struct for TransferInstrument type TransferInstrument struct { BankAccount BankAccountInfo `json:"bankAccount"` - // List of capabilities for this supporting entity. + // List of capabilities for this transfer instrument. Capabilities *map[string]SupportingEntityCapability `json:"capabilities,omitempty"` // List of documents uploaded for the transfer instrument. DocumentDetails []DocumentReference `json:"documentDetails,omitempty"` @@ -28,7 +28,7 @@ type TransferInstrument struct { Id string `json:"id"` // The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) that owns the transfer instrument. LegalEntityId string `json:"legalEntityId"` - // List of the verification errors from capabilities for this supporting entity. + // The verification errors related to capabilities for this transfer instrument. Problems []CapabilityProblem `json:"problems,omitempty"` // The type of transfer instrument. Possible value: **bankAccount**. Type string `json:"type"` diff --git a/src/management/api_account_company_level.go b/src/management/api_account_company_level.go index e32317765..b8daa34a4 100644 --- a/src/management/api_account_company_level.go +++ b/src/management/api_account_company_level.go @@ -72,7 +72,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -81,7 +80,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +88,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +96,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +104,6 @@ func (a *AccountCompanyLevelApi) GetCompanyAccount(ctx context.Context, r Accoun } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +183,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +191,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +199,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +207,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -224,7 +215,6 @@ func (a *AccountCompanyLevelApi) ListCompanyAccounts(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +297,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +305,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +313,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +321,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +329,6 @@ func (a *AccountCompanyLevelApi) ListMerchantAccounts(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_account_merchant_level.go b/src/management/api_account_merchant_level.go index 8027de6f8..207d9a7cf 100644 --- a/src/management/api_account_merchant_level.go +++ b/src/management/api_account_merchant_level.go @@ -76,7 +76,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -85,7 +84,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -94,7 +92,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -103,7 +100,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -112,7 +108,6 @@ func (a *AccountMerchantLevelApi) CreateMerchantAccount(ctx context.Context, r A } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -175,7 +170,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +178,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -193,7 +186,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -202,7 +194,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -211,7 +202,6 @@ func (a *AccountMerchantLevelApi) GetMerchantAccount(ctx context.Context, r Acco } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -290,7 +280,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -299,7 +288,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +296,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +304,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +312,6 @@ func (a *AccountMerchantLevelApi) ListMerchantAccounts(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AccountMerchantLevelApi) RequestToActivateMerchantAccount(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_account_store_level.go b/src/management/api_account_store_level.go index 797050a50..81b8fb769 100644 --- a/src/management/api_account_store_level.go +++ b/src/management/api_account_store_level.go @@ -74,7 +74,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *AccountStoreLevelApi) CreateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -179,7 +174,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +182,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +190,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +198,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +206,6 @@ func (a *AccountStoreLevelApi) CreateStoreByMerchantId(ctx context.Context, r Ac } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -282,7 +272,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +280,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +288,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +296,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +304,6 @@ func (a *AccountStoreLevelApi) GetStore(ctx context.Context, r AccountStoreLevel } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -382,7 +367,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -391,7 +375,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +383,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +391,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +399,6 @@ func (a *AccountStoreLevelApi) GetStoreById(ctx context.Context, r AccountStoreL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -518,7 +498,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -527,7 +506,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -536,7 +514,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -545,7 +522,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -554,7 +530,6 @@ func (a *AccountStoreLevelApi) ListStores(ctx context.Context, r AccountStoreLev } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -648,7 +623,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -657,7 +631,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -666,7 +639,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -675,7 +647,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -684,7 +655,6 @@ func (a *AccountStoreLevelApi) ListStoresByMerchantId(ctx context.Context, r Acc } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -756,7 +726,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -765,7 +734,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -774,7 +742,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -783,7 +750,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -792,7 +758,6 @@ func (a *AccountStoreLevelApi) UpdateStore(ctx context.Context, r AccountStoreLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -862,7 +827,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -871,7 +835,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -880,7 +843,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -889,7 +851,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -898,7 +859,6 @@ func (a *AccountStoreLevelApi) UpdateStoreById(ctx context.Context, r AccountSto } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_allowed_origins_company_level.go b/src/management/api_allowed_origins_company_level.go index 280f0a606..84cbd7534 100644 --- a/src/management/api_allowed_origins_company_level.go +++ b/src/management/api_allowed_origins_company_level.go @@ -81,7 +81,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *AllowedOriginsCompanyLevelApi) CreateAllowedOrigin(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *AllowedOriginsCompanyLevelApi) DeleteAllowedOrigin(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +281,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +289,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +297,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +305,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -327,7 +313,6 @@ func (a *AllowedOriginsCompanyLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AllowedOriginsCompanyLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_allowed_origins_merchant_level.go b/src/management/api_allowed_origins_merchant_level.go index 8746446a7..a0baae34b 100644 --- a/src/management/api_allowed_origins_merchant_level.go +++ b/src/management/api_allowed_origins_merchant_level.go @@ -81,7 +81,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *AllowedOriginsMerchantLevelApi) CreateAllowedOrigin(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *AllowedOriginsMerchantLevelApi) DeleteAllowedOrigin(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -291,7 +281,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -300,7 +289,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -309,7 +297,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -318,7 +305,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -327,7 +313,6 @@ func (a *AllowedOriginsMerchantLevelApi) GetAllowedOrigin(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *AllowedOriginsMerchantLevelApi) ListAllowedOrigins(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_android_files_company_level.go b/src/management/api_android_files_company_level.go index afea62701..e59f6ab47 100644 --- a/src/management/api_android_files_company_level.go +++ b/src/management/api_android_files_company_level.go @@ -77,7 +77,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *AndroidFilesCompanyLevelApi) GetAndroidApp(ctx context.Context, r Andro } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -220,7 +215,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -229,7 +223,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -238,7 +231,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -247,7 +239,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -256,7 +247,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidApps(ctx context.Context, r And } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -353,7 +343,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -362,7 +351,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -371,7 +359,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -380,7 +367,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -389,7 +375,6 @@ func (a *AndroidFilesCompanyLevelApi) ListAndroidCertificates(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -462,7 +447,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -471,7 +455,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -480,7 +463,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -489,7 +471,6 @@ func (a *AndroidFilesCompanyLevelApi) UploadAndroidApp(ctx context.Context, r An } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_credentials_company_level.go b/src/management/api_api_credentials_company_level.go index 0f08de577..9dee75642 100644 --- a/src/management/api_api_credentials_company_level.go +++ b/src/management/api_api_credentials_company_level.go @@ -87,7 +87,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +95,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +103,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +111,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -123,7 +119,6 @@ func (a *APICredentialsCompanyLevelApi) CreateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *APICredentialsCompanyLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +298,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +306,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +314,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -335,7 +322,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -344,7 +330,6 @@ func (a *APICredentialsCompanyLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +401,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +409,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -434,7 +417,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -443,7 +425,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -452,7 +433,6 @@ func (a *APICredentialsCompanyLevelApi) UpdateApiCredential(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_credentials_merchant_level.go b/src/management/api_api_credentials_merchant_level.go index 9a246084f..131a71eb5 100644 --- a/src/management/api_api_credentials_merchant_level.go +++ b/src/management/api_api_credentials_merchant_level.go @@ -87,7 +87,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +95,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +103,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +111,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -123,7 +119,6 @@ func (a *APICredentialsMerchantLevelApi) CreateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *APICredentialsMerchantLevelApi) GetApiCredential(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -308,7 +298,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -317,7 +306,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -326,7 +314,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -335,7 +322,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -344,7 +330,6 @@ func (a *APICredentialsMerchantLevelApi) ListApiCredentials(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -416,7 +401,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -425,7 +409,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -434,7 +417,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -443,7 +425,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -452,7 +433,6 @@ func (a *APICredentialsMerchantLevelApi) UpdateApiCredential(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_key_company_level.go b/src/management/api_api_key_company_level.go index 297d771f6..e179e5fc6 100644 --- a/src/management/api_api_key_company_level.go +++ b/src/management/api_api_key_company_level.go @@ -75,7 +75,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *APIKeyCompanyLevelApi) GenerateNewApiKey(ctx context.Context, r APIKeyC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_api_key_merchant_level.go b/src/management/api_api_key_merchant_level.go index 610efc8e3..5bd8ca341 100644 --- a/src/management/api_api_key_merchant_level.go +++ b/src/management/api_api_key_merchant_level.go @@ -75,7 +75,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *APIKeyMerchantLevelApi) GenerateNewApiKey(ctx context.Context, r APIKey } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_client_key_company_level.go b/src/management/api_client_key_company_level.go index de246ded7..d15e203b9 100644 --- a/src/management/api_client_key_company_level.go +++ b/src/management/api_client_key_company_level.go @@ -75,7 +75,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *ClientKeyCompanyLevelApi) GenerateNewClientKey(ctx context.Context, r C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_client_key_merchant_level.go b/src/management/api_client_key_merchant_level.go index 24171eb06..fcaf77718 100644 --- a/src/management/api_client_key_merchant_level.go +++ b/src/management/api_client_key_merchant_level.go @@ -75,7 +75,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *ClientKeyMerchantLevelApi) GenerateNewClientKey(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_my_api_credential.go b/src/management/api_my_api_credential.go index 5b58f4c9e..b746e73e6 100644 --- a/src/management/api_my_api_credential.go +++ b/src/management/api_my_api_credential.go @@ -74,7 +74,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *MyAPICredentialApi) AddAllowedOrigin(ctx context.Context, r MyAPICreden } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -167,7 +162,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -176,7 +170,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +178,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +186,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +194,6 @@ func (a *MyAPICredentialApi) GenerateNewClientKeyForSelf(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -266,7 +256,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -275,7 +264,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -284,7 +272,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -293,7 +280,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -302,7 +288,6 @@ func (a *MyAPICredentialApi) GetAllowedOriginDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -360,7 +345,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -369,7 +353,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -378,7 +361,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -387,7 +369,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -396,7 +377,6 @@ func (a *MyAPICredentialApi) GetAllowedOrigins(ctx context.Context, r MyAPICrede } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -454,7 +434,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -463,7 +442,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -472,7 +450,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -481,7 +458,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -490,7 +466,6 @@ func (a *MyAPICredentialApi) GetApiCredentialDetails(ctx context.Context, r MyAP } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -553,7 +528,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -562,7 +536,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -571,7 +544,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -580,7 +552,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -589,7 +560,6 @@ func (a *MyAPICredentialApi) RemoveAllowedOrigin(ctx context.Context, r MyAPICre } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_payment_methods_merchant_level.go b/src/management/api_payment_methods_merchant_level.go index 4efb0e502..d15383062 100644 --- a/src/management/api_payment_methods_merchant_level.go +++ b/src/management/api_payment_methods_merchant_level.go @@ -82,7 +82,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -91,7 +90,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -100,7 +98,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -109,7 +106,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -118,7 +114,6 @@ func (a *PaymentMethodsMerchantLevelApi) AddApplePayDomain(ctx context.Context, } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +217,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -231,7 +225,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -240,7 +233,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -249,7 +241,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -258,7 +249,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetAllPaymentMethods(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +315,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +323,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +331,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -352,7 +339,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -361,7 +347,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetApplePayDomains(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +413,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -437,7 +421,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -446,7 +429,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -455,7 +437,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -464,7 +445,6 @@ func (a *PaymentMethodsMerchantLevelApi) GetPaymentMethodDetails(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -534,7 +514,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -543,7 +522,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -552,7 +530,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -561,7 +538,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -570,7 +546,6 @@ func (a *PaymentMethodsMerchantLevelApi) RequestPaymentMethod(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -643,7 +618,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -652,7 +626,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -661,7 +634,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -670,7 +642,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -679,7 +650,6 @@ func (a *PaymentMethodsMerchantLevelApi) UpdatePaymentMethod(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_payout_settings_merchant_level.go b/src/management/api_payout_settings_merchant_level.go index 315d5002c..4c32aecdf 100644 --- a/src/management/api_payout_settings_merchant_level.go +++ b/src/management/api_payout_settings_merchant_level.go @@ -83,7 +83,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +91,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +99,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +107,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -119,7 +115,6 @@ func (a *PayoutSettingsMerchantLevelApi) AddPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -188,7 +183,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -197,7 +191,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -206,7 +199,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -215,7 +207,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -224,7 +215,6 @@ func (a *PayoutSettingsMerchantLevelApi) DeletePayoutSetting(ctx context.Context } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -292,7 +282,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -301,7 +290,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -310,7 +298,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -319,7 +306,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -328,7 +314,6 @@ func (a *PayoutSettingsMerchantLevelApi) GetPayoutSetting(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *PayoutSettingsMerchantLevelApi) ListPayoutSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -504,7 +484,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -513,7 +492,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -522,7 +500,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +508,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -540,7 +516,6 @@ func (a *PayoutSettingsMerchantLevelApi) UpdatePayoutSetting(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_split_configuration_merchant_level.go b/src/management/api_split_configuration_merchant_level.go index 4f0f11a09..937e4ab9a 100644 --- a/src/management/api_split_configuration_merchant_level.go +++ b/src/management/api_split_configuration_merchant_level.go @@ -81,7 +81,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -90,7 +89,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -99,7 +97,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -108,7 +105,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -117,7 +113,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateRule(ctx context.Context, r S } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +181,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +189,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +197,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +205,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -222,7 +213,6 @@ func (a *SplitConfigurationMerchantLevelApi) CreateSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -288,7 +278,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -297,7 +286,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -306,7 +294,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -315,7 +302,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -324,7 +310,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfiguration(ctx contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -393,7 +378,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -402,7 +386,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -411,7 +394,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -420,7 +402,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -429,7 +410,6 @@ func (a *SplitConfigurationMerchantLevelApi) DeleteSplitConfigurationRule(ctx co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -495,7 +475,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -504,7 +483,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -513,7 +491,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -522,7 +499,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +507,6 @@ func (a *SplitConfigurationMerchantLevelApi) GetSplitConfiguration(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -594,7 +569,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -603,7 +577,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -612,7 +585,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -621,7 +593,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -630,7 +601,6 @@ func (a *SplitConfigurationMerchantLevelApi) ListSplitConfigurations(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -705,7 +675,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -714,7 +683,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -723,7 +691,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -732,7 +699,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -741,7 +707,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConditions(ctx context.C } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -813,7 +778,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -822,7 +786,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -831,7 +794,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -840,7 +802,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -849,7 +810,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitConfigurationDescription } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -927,7 +887,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -936,7 +895,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -945,7 +903,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -954,7 +911,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -963,7 +919,6 @@ func (a *SplitConfigurationMerchantLevelApi) UpdateSplitLogic(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_actions_company_level.go b/src/management/api_terminal_actions_company_level.go index aaf3099c1..d2220527a 100644 --- a/src/management/api_terminal_actions_company_level.go +++ b/src/management/api_terminal_actions_company_level.go @@ -75,7 +75,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *TerminalActionsCompanyLevelApi) GetTerminalAction(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +209,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -223,7 +217,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -232,7 +225,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -241,7 +233,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -250,7 +241,6 @@ func (a *TerminalActionsCompanyLevelApi) ListTerminalActions(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_actions_terminal_level.go b/src/management/api_terminal_actions_terminal_level.go index de2514a95..450e61166 100644 --- a/src/management/api_terminal_actions_terminal_level.go +++ b/src/management/api_terminal_actions_terminal_level.go @@ -78,7 +78,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -87,7 +86,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -96,7 +94,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -105,7 +102,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -114,7 +110,6 @@ func (a *TerminalActionsTerminalLevelApi) CreateTerminalAction(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_orders_company_level.go b/src/management/api_terminal_orders_company_level.go index b74ccfb1b..c21e271f2 100644 --- a/src/management/api_terminal_orders_company_level.go +++ b/src/management/api_terminal_orders_company_level.go @@ -77,7 +77,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *TerminalOrdersCompanyLevelApi) CancelOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,6 @@ func (a *TerminalOrdersCompanyLevelApi) CreateShippingLocation(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -390,7 +375,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -399,7 +383,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -408,7 +391,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -417,7 +399,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -426,7 +407,6 @@ func (a *TerminalOrdersCompanyLevelApi) GetOrder(ctx context.Context, r Terminal } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -501,7 +481,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +489,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +497,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +505,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +513,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListBillingEntities(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -642,7 +617,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -651,7 +625,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -660,7 +633,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -669,7 +641,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -678,7 +649,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListOrders(ctx context.Context, r Termin } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -773,7 +743,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -782,7 +751,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -791,7 +759,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -800,7 +767,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -809,7 +775,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListShippingLocations(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -874,7 +839,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -883,7 +847,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -892,7 +855,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -901,7 +863,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -910,7 +871,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1014,7 +974,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1023,7 +982,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1032,7 +990,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1041,7 +998,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1050,7 +1006,6 @@ func (a *TerminalOrdersCompanyLevelApi) ListTerminalProducts(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1127,7 +1082,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1136,7 +1090,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1145,7 +1098,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1154,7 +1106,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1163,7 +1114,6 @@ func (a *TerminalOrdersCompanyLevelApi) UpdateOrder(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_orders_merchant_level.go b/src/management/api_terminal_orders_merchant_level.go index 77afeaf9b..c9d27f743 100644 --- a/src/management/api_terminal_orders_merchant_level.go +++ b/src/management/api_terminal_orders_merchant_level.go @@ -77,7 +77,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -86,7 +85,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +93,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +101,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +109,6 @@ func (a *TerminalOrdersMerchantLevelApi) CancelOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +277,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +285,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +293,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +301,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +309,6 @@ func (a *TerminalOrdersMerchantLevelApi) CreateShippingLocation(ctx context.Cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -390,7 +375,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -399,7 +383,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -408,7 +391,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -417,7 +399,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -426,7 +407,6 @@ func (a *TerminalOrdersMerchantLevelApi) GetOrder(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -501,7 +481,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -510,7 +489,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -519,7 +497,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -528,7 +505,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -537,7 +513,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListBillingEntities(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -641,7 +616,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -650,7 +624,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -659,7 +632,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -668,7 +640,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -677,7 +648,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListOrders(ctx context.Context, r Termi } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -772,7 +742,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -781,7 +750,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -790,7 +758,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -799,7 +766,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -808,7 +774,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListShippingLocations(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -872,7 +837,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -881,7 +845,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -890,7 +853,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -899,7 +861,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -908,7 +869,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalModels(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1012,7 +972,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1021,7 +980,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1030,7 +988,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1039,7 +996,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1048,7 +1004,6 @@ func (a *TerminalOrdersMerchantLevelApi) ListTerminalProducts(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1125,7 +1080,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1134,7 +1088,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1143,7 +1096,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1152,7 +1104,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -1161,7 +1112,6 @@ func (a *TerminalOrdersMerchantLevelApi) UpdateOrder(ctx context.Context, r Term } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_company_level.go b/src/management/api_terminal_settings_company_level.go index 13e09bbba..69e06047e 100644 --- a/src/management/api_terminal_settings_company_level.go +++ b/src/management/api_terminal_settings_company_level.go @@ -86,7 +86,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -95,7 +94,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -104,7 +102,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -113,7 +110,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -122,7 +118,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalLogo(ctx context.Context, r } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +184,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +192,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +200,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +208,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +216,6 @@ func (a *TerminalSettingsCompanyLevelApi) GetTerminalSettings(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +297,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +305,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +313,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +321,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -343,7 +329,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalLogo(ctx context.Context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -419,7 +404,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -428,7 +412,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -437,7 +420,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -446,7 +428,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -455,7 +436,6 @@ func (a *TerminalSettingsCompanyLevelApi) UpdateTerminalSettings(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_merchant_level.go b/src/management/api_terminal_settings_merchant_level.go index 25ad83133..dfc194651 100644 --- a/src/management/api_terminal_settings_merchant_level.go +++ b/src/management/api_terminal_settings_merchant_level.go @@ -85,7 +85,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -94,7 +93,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -103,7 +101,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -112,7 +109,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -121,7 +117,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -185,7 +180,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -194,7 +188,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -203,7 +196,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -212,7 +204,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -221,7 +212,6 @@ func (a *TerminalSettingsMerchantLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -304,7 +294,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -313,7 +302,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -322,7 +310,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -331,7 +318,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -340,7 +326,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalLogo(ctx context.Contex } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -414,7 +399,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -423,7 +407,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -432,7 +415,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -441,7 +423,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -450,7 +431,6 @@ func (a *TerminalSettingsMerchantLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_store_level.go b/src/management/api_terminal_settings_store_level.go index 364af1d9e..146aed423 100644 --- a/src/management/api_terminal_settings_store_level.go +++ b/src/management/api_terminal_settings_store_level.go @@ -88,7 +88,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +96,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +104,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +112,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -124,7 +120,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogo(ctx context.Context, r T } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +195,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +203,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +211,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -227,7 +219,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -236,7 +227,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalLogoByStoreId(ctx context.Con } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -306,7 +296,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -315,7 +304,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -324,7 +312,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -333,7 +320,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -342,7 +328,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettings(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +394,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +402,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +410,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +418,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -445,7 +426,6 @@ func (a *TerminalSettingsStoreLevelApi) GetTerminalSettingsByStoreId(ctx context } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -531,7 +511,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -540,7 +519,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -549,7 +527,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -558,7 +535,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -567,7 +543,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -650,7 +625,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -659,7 +633,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -668,7 +641,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -677,7 +649,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -686,7 +657,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalLogoByStoreId(ctx context. } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -765,7 +735,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -774,7 +743,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -783,7 +751,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -792,7 +759,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -801,7 +767,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -877,7 +842,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -886,7 +850,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -895,7 +858,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -904,7 +866,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -913,7 +874,6 @@ func (a *TerminalSettingsStoreLevelApi) UpdateTerminalSettingsByStoreId(ctx cont } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminal_settings_terminal_level.go b/src/management/api_terminal_settings_terminal_level.go index d8f476422..c0e8b2506 100644 --- a/src/management/api_terminal_settings_terminal_level.go +++ b/src/management/api_terminal_settings_terminal_level.go @@ -74,7 +74,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -83,7 +82,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -92,7 +90,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -101,7 +98,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -110,7 +106,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalLogo(ctx context.Context, } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -177,7 +172,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -186,7 +180,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -195,7 +188,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -204,7 +196,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -213,7 +204,6 @@ func (a *TerminalSettingsTerminalLevelApi) GetTerminalSettings(ctx context.Conte } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -285,7 +275,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -294,7 +283,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -303,7 +291,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +299,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +307,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateLogo(ctx context.Context, r Ter } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -397,7 +382,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -406,7 +390,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -415,7 +398,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -424,7 +406,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -433,7 +414,6 @@ func (a *TerminalSettingsTerminalLevelApi) UpdateTerminalSettings(ctx context.Co } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_terminals_terminal_level.go b/src/management/api_terminals_terminal_level.go index 8703540b2..1c5703f49 100644 --- a/src/management/api_terminals_terminal_level.go +++ b/src/management/api_terminals_terminal_level.go @@ -147,7 +147,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -156,7 +155,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -165,7 +163,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -174,7 +171,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -183,7 +179,6 @@ func (a *TerminalsTerminalLevelApi) ListTerminals(ctx context.Context, r Termina } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -252,7 +247,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -261,7 +255,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -270,7 +263,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -279,7 +271,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -288,7 +279,6 @@ func (a *TerminalsTerminalLevelApi) ReassignTerminal(ctx context.Context, r Term } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_users_company_level.go b/src/management/api_users_company_level.go index da36f198b..bf7524b0c 100644 --- a/src/management/api_users_company_level.go +++ b/src/management/api_users_company_level.go @@ -79,7 +79,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +87,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +95,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +103,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +111,6 @@ func (a *UsersCompanyLevelApi) CreateNewUser(ctx context.Context, r UsersCompany } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *UsersCompanyLevelApi) GetUserDetails(ctx context.Context, r UsersCompan } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +302,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +310,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -330,7 +318,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -339,7 +326,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -348,7 +334,6 @@ func (a *UsersCompanyLevelApi) ListUsers(ctx context.Context, r UsersCompanyLeve } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -421,7 +406,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -430,7 +414,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -439,7 +422,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -448,7 +430,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -457,7 +438,6 @@ func (a *UsersCompanyLevelApi) UpdateUserDetails(ctx context.Context, r UsersCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_users_merchant_level.go b/src/management/api_users_merchant_level.go index 69ca71fe2..efc79a915 100644 --- a/src/management/api_users_merchant_level.go +++ b/src/management/api_users_merchant_level.go @@ -79,7 +79,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -88,7 +87,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -97,7 +95,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -106,7 +103,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -115,7 +111,6 @@ func (a *UsersMerchantLevelApi) CreateNewUser(ctx context.Context, r UsersMercha } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -182,7 +177,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -191,7 +185,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -200,7 +193,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -209,7 +201,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -218,7 +209,6 @@ func (a *UsersMerchantLevelApi) GetUserDetails(ctx context.Context, r UsersMerch } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -312,7 +302,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -321,7 +310,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -330,7 +318,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -339,7 +326,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -348,7 +334,6 @@ func (a *UsersMerchantLevelApi) ListUsers(ctx context.Context, r UsersMerchantLe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -421,7 +406,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -430,7 +414,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -439,7 +422,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -448,7 +430,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -457,7 +438,6 @@ func (a *UsersMerchantLevelApi) UpdateUser(ctx context.Context, r UsersMerchantL } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_webhooks_company_level.go b/src/management/api_webhooks_company_level.go index 76356b2a0..4463707b2 100644 --- a/src/management/api_webhooks_company_level.go +++ b/src/management/api_webhooks_company_level.go @@ -75,7 +75,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *WebhooksCompanyLevelApi) GenerateHmacKey(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +173,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +181,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +189,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +197,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +205,6 @@ func (a *WebhooksCompanyLevelApi) GetWebhook(ctx context.Context, r WebhooksComp } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -298,7 +288,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +296,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +304,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +312,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +320,6 @@ func (a *WebhooksCompanyLevelApi) ListAllWebhooks(ctx context.Context, r Webhook } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +385,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +393,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +401,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +409,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +417,6 @@ func (a *WebhooksCompanyLevelApi) RemoveWebhook(ctx context.Context, r WebhooksC } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -505,7 +485,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -514,7 +493,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -523,7 +501,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -532,7 +509,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -541,7 +517,6 @@ func (a *WebhooksCompanyLevelApi) SetUpWebhook(ctx context.Context, r WebhooksCo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -619,7 +594,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -628,7 +602,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -637,7 +610,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -646,7 +618,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -655,7 +626,6 @@ func (a *WebhooksCompanyLevelApi) TestWebhook(ctx context.Context, r WebhooksCom } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -727,7 +697,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -736,7 +705,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -745,7 +713,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -754,7 +721,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -763,7 +729,6 @@ func (a *WebhooksCompanyLevelApi) UpdateWebhook(ctx context.Context, r WebhooksC } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/management/api_webhooks_merchant_level.go b/src/management/api_webhooks_merchant_level.go index f3748756d..adcf3dff5 100644 --- a/src/management/api_webhooks_merchant_level.go +++ b/src/management/api_webhooks_merchant_level.go @@ -75,7 +75,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *WebhooksMerchantLevelApi) GenerateHmacKey(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +173,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +181,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +189,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +197,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -214,7 +205,6 @@ func (a *WebhooksMerchantLevelApi) GetWebhook(ctx context.Context, r WebhooksMer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -298,7 +288,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -307,7 +296,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -316,7 +304,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -325,7 +312,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -334,7 +320,6 @@ func (a *WebhooksMerchantLevelApi) ListAllWebhooks(ctx context.Context, r Webhoo } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -400,7 +385,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -409,7 +393,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -418,7 +401,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -427,7 +409,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -436,7 +417,6 @@ func (a *WebhooksMerchantLevelApi) RemoveWebhook(ctx context.Context, r Webhooks } return httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -505,7 +485,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -514,7 +493,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -523,7 +501,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -532,7 +509,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -541,7 +517,6 @@ func (a *WebhooksMerchantLevelApi) SetUpWebhook(ctx context.Context, r WebhooksM } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -617,7 +592,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -626,7 +600,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -635,7 +608,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -644,7 +616,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -653,7 +624,6 @@ func (a *WebhooksMerchantLevelApi) TestWebhook(ctx context.Context, r WebhooksMe } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -725,7 +695,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -734,7 +703,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -743,7 +711,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -752,7 +719,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -761,7 +727,6 @@ func (a *WebhooksMerchantLevelApi) UpdateWebhook(ctx context.Context, r Webhooks } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/payments/api_payments.go b/src/payments/api_payments.go new file mode 100644 index 000000000..ba2cce245 --- /dev/null +++ b/src/payments/api_payments.go @@ -0,0 +1,260 @@ +/* +Adyen Payment API + +API version: 68 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package payments + +import ( + "context" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// PaymentsApi service +type PaymentsApi common.Service + +// All parameters accepted by PaymentsApi.Authorise +type PaymentsApiAuthoriseInput struct { + paymentRequest *PaymentRequest +} + +func (r PaymentsApiAuthoriseInput) PaymentRequest(paymentRequest PaymentRequest) PaymentsApiAuthoriseInput { + r.paymentRequest = &paymentRequest + return r +} + +/* +Prepare a request for Authorise + +@return PaymentsApiAuthoriseInput +*/ +func (a *PaymentsApi) AuthoriseInput() PaymentsApiAuthoriseInput { + return PaymentsApiAuthoriseInput{} +} + +/* +Authorise Create an authorisation + +Creates a payment with a unique reference (`pspReference`) and attempts to obtain an authorisation hold. For cards, this amount can be captured or cancelled later. Non-card payment methods typically don't support this and will automatically capture as part of the authorisation. +> 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 [`/payments`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthoriseInput - Request parameters, see AuthoriseInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise(ctx context.Context, r PaymentsApiAuthoriseInput) (PaymentResult, *http.Response, error) { + 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 +} + +// All parameters accepted by PaymentsApi.Authorise3d +type PaymentsApiAuthorise3dInput struct { + paymentRequest3d *PaymentRequest3d +} + +func (r PaymentsApiAuthorise3dInput) PaymentRequest3d(paymentRequest3d PaymentRequest3d) PaymentsApiAuthorise3dInput { + r.paymentRequest3d = &paymentRequest3d + return r +} + +/* +Prepare a request for Authorise3d + +@return PaymentsApiAuthorise3dInput +*/ +func (a *PaymentsApi) Authorise3dInput() PaymentsApiAuthorise3dInput { + return PaymentsApiAuthorise3dInput{} +} + +/* +Authorise3d Complete a 3DS authorisation + +For an authenticated 3D Secure session, completes the payment authorisation. This endpoint must receive the `md` and `paResponse` parameters that you get from the card issuer after a shopper pays via 3D Secure. + +> This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3dInput - Request parameters, see Authorise3dInput +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3d(ctx context.Context, r PaymentsApiAuthorise3dInput) (PaymentResult, *http.Response, error) { + 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 +} + +// All parameters accepted by PaymentsApi.Authorise3ds2 +type PaymentsApiAuthorise3ds2Input struct { + paymentRequest3ds2 *PaymentRequest3ds2 +} + +func (r PaymentsApiAuthorise3ds2Input) PaymentRequest3ds2(paymentRequest3ds2 PaymentRequest3ds2) PaymentsApiAuthorise3ds2Input { + r.paymentRequest3ds2 = &paymentRequest3ds2 + return r +} + +/* +Prepare a request for Authorise3ds2 + +@return PaymentsApiAuthorise3ds2Input +*/ +func (a *PaymentsApi) Authorise3ds2Input() PaymentsApiAuthorise3ds2Input { + return PaymentsApiAuthorise3ds2Input{} +} + +/* +Authorise3ds2 Complete a 3DS2 authorisation + +For an authenticated 3D Secure 2 session, completes the payment authorisation. This endpoint must receive the `threeDS2Token` and `threeDS2Result` parameters. + +> This endpoint is part of our [classic API integration](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure). If using a [newer integration](https://docs.adyen.com/online-payments), use the [`/payments/details`](https://docs.adyen.com/api-explorer/#/CheckoutService/payments/details) endpoint under Checkout API instead. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiAuthorise3ds2Input - Request parameters, see Authorise3ds2Input +@return PaymentResult, *http.Response, error +*/ +func (a *PaymentsApi) Authorise3ds2(ctx context.Context, r PaymentsApiAuthorise3ds2Input) (PaymentResult, *http.Response, error) { + 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 +} + +// All parameters accepted by PaymentsApi.GetAuthenticationResult +type PaymentsApiGetAuthenticationResultInput struct { + authenticationResultRequest *AuthenticationResultRequest +} + +func (r PaymentsApiGetAuthenticationResultInput) AuthenticationResultRequest(authenticationResultRequest AuthenticationResultRequest) PaymentsApiGetAuthenticationResultInput { + r.authenticationResultRequest = &authenticationResultRequest + return r +} + +/* +Prepare a request for GetAuthenticationResult + +@return PaymentsApiGetAuthenticationResultInput +*/ +func (a *PaymentsApi) GetAuthenticationResultInput() PaymentsApiGetAuthenticationResultInput { + return PaymentsApiGetAuthenticationResultInput{} +} + +/* +GetAuthenticationResult Get the 3DS authentication result + +Return the authentication result after doing a 3D Secure authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiGetAuthenticationResultInput - Request parameters, see GetAuthenticationResultInput +@return AuthenticationResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) GetAuthenticationResult(ctx context.Context, r PaymentsApiGetAuthenticationResultInput) (AuthenticationResultResponse, *http.Response, error) { + 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 +} + +// All parameters accepted by PaymentsApi.Retrieve3ds2Result +type PaymentsApiRetrieve3ds2ResultInput struct { + threeDS2ResultRequest *ThreeDS2ResultRequest +} + +func (r PaymentsApiRetrieve3ds2ResultInput) ThreeDS2ResultRequest(threeDS2ResultRequest ThreeDS2ResultRequest) PaymentsApiRetrieve3ds2ResultInput { + r.threeDS2ResultRequest = &threeDS2ResultRequest + return r +} + +/* +Prepare a request for Retrieve3ds2Result + +@return PaymentsApiRetrieve3ds2ResultInput +*/ +func (a *PaymentsApi) Retrieve3ds2ResultInput() PaymentsApiRetrieve3ds2ResultInput { + return PaymentsApiRetrieve3ds2ResultInput{} +} + +/* +Retrieve3ds2Result Get the 3DS2 authentication result + +Retrieves the `threeDS2Result` after doing a 3D Secure 2 authentication only. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PaymentsApiRetrieve3ds2ResultInput - Request parameters, see Retrieve3ds2ResultInput +@return ThreeDS2ResultResponse, *http.Response, error +*/ +func (a *PaymentsApi) Retrieve3ds2Result(ctx context.Context, r PaymentsApiRetrieve3ds2ResultInput) (ThreeDS2ResultResponse, *http.Response, error) { + 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 +} diff --git a/src/payments/client.go b/src/payments/client.go index 690fbea32..4c5b549cf 100644 --- a/src/payments/client.go +++ b/src/payments/client.go @@ -19,9 +19,9 @@ type APIClient struct { // API Services - GeneralApi *GeneralApi - ModificationsApi *ModificationsApi + + PaymentsApi *PaymentsApi } // NewAPIClient creates a new API client. @@ -33,8 +33,8 @@ func NewAPIClient(client *common.Client) *APIClient { } // API Services - c.GeneralApi = (*GeneralApi)(&c.common) c.ModificationsApi = (*ModificationsApi)(&c.common) + c.PaymentsApi = (*PaymentsApi)(&c.common) return c } \ No newline at end of file diff --git a/src/payments/model_additional_data_airline.go b/src/payments/model_additional_data_airline.go index 378744612..9d9ee676c 100644 --- a/src/payments/model_additional_data_airline.go +++ b/src/payments/model_additional_data_airline.go @@ -23,9 +23,9 @@ type AdditionalDataAirline struct { AirlineAgencyInvoiceNumber *string `json:"airline.agency_invoice_number,omitempty"` // The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters AirlineAgencyPlanName *string `json:"airline.agency_plan_name,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineCode *string `json:"airline.airline_code,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineAirlineDesignatorCode *string `json:"airline.airline_designator_code,omitempty"` // The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters AirlineBoardingFee *string `json:"airline.boarding_fee,omitempty"` @@ -37,21 +37,21 @@ type AdditionalDataAirline struct { AirlineDocumentType *string `json:"airline.document_type,omitempty"` // The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters AirlineFlightDate *string `json:"airline.flight_date,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros. AirlineLegCarrierCode *string `json:"airline.leg.carrier_code,omitempty"` - // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros + // A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros. AirlineLegClassOfTravel *string `json:"airline.leg.class_of_travel,omitempty"` // Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters AirlineLegDateOfTravel *string `json:"airline.leg.date_of_travel,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDepartAirport *string `json:"airline.leg.depart_airport,omitempty"` - // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros + // The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 *Must not be all zeros. AirlineLegDepartTax *string `json:"airline.leg.depart_tax,omitempty"` - // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros + // The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros. AirlineLegDestinationCode *string `json:"airline.leg.destination_code,omitempty"` - // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros + // The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces *Must not be all zeros. AirlineLegFareBaseCode *string `json:"airline.leg.fare_base_code,omitempty"` - // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros + // The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces *Must not be all zeros. AirlineLegFlightNumber *string `json:"airline.leg.flight_number,omitempty"` // A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character AirlineLegStopOverCode *string `json:"airline.leg.stop_over_code,omitempty"` @@ -65,15 +65,15 @@ type AdditionalDataAirline struct { AirlinePassengerTelephoneNumber *string `json:"airline.passenger.telephone_number,omitempty"` // The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters AirlinePassengerTravellerType *string `json:"airline.passenger.traveller_type,omitempty"` - // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros + // The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces *Must not be all zeros. AirlinePassengerName string `json:"airline.passenger_name"` // The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters AirlineTicketIssueAddress *string `json:"airline.ticket_issue_address,omitempty"` - // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros + // The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros. AirlineTicketNumber *string `json:"airline.ticket_number,omitempty"` - // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros + // The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyCode *string `json:"airline.travel_agency_code,omitempty"` - // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros + // The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros. AirlineTravelAgencyName *string `json:"airline.travel_agency_name,omitempty"` } diff --git a/src/payments/model_additional_data_car_rental.go b/src/payments/model_additional_data_car_rental.go index 6c0a5cff3..ae3f5ee1b 100644 --- a/src/payments/model_additional_data_car_rental.go +++ b/src/payments/model_additional_data_car_rental.go @@ -21,19 +21,19 @@ var _ common.MappedNullable = &AdditionalDataCarRental{} type AdditionalDataCarRental struct { // The pick-up date. * Date format: `yyyyMMdd` CarRentalCheckOutDate *string `json:"carRental.checkOutDate,omitempty"` - // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. CarRentalCustomerServiceTollFreeNumber *string `json:"carRental.customerServiceTollFreeNumber,omitempty"` - // Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces + // Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces CarRentalDaysRented *string `json:"carRental.daysRented,omitempty"` // Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 CarRentalFuelCharges *string `json:"carRental.fuelCharges,omitempty"` - // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros + // Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. CarRentalInsuranceCharges *string `json:"carRental.insuranceCharges,omitempty"` - // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationCity *string `json:"carRental.locationCity,omitempty"` // The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalLocationCountry *string `json:"carRental.locationCountry,omitempty"` - // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalLocationStateProvince *string `json:"carRental.locationStateProvince,omitempty"` // Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable CarRentalNoShowIndicator *string `json:"carRental.noShowIndicator,omitempty"` @@ -43,25 +43,25 @@ type AdditionalDataCarRental struct { CarRentalRate *string `json:"carRental.rate,omitempty"` // Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate CarRentalRateIndicator *string `json:"carRental.rateIndicator,omitempty"` - // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros + // The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalAgreementNumber *string `json:"carRental.rentalAgreementNumber,omitempty"` - // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros + // The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRentalClassId *string `json:"carRental.rentalClassId,omitempty"` - // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros + // The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. CarRentalRenterName *string `json:"carRental.renterName,omitempty"` - // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros + // The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnCity *string `json:"carRental.returnCity,omitempty"` // The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 CarRentalReturnCountry *string `json:"carRental.returnCountry,omitempty"` // The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 CarRentalReturnDate *string `json:"carRental.returnDate,omitempty"` - // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros + // The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnLocationId *string `json:"carRental.returnLocationId,omitempty"` - // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros + // The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. CarRentalReturnStateProvince *string `json:"carRental.returnStateProvince,omitempty"` // Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected CarRentalTaxExemptIndicator *string `json:"carRental.taxExemptIndicator,omitempty"` - // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 + // Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/payments/model_additional_data_level23.go b/src/payments/model_additional_data_level23.go index 9bf1f95be..879c31524 100644 --- a/src/payments/model_additional_data_level23.go +++ b/src/payments/model_additional_data_level23.go @@ -19,39 +19,39 @@ var _ common.MappedNullable = &AdditionalDataLevel23{} // AdditionalDataLevel23 struct for AdditionalDataLevel23 type AdditionalDataLevel23 struct { - // The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros + // The customer code. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters + // The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters EnhancedSchemeDataDestinationCountryCode *string `json:"enhancedSchemeData.destinationCountryCode,omitempty"` - // The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space + // The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space EnhancedSchemeDataDestinationPostalCode *string `json:"enhancedSchemeData.destinationPostalCode,omitempty"` - // Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space + // Destination state or province code. * Encoding: ASCII * Max length: 3 characters * Must not start with a space EnhancedSchemeDataDestinationStateProvinceCode *string `json:"enhancedSchemeData.destinationStateProvinceCode,omitempty"` - // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters EnhancedSchemeDataDutyAmount *string `json:"enhancedSchemeData.dutyAmount,omitempty"` - // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric *Max length: 12 characters EnhancedSchemeDataFreightAmount *string `json:"enhancedSchemeData.freightAmount,omitempty"` - // The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros + // The [UNSPC commodity code](https://www.unspsc.org/) of the item. * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrCommodityCode *string `json:"enhancedSchemeData.itemDetailLine[itemNr].commodityCode,omitempty"` - // A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros + // A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrDescription *string `json:"enhancedSchemeData.itemDetailLine[itemNr].description,omitempty"` - // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters 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 + // 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 + // 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"` - // The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros + // The unit of measurement for an item. * Encoding: ASCII Max length: 3 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure,omitempty"` - // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataItemDetailLineItemNrUnitPrice *string `json:"enhancedSchemeData.itemDetailLine[itemNr].unitPrice,omitempty"` - // The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters + // The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters EnhancedSchemeDataOrderDate *string `json:"enhancedSchemeData.orderDate,omitempty"` - // The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros + // The postal code of the address the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces * Must not be all zeros. EnhancedSchemeDataShipFromPostalCode *string `json:"enhancedSchemeData.shipFromPostalCode,omitempty"` - // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters + // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. *Encoding: Numeric *Max length: 12 characters * Must not be all zeros. EnhancedSchemeDataTotalTaxAmount *string `json:"enhancedSchemeData.totalTaxAmount,omitempty"` } diff --git a/src/payments/model_additional_data_lodging.go b/src/payments/model_additional_data_lodging.go index 654fa1cbd..6be62328c 100644 --- a/src/payments/model_additional_data_lodging.go +++ b/src/payments/model_additional_data_lodging.go @@ -23,13 +23,13 @@ type AdditionalDataLodging struct { LodgingCheckInDate *string `json:"lodging.checkInDate,omitempty"` // The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. LodgingCheckOutDate *string `json:"lodging.checkOutDate,omitempty"` - // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingCustomerServiceTollFreeNumber *string `json:"lodging.customerServiceTollFreeNumber,omitempty"` // Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character LodgingFireSafetyActIndicator *string `json:"lodging.fireSafetyActIndicator,omitempty"` // The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFolioCashAdvances *string `json:"lodging.folioCashAdvances,omitempty"` - // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros + // The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space *Must not be all zeros. LodgingFolioNumber *string `json:"lodging.folioNumber,omitempty"` // Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters LodgingFoodBeverageCharges *string `json:"lodging.foodBeverageCharges,omitempty"` @@ -37,9 +37,9 @@ type AdditionalDataLodging struct { LodgingNoShowIndicator *string `json:"lodging.noShowIndicator,omitempty"` // The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters LodgingPrepaidExpenses *string `json:"lodging.prepaidExpenses,omitempty"` - // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - + // The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. LodgingPropertyPhoneNumber *string `json:"lodging.propertyPhoneNumber,omitempty"` - // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters + // The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters LodgingRoom1NumberOfNights *string `json:"lodging.room1.numberOfNights,omitempty"` // The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingRoom1Rate *string `json:"lodging.room1.rate,omitempty"` @@ -47,7 +47,7 @@ type AdditionalDataLodging struct { LodgingTotalRoomTax *string `json:"lodging.totalRoomTax,omitempty"` // The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number LodgingTotalTax *string `json:"lodging.totalTax,omitempty"` - // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters + // The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters TravelEntertainmentAuthDataDuration *string `json:"travelEntertainmentAuthData.duration,omitempty"` // Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character TravelEntertainmentAuthDataMarket *string `json:"travelEntertainmentAuthData.market,omitempty"` diff --git a/src/payments/model_additional_data_temporary_services.go b/src/payments/model_additional_data_temporary_services.go index c1f21aaad..8532bece7 100644 --- a/src/payments/model_additional_data_temporary_services.go +++ b/src/payments/model_additional_data_temporary_services.go @@ -21,9 +21,9 @@ var _ common.MappedNullable = &AdditionalDataTemporaryServices{} type AdditionalDataTemporaryServices struct { // The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 EnhancedSchemeDataCustomerReference *string `json:"enhancedSchemeData.customerReference,omitempty"` - // The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataEmployeeName *string `json:"enhancedSchemeData.employeeName,omitempty"` - // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces + // The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. EnhancedSchemeDataJobDescription *string `json:"enhancedSchemeData.jobDescription,omitempty"` // The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros EnhancedSchemeDataRegularHoursRate *string `json:"enhancedSchemeData.regularHoursRate,omitempty"` diff --git a/src/payments/model_payment_request.go b/src/payments/model_payment_request.go index 503c6a05e..932ce271a 100644 --- a/src/payments/model_payment_request.go +++ b/src/payments/model_payment_request.go @@ -49,7 +49,7 @@ type PaymentRequest struct { // 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"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // 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"` // 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. diff --git a/src/payments/model_payment_request3d.go b/src/payments/model_payment_request3d.go index 4f453e1af..8cc660132 100644 --- a/src/payments/model_payment_request3d.go +++ b/src/payments/model_payment_request3d.go @@ -41,7 +41,7 @@ type PaymentRequest3d struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // 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"` // 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"` diff --git a/src/payments/model_payment_request3ds2.go b/src/payments/model_payment_request3ds2.go index 52ca20b06..22ed13853 100644 --- a/src/payments/model_payment_request3ds2.go +++ b/src/payments/model_payment_request3ds2.go @@ -41,7 +41,7 @@ type PaymentRequest3ds2 struct { // An integer value that is added to the normal fraud score. The value can be either positive or negative. FraudOffset *int32 `json:"fraudOffset,omitempty"` Installments *Installments `json:"installments,omitempty"` - // This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. + // 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"` // 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"` diff --git a/src/payments/model_payment_result.go b/src/payments/model_payment_result.go index 26b469d0c..cc4fb6160 100644 --- a/src/payments/model_payment_result.go +++ b/src/payments/model_payment_result.go @@ -37,7 +37,7 @@ type PaymentResult struct { 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 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. * **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. + // 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"` } @@ -493,7 +493,7 @@ func (v *NullablePaymentResult) UnmarshalJSON(src []byte) error { } func (o *PaymentResult) isValidResultCode() bool { - var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"} + 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 diff --git a/src/payments/model_recurring.go b/src/payments/model_recurring.go index d6b69f359..77098553a 100644 --- a/src/payments/model_recurring.go +++ b/src/payments/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/payments/model_split.go b/src/payments/model_split.go index 76f449cbb..b9a006aa2 100644 --- a/src/payments/model_split.go +++ b/src/payments/model_split.go @@ -19,14 +19,14 @@ var _ common.MappedNullable = &Split{} // Split struct for Split type Split struct { - // Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**. - Account *string `json:"account,omitempty"` - Amount SplitAmount `json:"amount"` - // A description of this split. + // 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"` + // Your description for the split item. Description *string `json:"description,omitempty"` - // Your reference for the split, which you can use to link the split to other operations such as captures and refunds. This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms. + // Your 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 sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. Reference *string `json:"reference,omitempty"` - // The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**. + // The type of the split item. Possible values: * [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic): **Commission**, **Default**, **Marketplace**, **PaymentFee**, **VAT**. * [Balance Platform](https://docs.adyen.com/marketplaces-and-platforms): **BalanceAccount**, **Commission**, **Default**, **PaymentFee**, **Remainder**, **Surcharge**, **Tip**, **VAT**. Type string `json:"type"` } @@ -34,9 +34,8 @@ type Split struct { // 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 NewSplit(amount SplitAmount, type_ string) *Split { +func NewSplit(type_ string) *Split { this := Split{} - this.Amount = amount this.Type = type_ return &this } @@ -81,28 +80,36 @@ func (o *Split) SetAccount(v string) { o.Account = &v } -// GetAmount returns the Amount field value +// GetAmount returns the Amount field value if set, zero value otherwise. func (o *Split) GetAmount() SplitAmount { - if o == nil { + if o == nil || common.IsNil(o.Amount) { var ret SplitAmount return ret } - - return o.Amount + return *o.Amount } -// GetAmountOk returns a tuple with the Amount field value +// 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 *Split) GetAmountOk() (*SplitAmount, bool) { - if o == nil { + if o == nil || common.IsNil(o.Amount) { return nil, false } - return &o.Amount, true + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Split) HasAmount() bool { + if o != nil && !common.IsNil(o.Amount) { + return true + } + + return false } -// SetAmount sets field value +// SetAmount gets a reference to the given SplitAmount and assigns it to the Amount field. func (o *Split) SetAmount(v SplitAmount) { - o.Amount = v + o.Amount = &v } // GetDescription returns the Description field value if set, zero value otherwise. @@ -206,7 +213,9 @@ func (o Split) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Account) { toSerialize["account"] = o.Account } - toSerialize["amount"] = o.Amount + if !common.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } if !common.IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -254,7 +263,7 @@ func (v *NullableSplit) UnmarshalJSON(src []byte) error { } func (o *Split) isValidType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "PaymentFeeAcquiring", "PaymentFeeAdyen", "PaymentFeeAdyenCommission", "PaymentFeeAdyenMarkup", "PaymentFeeInterchange", "PaymentFeeSchemeFee", "Remainder", "Surcharge", "Tip", "VAT", "Verification"} + var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "MarketPlace", "PaymentFee", "Remainder", "Surcharge", "Tip", "VAT"} for _, allowed := range allowedEnumValues { if o.GetType() == allowed { return true diff --git a/src/payments/model_split_amount.go b/src/payments/model_split_amount.go index 9c0eef857..ae2fd262f 100644 --- a/src/payments/model_split_amount.go +++ b/src/payments/model_split_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &SplitAmount{} // SplitAmount struct for SplitAmount type SplitAmount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. Currency *string `json:"currency,omitempty"` - // The amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). Value int64 `json:"value"` } diff --git a/src/payments/model_three_ds2_result.go b/src/payments/model_three_ds2_result.go index a0274562a..af9e41568 100644 --- a/src/payments/model_three_ds2_result.go +++ b/src/payments/model_three_ds2_result.go @@ -25,8 +25,6 @@ type ThreeDS2Result struct { CavvAlgorithm *string `json:"cavvAlgorithm,omitempty"` // Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). ChallengeCancel *string `json:"challengeCancel,omitempty"` - // Specifies a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - ChallengeIndicator *string `json:"challengeIndicator,omitempty"` // The `dsTransID` value as defined in the 3D Secure 2 specification. DsTransID *string `json:"dsTransID,omitempty"` // The `eci` value as defined in the 3D Secure 2 specification. @@ -37,6 +35,8 @@ type ThreeDS2Result struct { MessageVersion *string `json:"messageVersion,omitempty"` // Risk score calculated by Cartes Bancaires Directory Server (DS). RiskScore *string `json:"riskScore,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"` // The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. ThreeDSServerTransID *string `json:"threeDSServerTransID,omitempty"` // The `timestamp` value of the 3D Secure 2 authentication. @@ -162,38 +162,6 @@ func (o *ThreeDS2Result) SetChallengeCancel(v string) { o.ChallengeCancel = &v } -// GetChallengeIndicator returns the ChallengeIndicator field value if set, zero value otherwise. -func (o *ThreeDS2Result) GetChallengeIndicator() string { - if o == nil || common.IsNil(o.ChallengeIndicator) { - var ret string - return ret - } - return *o.ChallengeIndicator -} - -// GetChallengeIndicatorOk returns a tuple with the ChallengeIndicator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ThreeDS2Result) GetChallengeIndicatorOk() (*string, bool) { - if o == nil || common.IsNil(o.ChallengeIndicator) { - return nil, false - } - return o.ChallengeIndicator, true -} - -// HasChallengeIndicator returns a boolean if a field has been set. -func (o *ThreeDS2Result) HasChallengeIndicator() bool { - if o != nil && !common.IsNil(o.ChallengeIndicator) { - return true - } - - return false -} - -// SetChallengeIndicator gets a reference to the given string and assigns it to the ChallengeIndicator field. -func (o *ThreeDS2Result) SetChallengeIndicator(v string) { - o.ChallengeIndicator = &v -} - // GetDsTransID returns the DsTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetDsTransID() string { if o == nil || common.IsNil(o.DsTransID) { @@ -354,6 +322,38 @@ func (o *ThreeDS2Result) SetRiskScore(v string) { o.RiskScore = &v } +// GetThreeDSRequestorChallengeInd returns the ThreeDSRequestorChallengeInd field value if set, zero value otherwise. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeInd() string { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + var ret string + return ret + } + return *o.ThreeDSRequestorChallengeInd +} + +// GetThreeDSRequestorChallengeIndOk returns a tuple with the ThreeDSRequestorChallengeInd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ThreeDS2Result) GetThreeDSRequestorChallengeIndOk() (*string, bool) { + if o == nil || common.IsNil(o.ThreeDSRequestorChallengeInd) { + return nil, false + } + return o.ThreeDSRequestorChallengeInd, true +} + +// HasThreeDSRequestorChallengeInd returns a boolean if a field has been set. +func (o *ThreeDS2Result) HasThreeDSRequestorChallengeInd() bool { + if o != nil && !common.IsNil(o.ThreeDSRequestorChallengeInd) { + return true + } + + return false +} + +// SetThreeDSRequestorChallengeInd gets a reference to the given string and assigns it to the ThreeDSRequestorChallengeInd field. +func (o *ThreeDS2Result) SetThreeDSRequestorChallengeInd(v string) { + o.ThreeDSRequestorChallengeInd = &v +} + // GetThreeDSServerTransID returns the ThreeDSServerTransID field value if set, zero value otherwise. func (o *ThreeDS2Result) GetThreeDSServerTransID() string { if o == nil || common.IsNil(o.ThreeDSServerTransID) { @@ -533,9 +533,6 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ChallengeCancel) { toSerialize["challengeCancel"] = o.ChallengeCancel } - if !common.IsNil(o.ChallengeIndicator) { - toSerialize["challengeIndicator"] = o.ChallengeIndicator - } if !common.IsNil(o.DsTransID) { toSerialize["dsTransID"] = o.DsTransID } @@ -551,6 +548,9 @@ func (o ThreeDS2Result) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.RiskScore) { toSerialize["riskScore"] = o.RiskScore } + if !common.IsNil(o.ThreeDSRequestorChallengeInd) { + toSerialize["threeDSRequestorChallengeInd"] = o.ThreeDSRequestorChallengeInd + } if !common.IsNil(o.ThreeDSServerTransID) { toSerialize["threeDSServerTransID"] = o.ThreeDSServerTransID } @@ -614,19 +614,19 @@ func (o *ThreeDS2Result) isValidChallengeCancel() bool { } return false } -func (o *ThreeDS2Result) isValidChallengeIndicator() bool { - var allowedEnumValues = []string{"noPreference", "requestNoChallenge", "requestChallenge", "requestChallengeAsMandate"} +func (o *ThreeDS2Result) isValidExemptionIndicator() bool { + var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} for _, allowed := range allowedEnumValues { - if o.GetChallengeIndicator() == allowed { + if o.GetExemptionIndicator() == allowed { return true } } return false } -func (o *ThreeDS2Result) isValidExemptionIndicator() bool { - var allowedEnumValues = []string{"lowValue", "secureCorporate", "trustedBeneficiary", "transactionRiskAnalysis"} +func (o *ThreeDS2Result) isValidThreeDSRequestorChallengeInd() bool { + var allowedEnumValues = []string{"01", "02", "03", "04", "05", "06"} for _, allowed := range allowedEnumValues { - if o.GetExemptionIndicator() == allowed { + if o.GetThreeDSRequestorChallengeInd() == allowed { return true } } diff --git a/src/payout/model_recurring.go b/src/payout/model_recurring.go index 02c472eac..b9b76c070 100644 --- a/src/payout/model_recurring.go +++ b/src/payout/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/recurring/model_recurring.go b/src/recurring/model_recurring.go index 1816bd079..548b0838f 100644 --- a/src/recurring/model_recurring.go +++ b/src/recurring/model_recurring.go @@ -283,7 +283,7 @@ func (o *Recurring) isValidContract() bool { return false } func (o *Recurring) isValidTokenService() bool { - var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE"} + var allowedEnumValues = []string{"VISATOKENSERVICE", "MCTOKENSERVICE", "AMEXTOKENSERVICE", "TOKEN_SHARING"} for _, allowed := range allowedEnumValues { if o.GetTokenService() == allowed { return true diff --git a/src/transfers/api_capital.go b/src/transfers/api_capital.go index 7c531ee42..41089182b 100644 --- a/src/transfers/api_capital.go +++ b/src/transfers/api_capital.go @@ -75,7 +75,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -111,7 +107,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -120,7 +115,6 @@ func (a *CapitalApi) GetCapitalAccount(ctx context.Context, r CapitalApiGetCapit } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -180,7 +174,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -189,7 +182,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -198,7 +190,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -207,7 +198,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -216,7 +206,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -225,7 +214,6 @@ func (a *CapitalApi) GetGrantReferenceDetails(ctx context.Context, r CapitalApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -287,7 +275,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } var serviceError common.RestServiceError - if httpRes.StatusCode == 400 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -296,7 +283,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -305,7 +291,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -314,7 +299,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 404 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -323,7 +307,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -332,7 +315,6 @@ func (a *CapitalApi) RequestGrantPayout(ctx context.Context, r CapitalApiRequest } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/api_transactions.go b/src/transfers/api_transactions.go index 2b9d06c3b..8cc6ad2a2 100644 --- a/src/transfers/api_transactions.go +++ b/src/transfers/api_transactions.go @@ -157,7 +157,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -166,7 +165,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -175,7 +173,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -184,7 +181,6 @@ func (a *TransactionsApi) GetAllTransactions(ctx context.Context, r Transactions } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -246,7 +242,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -255,7 +250,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -264,7 +258,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -273,7 +266,6 @@ func (a *TransactionsApi) GetTransaction(ctx context.Context, r TransactionsApiG } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/api_transfers.go b/src/transfers/api_transfers.go index e67ec5437..5a10065c4 100644 --- a/src/transfers/api_transfers.go +++ b/src/transfers/api_transfers.go @@ -75,7 +75,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -84,7 +83,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -93,7 +91,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -102,7 +99,6 @@ func (a *TransfersApi) ReturnTransfer(ctx context.Context, r TransfersApiReturnT } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -178,7 +174,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } var serviceError common.RestServiceError - if httpRes.StatusCode == 401 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -187,7 +182,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 403 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -196,7 +190,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 422 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) @@ -205,7 +198,6 @@ func (a *TransfersApi) TransferFunds(ctx context.Context, r TransfersApiTransfer } return *res, httpRes, serviceError } - if httpRes.StatusCode == 500 { body, _ := ioutil.ReadAll(httpRes.Body) decodeError := json.Unmarshal([]byte(body), &serviceError) diff --git a/src/transfers/model_rest_service_error.go b/src/transfers/model_rest_service_error.go index 9f0cb1bf4..0e636d74d 100644 --- a/src/transfers/model_rest_service_error.go +++ b/src/transfers/model_rest_service_error.go @@ -28,8 +28,9 @@ 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 *JSONObject `json:"response,omitempty"` + RequestId *string `json:"requestId,omitempty"` + // JSON response payload. + Response map[string]interface{} `json:"response,omitempty"` // The HTTP status code. Status int32 `json:"status"` // A short, human-readable summary of the problem type. @@ -205,19 +206,19 @@ func (o *RestServiceError) SetRequestId(v string) { } // GetResponse returns the Response field value if set, zero value otherwise. -func (o *RestServiceError) GetResponse() JSONObject { +func (o *RestServiceError) GetResponse() map[string]interface{} { if o == nil || common.IsNil(o.Response) { - var ret JSONObject + var ret map[string]interface{} return ret } - return *o.Response + return o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RestServiceError) GetResponseOk() (*JSONObject, bool) { +func (o *RestServiceError) GetResponseOk() (map[string]interface{}, bool) { if o == nil || common.IsNil(o.Response) { - return nil, false + return map[string]interface{}{}, false } return o.Response, true } @@ -231,9 +232,9 @@ func (o *RestServiceError) HasResponse() bool { return false } -// SetResponse gets a reference to the given JSONObject and assigns it to the Response field. -func (o *RestServiceError) SetResponse(v JSONObject) { - o.Response = &v +// SetResponse gets a reference to the given map[string]interface{} and assigns it to the Response field. +func (o *RestServiceError) SetResponse(v map[string]interface{}) { + o.Response = v } // GetStatus returns the Status field value diff --git a/src/transfers/model_transaction.go b/src/transfers/model_transaction.go index fe1de6f4c..848758961 100644 --- a/src/transfers/model_transaction.go +++ b/src/transfers/model_transaction.go @@ -29,8 +29,6 @@ type Transaction struct { 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 PSP reference of the transaction in the journal. - EventId *string `json:"eventId,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. @@ -217,38 +215,6 @@ func (o *Transaction) SetCreationDate(v time.Time) { o.CreationDate = &v } -// GetEventId returns the EventId field value if set, zero value otherwise. -func (o *Transaction) GetEventId() string { - if o == nil || common.IsNil(o.EventId) { - var ret string - return ret - } - return *o.EventId -} - -// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Transaction) GetEventIdOk() (*string, bool) { - if o == nil || common.IsNil(o.EventId) { - return nil, false - } - return o.EventId, true -} - -// HasEventId returns a boolean if a field has been set. -func (o *Transaction) HasEventId() bool { - if o != nil && !common.IsNil(o.EventId) { - return true - } - - return false -} - -// SetEventId gets a reference to the given string and assigns it to the EventId field. -func (o *Transaction) SetEventId(v string) { - o.EventId = &v -} - // GetId returns the Id field value func (o *Transaction) GetId() string { if o == nil { @@ -371,9 +337,6 @@ func (o Transaction) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CreationDate) { toSerialize["creationDate"] = o.CreationDate } - if !common.IsNil(o.EventId) { - toSerialize["eventId"] = o.EventId - } toSerialize["id"] = o.Id toSerialize["status"] = o.Status if !common.IsNil(o.Transfer) { diff --git a/src/transferwebhook/model_additional_bank_identification.go b/src/transferwebhook/model_additional_bank_identification.go index 122183baf..e9ac24d0e 100644 --- a/src/transferwebhook/model_additional_bank_identification.go +++ b/src/transferwebhook/model_additional_bank_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_address.go b/src/transferwebhook/model_address.go index 3b09c42a2..ba1962e1d 100644 --- a/src/transferwebhook/model_address.go +++ b/src/transferwebhook/model_address.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_amount.go b/src/transferwebhook/model_amount.go index 96a6753f0..0e59e19a8 100644 --- a/src/transferwebhook/model_amount.go +++ b/src/transferwebhook/model_amount.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_amount_adjustment.go b/src/transferwebhook/model_amount_adjustment.go index 556344e5b..b6903d318 100644 --- a/src/transferwebhook/model_amount_adjustment.go +++ b/src/transferwebhook/model_amount_adjustment.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_au_local_account_identification.go b/src/transferwebhook/model_au_local_account_identification.go index 05cb5e3ee..f46c53bfc 100644 --- a/src/transferwebhook/model_au_local_account_identification.go +++ b/src/transferwebhook/model_au_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_balance_mutation.go b/src/transferwebhook/model_balance_mutation.go index b38a6897f..6aa344be8 100644 --- a/src/transferwebhook/model_balance_mutation.go +++ b/src/transferwebhook/model_balance_mutation.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_balance_platform_notification_response.go b/src/transferwebhook/model_balance_platform_notification_response.go index 2ec7cd2ad..61d09bc2a 100644 --- a/src/transferwebhook/model_balance_platform_notification_response.go +++ b/src/transferwebhook/model_balance_platform_notification_response.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_account_v3.go b/src/transferwebhook/model_bank_account_v3.go index 0c3fc99eb..038f008dd 100644 --- a/src/transferwebhook/model_bank_account_v3.go +++ b/src/transferwebhook/model_bank_account_v3.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_account_v3_account_identification.go b/src/transferwebhook/model_bank_account_v3_account_identification.go index 58afd2b2e..089e4dec7 100644 --- a/src/transferwebhook/model_bank_account_v3_account_identification.go +++ b/src/transferwebhook/model_bank_account_v3_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_bank_category_data.go b/src/transferwebhook/model_bank_category_data.go new file mode 100644 index 000000000..01aa2a592 --- /dev/null +++ b/src/transferwebhook/model_bank_category_data.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 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/transferwebhook/model_br_local_account_identification.go b/src/transferwebhook/model_br_local_account_identification.go index c4bd58d9e..bf220e344 100644 --- a/src/transferwebhook/model_br_local_account_identification.go +++ b/src/transferwebhook/model_br_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_ca_local_account_identification.go b/src/transferwebhook/model_ca_local_account_identification.go index 1383521ce..dca492314 100644 --- a/src/transferwebhook/model_ca_local_account_identification.go +++ b/src/transferwebhook/model_ca_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_counterparty_v3.go b/src/transferwebhook/model_counterparty_v3.go index 1eafb0b6b..d180afa38 100644 --- a/src/transferwebhook/model_counterparty_v3.go +++ b/src/transferwebhook/model_counterparty_v3.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_cz_local_account_identification.go b/src/transferwebhook/model_cz_local_account_identification.go index 7f213aae2..22edb653d 100644 --- a/src/transferwebhook/model_cz_local_account_identification.go +++ b/src/transferwebhook/model_cz_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_dk_local_account_identification.go b/src/transferwebhook/model_dk_local_account_identification.go index 590e580e3..23ef8a73d 100644 --- a/src/transferwebhook/model_dk_local_account_identification.go +++ b/src/transferwebhook/model_dk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_hk_local_account_identification.go b/src/transferwebhook/model_hk_local_account_identification.go index 76d2cdaeb..bc1761195 100644 --- a/src/transferwebhook/model_hk_local_account_identification.go +++ b/src/transferwebhook/model_hk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,10 +19,10 @@ var _ common.MappedNullable = &HKLocalAccountIdentification{} // HKLocalAccountIdentification struct for HKLocalAccountIdentification type HKLocalAccountIdentification struct { - // The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + // 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 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` + // The 3-digit clearing code, without separators or whitespace. + ClearingCode string `json:"clearingCode"` // **hkLocal** Type string `json:"type"` } @@ -31,10 +31,10 @@ type HKLocalAccountIdentification struct { // 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, bankCode string, type_ string) *HKLocalAccountIdentification { +func NewHKLocalAccountIdentification(accountNumber string, clearingCode string, type_ string) *HKLocalAccountIdentification { this := HKLocalAccountIdentification{} this.AccountNumber = accountNumber - this.BankCode = bankCode + this.ClearingCode = clearingCode this.Type = type_ return &this } @@ -73,28 +73,28 @@ func (o *HKLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetBankCode returns the BankCode field value -func (o *HKLocalAccountIdentification) GetBankCode() string { +// GetClearingCode returns the ClearingCode field value +func (o *HKLocalAccountIdentification) GetClearingCode() string { if o == nil { var ret string return ret } - return o.BankCode + return o.ClearingCode } -// GetBankCodeOk returns a tuple with the BankCode field value +// GetClearingCodeOk returns a tuple with the ClearingCode field value // and a boolean to check if the value has been set. -func (o *HKLocalAccountIdentification) GetBankCodeOk() (*string, bool) { +func (o *HKLocalAccountIdentification) GetClearingCodeOk() (*string, bool) { if o == nil { return nil, false } - return &o.BankCode, true + return &o.ClearingCode, true } -// SetBankCode sets field value -func (o *HKLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v +// SetClearingCode sets field value +func (o *HKLocalAccountIdentification) SetClearingCode(v string) { + o.ClearingCode = v } // GetType returns the Type field value @@ -132,7 +132,7 @@ func (o HKLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o HKLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["bankCode"] = o.BankCode + toSerialize["clearingCode"] = o.ClearingCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_hu_local_account_identification.go b/src/transferwebhook/model_hu_local_account_identification.go index 96640f236..0c15be119 100644 --- a/src/transferwebhook/model_hu_local_account_identification.go +++ b/src/transferwebhook/model_hu_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_iban_account_identification.go b/src/transferwebhook/model_iban_account_identification.go index 6e77c6c7d..292d9613d 100644 --- a/src/transferwebhook/model_iban_account_identification.go +++ b/src/transferwebhook/model_iban_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_internal_category_data.go b/src/transferwebhook/model_internal_category_data.go new file mode 100644 index 000000000..2c2fe887f --- /dev/null +++ b/src/transferwebhook/model_internal_category_data.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 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/transferwebhook/model_issued_card.go b/src/transferwebhook/model_issued_card.go new file mode 100644 index 000000000..54eb8095e --- /dev/null +++ b/src/transferwebhook/model_issued_card.go @@ -0,0 +1,304 @@ +/* +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/transferwebhook/model_merchant_data.go b/src/transferwebhook/model_merchant_data.go index 080d913d1..9903ea66e 100644 --- a/src/transferwebhook/model_merchant_data.go +++ b/src/transferwebhook/model_merchant_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,6 +19,8 @@ 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. @@ -45,6 +47,38 @@ func NewMerchantDataWithDefaults() *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) { @@ -183,6 +217,9 @@ func (o MerchantData) MarshalJSON() ([]byte, error) { 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 } diff --git a/src/transferwebhook/model_modification.go b/src/transferwebhook/model_modification.go new file mode 100644 index 000000000..53df6b0d4 --- /dev/null +++ b/src/transferwebhook/model_modification.go @@ -0,0 +1,283 @@ +/* +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/transferwebhook/model_name_location.go b/src/transferwebhook/model_name_location.go index e32271476..75cd5c42f 100644 --- a/src/transferwebhook/model_name_location.go +++ b/src/transferwebhook/model_name_location.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_no_local_account_identification.go b/src/transferwebhook/model_no_local_account_identification.go index 10f077f3d..dd6aa8f91 100644 --- a/src/transferwebhook/model_no_local_account_identification.go +++ b/src/transferwebhook/model_no_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_number_and_bic_account_identification.go b/src/transferwebhook/model_number_and_bic_account_identification.go index a30964dcc..0e17a775a 100644 --- a/src/transferwebhook/model_number_and_bic_account_identification.go +++ b/src/transferwebhook/model_number_and_bic_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_nz_local_account_identification.go b/src/transferwebhook/model_nz_local_account_identification.go index 6261840aa..b81e981be 100644 --- a/src/transferwebhook/model_nz_local_account_identification.go +++ b/src/transferwebhook/model_nz_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,12 +19,8 @@ var _ common.MappedNullable = &NZLocalAccountIdentification{} // NZLocalAccountIdentification struct for NZLocalAccountIdentification type NZLocalAccountIdentification struct { - // The 7-digit bank account number, without separators or whitespace. + // 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"` - // The 2- to 3-digit account suffix, without separators or whitespace. - AccountSuffix string `json:"accountSuffix"` - // The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. - BankCode string `json:"bankCode"` // **nzLocal** Type string `json:"type"` } @@ -33,11 +29,9 @@ type NZLocalAccountIdentification struct { // 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, accountSuffix string, bankCode string, type_ string) *NZLocalAccountIdentification { +func NewNZLocalAccountIdentification(accountNumber string, type_ string) *NZLocalAccountIdentification { this := NZLocalAccountIdentification{} this.AccountNumber = accountNumber - this.AccountSuffix = accountSuffix - this.BankCode = bankCode this.Type = type_ return &this } @@ -76,54 +70,6 @@ func (o *NZLocalAccountIdentification) SetAccountNumber(v string) { o.AccountNumber = v } -// GetAccountSuffix returns the AccountSuffix field value -func (o *NZLocalAccountIdentification) GetAccountSuffix() string { - if o == nil { - var ret string - return ret - } - - return o.AccountSuffix -} - -// GetAccountSuffixOk returns a tuple with the AccountSuffix field value -// and a boolean to check if the value has been set. -func (o *NZLocalAccountIdentification) GetAccountSuffixOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccountSuffix, true -} - -// SetAccountSuffix sets field value -func (o *NZLocalAccountIdentification) SetAccountSuffix(v string) { - o.AccountSuffix = v -} - -// GetBankCode returns the BankCode field value -func (o *NZLocalAccountIdentification) 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 *NZLocalAccountIdentification) GetBankCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BankCode, true -} - -// SetBankCode sets field value -func (o *NZLocalAccountIdentification) SetBankCode(v string) { - o.BankCode = v -} - // GetType returns the Type field value func (o *NZLocalAccountIdentification) GetType() string { if o == nil { @@ -159,8 +105,6 @@ func (o NZLocalAccountIdentification) MarshalJSON() ([]byte, error) { func (o NZLocalAccountIdentification) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["accountNumber"] = o.AccountNumber - toSerialize["accountSuffix"] = o.AccountSuffix - toSerialize["bankCode"] = o.BankCode toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/transferwebhook/model_party_identification.go b/src/transferwebhook/model_party_identification.go index 1db60e5a9..57992ddb0 100644 --- a/src/transferwebhook/model_party_identification.go +++ b/src/transferwebhook/model_party_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_payment_instrument.go b/src/transferwebhook/model_payment_instrument.go index 9de2b2089..53ca16ac9 100644 --- a/src/transferwebhook/model_payment_instrument.go +++ b/src/transferwebhook/model_payment_instrument.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_pl_local_account_identification.go b/src/transferwebhook/model_pl_local_account_identification.go index 448cfb849..8815ba608 100644 --- a/src/transferwebhook/model_pl_local_account_identification.go +++ b/src/transferwebhook/model_pl_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_platform_payment.go b/src/transferwebhook/model_platform_payment.go new file mode 100644 index 000000000..d7a992d48 --- /dev/null +++ b/src/transferwebhook/model_platform_payment.go @@ -0,0 +1,333 @@ +/* +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/transferwebhook/model_relayed_authorisation_data.go b/src/transferwebhook/model_relayed_authorisation_data.go index 44fbcf92a..f7281fd02 100644 --- a/src/transferwebhook/model_relayed_authorisation_data.go +++ b/src/transferwebhook/model_relayed_authorisation_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_resource.go b/src/transferwebhook/model_resource.go index 85a8725b4..5dade0651 100644 --- a/src/transferwebhook/model_resource.go +++ b/src/transferwebhook/model_resource.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_resource_reference.go b/src/transferwebhook/model_resource_reference.go index 71e524f70..20ed9a853 100644 --- a/src/transferwebhook/model_resource_reference.go +++ b/src/transferwebhook/model_resource_reference.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_se_local_account_identification.go b/src/transferwebhook/model_se_local_account_identification.go index 146f13365..bd28144a1 100644 --- a/src/transferwebhook/model_se_local_account_identification.go +++ b/src/transferwebhook/model_se_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_sg_local_account_identification.go b/src/transferwebhook/model_sg_local_account_identification.go index f35c56212..88181bccf 100644 --- a/src/transferwebhook/model_sg_local_account_identification.go +++ b/src/transferwebhook/model_sg_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_event_violation.go b/src/transferwebhook/model_transaction_event_violation.go index 9bf9db1d6..311880dd2 100644 --- a/src/transferwebhook/model_transaction_event_violation.go +++ b/src/transferwebhook/model_transaction_event_violation.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_rule_reference.go b/src/transferwebhook/model_transaction_rule_reference.go index 4f795d3ff..8609c38dc 100644 --- a/src/transferwebhook/model_transaction_rule_reference.go +++ b/src/transferwebhook/model_transaction_rule_reference.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,8 +23,12 @@ type TransactionRuleReference struct { 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 @@ -108,6 +112,38 @@ 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) { @@ -140,6 +176,38 @@ 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 { @@ -156,9 +224,15 @@ func (o TransactionRuleReference) ToMap() (map[string]interface{}, error) { 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 } diff --git a/src/transferwebhook/model_transaction_rule_source.go b/src/transferwebhook/model_transaction_rule_source.go index 379e75f19..f31fb70d5 100644 --- a/src/transferwebhook/model_transaction_rule_source.go +++ b/src/transferwebhook/model_transaction_rule_source.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transaction_rules_result.go b/src/transferwebhook/model_transaction_rules_result.go index 0468d481a..e4a87833a 100644 --- a/src/transferwebhook/model_transaction_rules_result.go +++ b/src/transferwebhook/model_transaction_rules_result.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,12 +21,12 @@ var _ common.MappedNullable = &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 transaction rules. - AllRulesPassed *bool `json:"allRulesPassed,omitempty"` - // Array containing all the transaction rules that the transaction violated. This list is only sent when `allRulesPassed` is **false**. - FailedTransactionRules []TransactionEventViolation `json:"failedTransactionRules,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 @@ -78,100 +78,100 @@ func (o *TransactionRulesResult) SetAdvice(v string) { o.Advice = &v } -// GetAllRulesPassed returns the AllRulesPassed field value if set, zero value otherwise. -func (o *TransactionRulesResult) GetAllRulesPassed() bool { - if o == nil || common.IsNil(o.AllRulesPassed) { +// 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.AllRulesPassed + return *o.AllHardBlockRulesPassed } -// GetAllRulesPassedOk returns a tuple with the AllRulesPassed field value if set, nil otherwise +// 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) GetAllRulesPassedOk() (*bool, bool) { - if o == nil || common.IsNil(o.AllRulesPassed) { +func (o *TransactionRulesResult) GetAllHardBlockRulesPassedOk() (*bool, bool) { + if o == nil || common.IsNil(o.AllHardBlockRulesPassed) { return nil, false } - return o.AllRulesPassed, true + return o.AllHardBlockRulesPassed, true } -// HasAllRulesPassed returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasAllRulesPassed() bool { - if o != nil && !common.IsNil(o.AllRulesPassed) { +// 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 } -// SetAllRulesPassed gets a reference to the given bool and assigns it to the AllRulesPassed field. -func (o *TransactionRulesResult) SetAllRulesPassed(v bool) { - o.AllRulesPassed = &v +// SetAllHardBlockRulesPassed gets a reference to the given bool and assigns it to the AllHardBlockRulesPassed field. +func (o *TransactionRulesResult) SetAllHardBlockRulesPassed(v bool) { + o.AllHardBlockRulesPassed = &v } -// GetFailedTransactionRules returns the FailedTransactionRules field value if set, zero value otherwise. -func (o *TransactionRulesResult) GetFailedTransactionRules() []TransactionEventViolation { - if o == nil || common.IsNil(o.FailedTransactionRules) { - var ret []TransactionEventViolation +// 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.FailedTransactionRules + return *o.Score } -// GetFailedTransactionRulesOk returns a tuple with the FailedTransactionRules field value if set, nil otherwise +// 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) GetFailedTransactionRulesOk() ([]TransactionEventViolation, bool) { - if o == nil || common.IsNil(o.FailedTransactionRules) { +func (o *TransactionRulesResult) GetScoreOk() (*int32, bool) { + if o == nil || common.IsNil(o.Score) { return nil, false } - return o.FailedTransactionRules, true + return o.Score, true } -// HasFailedTransactionRules returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasFailedTransactionRules() bool { - if o != nil && !common.IsNil(o.FailedTransactionRules) { +// 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 } -// SetFailedTransactionRules gets a reference to the given []TransactionEventViolation and assigns it to the FailedTransactionRules field. -func (o *TransactionRulesResult) SetFailedTransactionRules(v []TransactionEventViolation) { - o.FailedTransactionRules = v +// SetScore gets a reference to the given int32 and assigns it to the Score field. +func (o *TransactionRulesResult) SetScore(v int32) { + o.Score = &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 +// 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.Score + return o.TriggeredTransactionRules } -// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// 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) GetScoreOk() (*int32, bool) { - if o == nil || common.IsNil(o.Score) { +func (o *TransactionRulesResult) GetTriggeredTransactionRulesOk() ([]TransactionEventViolation, bool) { + if o == nil || common.IsNil(o.TriggeredTransactionRules) { return nil, false } - return o.Score, true + return o.TriggeredTransactionRules, true } -// HasScore returns a boolean if a field has been set. -func (o *TransactionRulesResult) HasScore() bool { - if o != nil && !common.IsNil(o.Score) { +// 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 } -// SetScore gets a reference to the given int32 and assigns it to the Score field. -func (o *TransactionRulesResult) SetScore(v int32) { - o.Score = &v +// 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) { @@ -187,15 +187,15 @@ func (o TransactionRulesResult) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Advice) { toSerialize["advice"] = o.Advice } - if !common.IsNil(o.AllRulesPassed) { - toSerialize["allRulesPassed"] = o.AllRulesPassed - } - if !common.IsNil(o.FailedTransactionRules) { - toSerialize["failedTransactionRules"] = o.FailedTransactionRules + 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 } diff --git a/src/transferwebhook/model_transfer_data.go b/src/transferwebhook/model_transfer_data.go index 29ee0af56..94820aa14 100644 --- a/src/transferwebhook/model_transfer_data.go +++ b/src/transferwebhook/model_transfer_data.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,16 +23,14 @@ type TransferData struct { AccountHolder *ResourceReference `json:"accountHolder,omitempty"` Amount Amount `json:"amount"` BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` - // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). - // Deprecated - BalanceAccountId *string `json:"balanceAccountId,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 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"` - Counterparty *CounterpartyV3 `json:"counterparty,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] & $ % # @** **~ = + - _ ' \" ! ?** @@ -42,55 +40,22 @@ type TransferData struct { // 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"` - // The capture's merchant reference included in the transfer. - // Deprecated - ModificationMerchantReference *string `json:"modificationMerchantReference,omitempty"` - // The capture reference included in the transfer. - // Deprecated - ModificationPspReference *string `json:"modificationPspReference,omitempty"` - // Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. - // Deprecated - PanEntryMode *string `json:"panEntryMode,omitempty"` + Id *string `json:"id,omitempty"` PaymentInstrument *PaymentInstrument `json:"paymentInstrument,omitempty"` - // The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. - // Deprecated - PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` - // The payment's merchant reference included in the transfer. - // Deprecated - PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. - // Deprecated - PlatformPaymentType *string `json:"platformPaymentType,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. 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"` - // Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. - // Deprecated - ProcessingType *string `json:"processingType,omitempty"` - // The payment reference included in the transfer. - // Deprecated - PspPaymentReference *string `json:"pspPaymentReference,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"` - RelayedAuthorisationData *RelayedAuthorisationData `json:"relayedAuthorisationData,omitempty"` + 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"` - // The ID of the transaction that is created based on the transfer. - // Deprecated - TransactionId *string `json:"transactionId,omitempty"` - TransactionRulesResult *TransactionRulesResult `json:"transactionRulesResult,omitempty"` + 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"` - // The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. - // Deprecated - ValidationFacts []TransferNotificationValidationFact `json:"validationFacts,omitempty"` } // NewTransferData instantiates a new TransferData object @@ -201,41 +166,6 @@ func (o *TransferData) SetBalanceAccount(v ResourceReference) { o.BalanceAccount = &v } -// GetBalanceAccountId returns the BalanceAccountId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetBalanceAccountId(v string) { - o.BalanceAccountId = &v -} - // GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. func (o *TransferData) GetBalancePlatform() string { if o == nil || common.IsNil(o.BalancePlatform) { @@ -324,6 +254,38 @@ 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) { @@ -516,111 +478,6 @@ func (o *TransferData) SetId(v string) { o.Id = &v } -// GetModificationMerchantReference returns the ModificationMerchantReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetModificationMerchantReference(v string) { - o.ModificationMerchantReference = &v -} - -// GetModificationPspReference returns the ModificationPspReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetModificationPspReference(v string) { - o.ModificationPspReference = &v -} - -// GetPanEntryMode returns the PanEntryMode field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetPanEntryMode(v string) { - o.PanEntryMode = &v -} - // GetPaymentInstrument returns the PaymentInstrument field value if set, zero value otherwise. func (o *TransferData) GetPaymentInstrument() PaymentInstrument { if o == nil || common.IsNil(o.PaymentInstrument) { @@ -653,213 +510,6 @@ func (o *TransferData) SetPaymentInstrument(v PaymentInstrument) { o.PaymentInstrument = &v } -// GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetPaymentInstrumentId(v string) { - o.PaymentInstrumentId = &v -} - -// GetPaymentMerchantReference returns the PaymentMerchantReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetPaymentMerchantReference(v string) { - o.PaymentMerchantReference = &v -} - -// GetPlatformPaymentType returns the PlatformPaymentType field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetPlatformPaymentType(v string) { - o.PlatformPaymentType = &v -} - -// GetPriority returns the Priority field value if set, zero value otherwise. -func (o *TransferData) 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 *TransferData) 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 *TransferData) 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 *TransferData) SetPriority(v string) { - o.Priority = &v -} - -// GetProcessingType returns the ProcessingType field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetProcessingType(v string) { - o.ProcessingType = &v -} - -// GetPspPaymentReference returns the PspPaymentReference field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetPspPaymentReference(v string) { - o.PspPaymentReference = &v -} - // GetReason returns the Reason field value if set, zero value otherwise. func (o *TransferData) GetReason() string { if o == nil || common.IsNil(o.Reason) { @@ -956,38 +606,6 @@ func (o *TransferData) SetReferenceForBeneficiary(v string) { o.ReferenceForBeneficiary = &v } -// GetRelayedAuthorisationData returns the RelayedAuthorisationData field value if set, zero value otherwise. -func (o *TransferData) 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 *TransferData) 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 *TransferData) 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 *TransferData) SetRelayedAuthorisationData(v RelayedAuthorisationData) { - o.RelayedAuthorisationData = &v -} - // GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. func (o *TransferData) GetSequenceNumber() int32 { if o == nil || common.IsNil(o.SequenceNumber) { @@ -1076,41 +694,6 @@ func (o *TransferData) SetTracking(v TransferNotificationTransferTracking) { o.Tracking = &v } -// GetTransactionId returns the TransactionId field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetTransactionId(v string) { - o.TransactionId = &v -} - // GetTransactionRulesResult returns the TransactionRulesResult field value if set, zero value otherwise. func (o *TransferData) GetTransactionRulesResult() TransactionRulesResult { if o == nil || common.IsNil(o.TransactionRulesResult) { @@ -1175,41 +758,6 @@ func (o *TransferData) SetType(v string) { o.Type = &v } -// GetValidationFacts returns the ValidationFacts field value if set, zero value otherwise. -// Deprecated -func (o *TransferData) 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. -// Deprecated -func (o *TransferData) 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 *TransferData) 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. -// Deprecated -func (o *TransferData) SetValidationFacts(v []TransferNotificationValidationFact) { - o.ValidationFacts = v -} - func (o TransferData) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -1227,9 +775,6 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.BalanceAccount) { toSerialize["balanceAccount"] = o.BalanceAccount } - if !common.IsNil(o.BalanceAccountId) { - toSerialize["balanceAccountId"] = o.BalanceAccountId - } if !common.IsNil(o.BalancePlatform) { toSerialize["balancePlatform"] = o.BalancePlatform } @@ -1237,6 +782,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { 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 } @@ -1255,36 +803,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Id) { toSerialize["id"] = o.Id } - if !common.IsNil(o.ModificationMerchantReference) { - toSerialize["modificationMerchantReference"] = o.ModificationMerchantReference - } - if !common.IsNil(o.ModificationPspReference) { - toSerialize["modificationPspReference"] = o.ModificationPspReference - } - if !common.IsNil(o.PanEntryMode) { - toSerialize["panEntryMode"] = o.PanEntryMode - } if !common.IsNil(o.PaymentInstrument) { toSerialize["paymentInstrument"] = o.PaymentInstrument } - if !common.IsNil(o.PaymentInstrumentId) { - toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId - } - if !common.IsNil(o.PaymentMerchantReference) { - toSerialize["paymentMerchantReference"] = o.PaymentMerchantReference - } - if !common.IsNil(o.PlatformPaymentType) { - toSerialize["platformPaymentType"] = o.PlatformPaymentType - } - if !common.IsNil(o.Priority) { - toSerialize["priority"] = o.Priority - } - if !common.IsNil(o.ProcessingType) { - toSerialize["processingType"] = o.ProcessingType - } - if !common.IsNil(o.PspPaymentReference) { - toSerialize["pspPaymentReference"] = o.PspPaymentReference - } if !common.IsNil(o.Reason) { toSerialize["reason"] = o.Reason } @@ -1294,9 +815,6 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ReferenceForBeneficiary) { toSerialize["referenceForBeneficiary"] = o.ReferenceForBeneficiary } - if !common.IsNil(o.RelayedAuthorisationData) { - toSerialize["relayedAuthorisationData"] = o.RelayedAuthorisationData - } if !common.IsNil(o.SequenceNumber) { toSerialize["sequenceNumber"] = o.SequenceNumber } @@ -1304,18 +822,12 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Tracking) { toSerialize["tracking"] = o.Tracking } - if !common.IsNil(o.TransactionId) { - toSerialize["transactionId"] = o.TransactionId - } if !common.IsNil(o.TransactionRulesResult) { toSerialize["transactionRulesResult"] = o.TransactionRulesResult } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } - if !common.IsNil(o.ValidationFacts) { - toSerialize["validationFacts"] = o.ValidationFacts - } return toSerialize, nil } @@ -1373,44 +885,8 @@ func (o *TransferData) isValidDirection() bool { } return false } -func (o *TransferData) 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 *TransferData) isValidPlatformPaymentType() bool { - var allowedEnumValues = []string{"BalanceAccount", "Commission", "Default", "PaymentFee", "VAT"} - for _, allowed := range allowedEnumValues { - if o.GetPlatformPaymentType() == allowed { - return true - } - } - return false -} -func (o *TransferData) isValidPriority() bool { - var allowedEnumValues = []string{"crossBorder", "directDebit", "fast", "instant", "internal", "regular", "wire"} - for _, allowed := range allowedEnumValues { - if o.GetPriority() == allowed { - return true - } - } - return false -} -func (o *TransferData) 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 *TransferData) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + 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 @@ -1419,7 +895,7 @@ func (o *TransferData) isValidReason() bool { 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", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + 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 @@ -1428,7 +904,7 @@ func (o *TransferData) isValidStatus() bool { return false } func (o *TransferData) isValidType() bool { - var allowedEnumValues = []string{"atmWithdrawal", "atmWithdrawalReversal", "balanceAdjustment", "balanceRollover", "bankTransfer", "capture", "captureReversal", "cardTransfer", "chargeback", "chargebackReversal", "depositCorrection", "fee", "grant", "installment", "installmentReversal", "internalTransfer", "invoiceDeduction", "leftover", "manualCorrection", "miscCost", "payment", "paymentCost", "refund", "refundReversal", "repayment", "reserveAdjustment", "secondChargeback"} + 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 diff --git a/src/transferwebhook/model_transfer_data_category_data.go b/src/transferwebhook/model_transfer_data_category_data.go new file mode 100644 index 000000000..7250ffb3d --- /dev/null +++ b/src/transferwebhook/model_transfer_data_category_data.go @@ -0,0 +1,203 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + "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/transferwebhook/model_transfer_event.go b/src/transferwebhook/model_transfer_event.go index 2f1ec1613..5e27a90d5 100644 --- a/src/transferwebhook/model_transfer_event.go +++ b/src/transferwebhook/model_transfer_event.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,17 +28,21 @@ type TransferEvent struct { // 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"` + 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"` - TransferOperation *TransferOperation `json:"transferOperation,omitempty"` + 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. @@ -224,6 +228,38 @@ 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) { @@ -320,6 +356,70 @@ 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) { @@ -384,38 +484,6 @@ func (o *TransferEvent) SetTransactionId(v string) { o.TransactionId = &v } -// GetTransferOperation returns the TransferOperation field value if set, zero value otherwise. -func (o *TransferEvent) GetTransferOperation() TransferOperation { - if o == nil || common.IsNil(o.TransferOperation) { - var ret TransferOperation - return ret - } - return *o.TransferOperation -} - -// GetTransferOperationOk returns a tuple with the TransferOperation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransferEvent) GetTransferOperationOk() (*TransferOperation, bool) { - if o == nil || common.IsNil(o.TransferOperation) { - return nil, false - } - return o.TransferOperation, true -} - -// HasTransferOperation returns a boolean if a field has been set. -func (o *TransferEvent) HasTransferOperation() bool { - if o != nil && !common.IsNil(o.TransferOperation) { - return true - } - - return false -} - -// SetTransferOperation gets a reference to the given TransferOperation and assigns it to the TransferOperation field. -func (o *TransferEvent) SetTransferOperation(v TransferOperation) { - o.TransferOperation = &v -} - // GetType returns the Type field value if set, zero value otherwise. func (o *TransferEvent) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -537,6 +605,9 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { 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 } @@ -546,15 +617,18 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { 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.TransferOperation) { - toSerialize["transferOperation"] = o.TransferOperation - } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } @@ -604,7 +678,7 @@ func (v *NullableTransferEvent) UnmarshalJSON(src []byte) error { } func (o *TransferEvent) isValidReason() bool { - var allowedEnumValues = []string{"amountLimitExceeded", "approved", "counterpartyAccountBlocked", "counterpartyAccountClosed", "counterpartyAccountNotFound", "counterpartyAddressRequired", "counterpartyBankTimedOut", "counterpartyBankUnavailable", "error", "notEnoughBalance", "refusedByCounterpartyBank", "routeNotFound", "unknown"} + 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 @@ -613,7 +687,7 @@ func (o *TransferEvent) isValidReason() bool { 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", "operationAuthorized", "operationBooked", "operationPending", "operationReceived", "paymentCost", "paymentCostPending", "received", "refundPending", "refundReversalPending", "refundReversed", "refunded", "refundedExternally", "refused", "reserveAdjustment", "reserveAdjustmentPending", "returned", "secondChargeback", "secondChargebackPending", "undefined"} + 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 diff --git a/src/transferwebhook/model_transfer_notification_request.go b/src/transferwebhook/model_transfer_notification_request.go index df09ce6fb..ba32057c1 100644 --- a/src/transferwebhook/model_transfer_notification_request.go +++ b/src/transferwebhook/model_transfer_notification_request.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transfer_notification_transfer_tracking.go b/src/transferwebhook/model_transfer_notification_transfer_tracking.go index 1c6673738..73149f240 100644 --- a/src/transferwebhook/model_transfer_notification_transfer_tracking.go +++ b/src/transferwebhook/model_transfer_notification_transfer_tracking.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_transfer_notification_validation_fact.go b/src/transferwebhook/model_transfer_notification_validation_fact.go index e3c9e050c..615542d0b 100644 --- a/src/transferwebhook/model_transfer_notification_validation_fact.go +++ b/src/transferwebhook/model_transfer_notification_validation_fact.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_uk_local_account_identification.go b/src/transferwebhook/model_uk_local_account_identification.go index 51f2181c8..a2adbfa5a 100644 --- a/src/transferwebhook/model_uk_local_account_identification.go +++ b/src/transferwebhook/model_uk_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/src/transferwebhook/model_us_local_account_identification.go b/src/transferwebhook/model_us_local_account_identification.go index df4be937f..665fadb94 100644 --- a/src/transferwebhook/model_us_local_account_identification.go +++ b/src/transferwebhook/model_us_local_account_identification.go @@ -1,7 +1,7 @@ /* Transfer webhooks -API version: 3 +API version: 4 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.