From 9fc71e2d0c379d1fd4bd74fc33bc9da0c0cb3f4d Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Fri, 26 Jan 2024 09:55:37 +0000 Subject: [PATCH] [create-pull-request] automated change --- src/balanceplatform/api_balance_accounts.go | 160 +++---- src/balanceplatform/api_card_orders.go | 316 ++++++++++++++ src/balanceplatform/api_pin_functionality.go | 291 +++++++++++++ src/balanceplatform/client.go | 18 +- .../model_bank_account_model.go | 135 ++++++ src/balanceplatform/model_card_order.go | 395 ++++++++++++++++++ src/balanceplatform/model_card_order_item.go | 383 +++++++++++++++++ .../model_card_order_item_delivery_status.go | 209 +++++++++ src/balanceplatform/model_grant_offer.go | 47 ++- ..._paginated_get_card_order_item_response.go | 172 ++++++++ ...model_paginated_get_card_order_response.go | 181 ++++++++ .../model_payment_instrument_info.go | 40 +- .../model_pin_change_request.go | 200 +++++++++ .../model_pin_change_response.go | 126 ++++++ .../model_public_key_response.go | 144 +++++++ .../model_reveal_pin_request.go | 144 +++++++ .../model_reveal_pin_response.go | 144 +++++++ src/checkout/client.go | 12 +- .../model_card_order_item.go | 2 +- .../model_card_order_item_delivery_status.go | 6 +- src/legalentity/api_business_lines.go | 2 +- src/legalentity/api_hosted_onboarding.go | 6 +- src/legalentity/api_legal_entities.go | 2 +- src/legalentity/client.go | 12 +- src/management/client.go | 12 +- src/management/model_localization.go | 37 ++ src/management/model_passcodes.go | 2 +- src/management/model_pay_at_table.go | 46 ++ src/management/model_payment_method.go | 2 +- .../model_payment_method_setup_info.go | 2 +- src/management/model_referenced.go | 125 ++++++ src/management/model_refunds.go | 124 ++++++ src/management/model_terminal_settings.go | 36 ++ src/payments/client.go | 12 +- src/payout/client.go | 12 +- src/transfers/client.go | 12 +- 36 files changed, 3416 insertions(+), 153 deletions(-) create mode 100644 src/balanceplatform/api_card_orders.go create mode 100644 src/balanceplatform/api_pin_functionality.go create mode 100644 src/balanceplatform/model_bank_account_model.go create mode 100644 src/balanceplatform/model_card_order.go create mode 100644 src/balanceplatform/model_card_order_item.go create mode 100644 src/balanceplatform/model_card_order_item_delivery_status.go create mode 100644 src/balanceplatform/model_paginated_get_card_order_item_response.go create mode 100644 src/balanceplatform/model_paginated_get_card_order_response.go create mode 100644 src/balanceplatform/model_pin_change_request.go create mode 100644 src/balanceplatform/model_pin_change_response.go create mode 100644 src/balanceplatform/model_public_key_response.go create mode 100644 src/balanceplatform/model_reveal_pin_request.go create mode 100644 src/balanceplatform/model_reveal_pin_response.go create mode 100644 src/management/model_referenced.go create mode 100644 src/management/model_refunds.go diff --git a/src/balanceplatform/api_balance_accounts.go b/src/balanceplatform/api_balance_accounts.go index 44981ac51..d1c665ea3 100644 --- a/src/balanceplatform/api_balance_accounts.go +++ b/src/balanceplatform/api_balance_accounts.go @@ -308,51 +308,51 @@ func (a *BalanceAccountsApi) DeleteSweep(ctx context.Context, r BalanceAccountsA return httpRes, err } -// All parameters accepted by BalanceAccountsApi.GetAllPaymentInstrumentsForBalanceAccount -type BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput struct { - id string - offset *int32 - limit *int32 +// All parameters accepted by BalanceAccountsApi.GetAllSweepsForBalanceAccount +type BalanceAccountsApiGetAllSweepsForBalanceAccountInput struct { + balanceAccountId string + offset *int32 + limit *int32 } // The number of items that you want to skip. -func (r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput) Offset(offset int32) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput { +func (r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) Offset(offset int32) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { r.offset = &offset return r } // The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput) Limit(limit int32) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput { +func (r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) Limit(limit int32) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { r.limit = &limit return r } /* -Prepare a request for GetAllPaymentInstrumentsForBalanceAccount -@param id The unique identifier of the balance account. -@return BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput +Prepare a request for GetAllSweepsForBalanceAccount +@param balanceAccountId The unique identifier of the balance account. +@return BalanceAccountsApiGetAllSweepsForBalanceAccountInput */ -func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccountInput(id string) BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput { - return BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput{ - id: id, +func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccountInput(balanceAccountId string) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { + return BalanceAccountsApiGetAllSweepsForBalanceAccountInput{ + balanceAccountId: balanceAccountId, } } /* -GetAllPaymentInstrumentsForBalanceAccount Get all payment instruments for a balance account +GetAllSweepsForBalanceAccount Get all sweeps for a balance account -Returns a paginated list of the payment instruments associated with a balance account. +Returns a list of the sweeps configured for a balance account. -To fetch multiple pages, use the query parameters.For example, to limit the page to 3 payment instruments and to skip the first 6, use `/balanceAccounts/{id}/paymentInstruments?limit=3&offset=6`. +To fetch multiple pages, use the query parameters. For example, to limit the page to 5 sweeps and to skip the first 10, use `/balanceAccounts/{balanceAccountId}/sweeps?limit=5&offset=10`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput - Request parameters, see GetAllPaymentInstrumentsForBalanceAccountInput -@return PaginatedPaymentInstrumentsResponse, *http.Response, error +@param r BalanceAccountsApiGetAllSweepsForBalanceAccountInput - Request parameters, see GetAllSweepsForBalanceAccountInput +@return BalanceSweepConfigurationsResponse, *http.Response, error */ -func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx context.Context, r BalanceAccountsApiGetAllPaymentInstrumentsForBalanceAccountInput) (PaginatedPaymentInstrumentsResponse, *http.Response, error) { - res := &PaginatedPaymentInstrumentsResponse{} - path := "/balanceAccounts/{id}/paymentInstruments" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) +func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) (BalanceSweepConfigurationsResponse, *http.Response, error) { + res := &BalanceSweepConfigurationsResponse{} + path := "/balanceAccounts/{balanceAccountId}/sweeps" + path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) queryParams := url.Values{} headerParams := make(map[string]string) if r.offset != nil { @@ -421,59 +421,37 @@ func (a *BalanceAccountsApi) GetAllPaymentInstrumentsForBalanceAccount(ctx conte return *res, httpRes, err } -// All parameters accepted by BalanceAccountsApi.GetAllSweepsForBalanceAccount -type BalanceAccountsApiGetAllSweepsForBalanceAccountInput struct { - balanceAccountId string - offset *int32 - limit *int32 -} - -// The number of items that you want to skip. -func (r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) Offset(offset int32) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { - r.offset = &offset - return r -} - -// The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. -func (r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) Limit(limit int32) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { - r.limit = &limit - return r +// All parameters accepted by BalanceAccountsApi.GetBalanceAccount +type BalanceAccountsApiGetBalanceAccountInput struct { + id string } /* -Prepare a request for GetAllSweepsForBalanceAccount -@param balanceAccountId The unique identifier of the balance account. -@return BalanceAccountsApiGetAllSweepsForBalanceAccountInput +Prepare a request for GetBalanceAccount +@param id The unique identifier of the balance account. +@return BalanceAccountsApiGetBalanceAccountInput */ -func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccountInput(balanceAccountId string) BalanceAccountsApiGetAllSweepsForBalanceAccountInput { - return BalanceAccountsApiGetAllSweepsForBalanceAccountInput{ - balanceAccountId: balanceAccountId, +func (a *BalanceAccountsApi) GetBalanceAccountInput(id string) BalanceAccountsApiGetBalanceAccountInput { + return BalanceAccountsApiGetBalanceAccountInput{ + id: id, } } /* -GetAllSweepsForBalanceAccount Get all sweeps for a balance account - -Returns a list of the sweeps configured for a balance account. +GetBalanceAccount Get a balance account -To fetch multiple pages, use the query parameters. For example, to limit the page to 5 sweeps and to skip the first 10, use `/balanceAccounts/{balanceAccountId}/sweeps?limit=5&offset=10`. +Returns a balance account and its balances for the default currency and other currencies with a non-zero balance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r BalanceAccountsApiGetAllSweepsForBalanceAccountInput - Request parameters, see GetAllSweepsForBalanceAccountInput -@return BalanceSweepConfigurationsResponse, *http.Response, error +@param r BalanceAccountsApiGetBalanceAccountInput - Request parameters, see GetBalanceAccountInput +@return BalanceAccount, *http.Response, error */ -func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, r BalanceAccountsApiGetAllSweepsForBalanceAccountInput) (BalanceSweepConfigurationsResponse, *http.Response, error) { - res := &BalanceSweepConfigurationsResponse{} - path := "/balanceAccounts/{balanceAccountId}/sweeps" - path = strings.Replace(path, "{"+"balanceAccountId"+"}", url.PathEscape(common.ParameterValueToString(r.balanceAccountId, "balanceAccountId")), -1) +func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAccountsApiGetBalanceAccountInput) (BalanceAccount, *http.Response, error) { + res := &BalanceAccount{} + path := "/balanceAccounts/{id}" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) - if r.offset != nil { - common.ParameterAddToQuery(queryParams, "offset", r.offset, "") - } - if r.limit != nil { - common.ParameterAddToQuery(queryParams, "limit", r.limit, "") - } httpRes, err := common.SendAPIRequest( ctx, a.Client, @@ -534,37 +512,69 @@ func (a *BalanceAccountsApi) GetAllSweepsForBalanceAccount(ctx context.Context, return *res, httpRes, err } -// All parameters accepted by BalanceAccountsApi.GetBalanceAccount -type BalanceAccountsApiGetBalanceAccountInput struct { - id string +// All parameters accepted by BalanceAccountsApi.GetPaymentInstrumentsLinkedToBalanceAccount +type BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput struct { + id string + offset *int32 + limit *int32 + status *string +} + +// The number of items that you want to skip. +func (r BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput) Offset(offset int32) BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput { + r.offset = &offset + return r +} + +// The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. +func (r BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput) Limit(limit int32) BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput { + r.limit = &limit + return r +} + +// The status of the payment instruments that you want to get. By default, the response includes payment instruments with any status. +func (r BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput) Status(status string) BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput { + r.status = &status + return r } /* -Prepare a request for GetBalanceAccount +Prepare a request for GetPaymentInstrumentsLinkedToBalanceAccount @param id The unique identifier of the balance account. -@return BalanceAccountsApiGetBalanceAccountInput +@return BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput */ -func (a *BalanceAccountsApi) GetBalanceAccountInput(id string) BalanceAccountsApiGetBalanceAccountInput { - return BalanceAccountsApiGetBalanceAccountInput{ +func (a *BalanceAccountsApi) GetPaymentInstrumentsLinkedToBalanceAccountInput(id string) BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput { + return BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput{ id: id, } } /* -GetBalanceAccount Get a balance account +GetPaymentInstrumentsLinkedToBalanceAccount Get payment instruments linked to a balance account -Returns a balance account and its balances for the default currency and other currencies with a non-zero balance. +Returns a paginated list of the payment instruments associated with a balance account. + +To fetch multiple pages, use the query parameters.For example, to limit the page to 3 payment instruments which are in active status and to skip the first 6, use `/balanceAccounts/{id}/paymentInstruments?limit=3&offset=6&status=active`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@param r BalanceAccountsApiGetBalanceAccountInput - Request parameters, see GetBalanceAccountInput -@return BalanceAccount, *http.Response, error +@param r BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput - Request parameters, see GetPaymentInstrumentsLinkedToBalanceAccountInput +@return PaginatedPaymentInstrumentsResponse, *http.Response, error */ -func (a *BalanceAccountsApi) GetBalanceAccount(ctx context.Context, r BalanceAccountsApiGetBalanceAccountInput) (BalanceAccount, *http.Response, error) { - res := &BalanceAccount{} - path := "/balanceAccounts/{id}" +func (a *BalanceAccountsApi) GetPaymentInstrumentsLinkedToBalanceAccount(ctx context.Context, r BalanceAccountsApiGetPaymentInstrumentsLinkedToBalanceAccountInput) (PaginatedPaymentInstrumentsResponse, *http.Response, error) { + res := &PaginatedPaymentInstrumentsResponse{} + path := "/balanceAccounts/{id}/paymentInstruments" path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) queryParams := url.Values{} headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } httpRes, err := common.SendAPIRequest( ctx, a.Client, diff --git a/src/balanceplatform/api_card_orders.go b/src/balanceplatform/api_card_orders.go new file mode 100644 index 000000000..f28efc952 --- /dev/null +++ b/src/balanceplatform/api_card_orders.go @@ -0,0 +1,316 @@ +/* +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" + "strings" + "time" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// CardOrdersApi service +type CardOrdersApi common.Service + +// All parameters accepted by CardOrdersApi.GetCardOrderItems +type CardOrdersApiGetCardOrderItemsInput struct { + id string + offset *int32 + limit *int32 +} + +// Specifies the position of an element in a list of card orders. The response includes a list of card order items that starts at the specified offset. **Default:** 0, which means that the response contains all the elements in the list of card order items. +func (r CardOrdersApiGetCardOrderItemsInput) Offset(offset int32) CardOrdersApiGetCardOrderItemsInput { + r.offset = &offset + return r +} + +// The number of card order items returned per page. **Default:** 10. +func (r CardOrdersApiGetCardOrderItemsInput) Limit(limit int32) CardOrdersApiGetCardOrderItemsInput { + r.limit = &limit + return r +} + +/* +Prepare a request for GetCardOrderItems +@param id The unique identifier of the card order. +@return CardOrdersApiGetCardOrderItemsInput +*/ +func (a *CardOrdersApi) GetCardOrderItemsInput(id string) CardOrdersApiGetCardOrderItemsInput { + return CardOrdersApiGetCardOrderItemsInput{ + id: id, + } +} + +/* +GetCardOrderItems Get card order items + +Returns the item list of a specific card order. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r CardOrdersApiGetCardOrderItemsInput - Request parameters, see GetCardOrderItemsInput +@return PaginatedGetCardOrderItemResponse, *http.Response, error +*/ +func (a *CardOrdersApi) GetCardOrderItems(ctx context.Context, r CardOrdersApiGetCardOrderItemsInput) (PaginatedGetCardOrderItemResponse, *http.Response, error) { + res := &PaginatedGetCardOrderItemResponse{} + path := "/cardorders/{id}/items" + path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(common.ParameterValueToString(r.id, "id")), -1) + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.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 CardOrdersApi.ListCardOrders +type CardOrdersApiListCardOrdersInput struct { + id *string + cardManufacturingProfileId *string + status *string + txVariantCode *string + createdSince *time.Time + createdUntil *time.Time + lockedSince *time.Time + lockedUntil *time.Time + serviceCenter *string + offset *int32 + limit *int32 +} + +// The unique identifier of the card order. +func (r CardOrdersApiListCardOrdersInput) Id(id string) CardOrdersApiListCardOrdersInput { + r.id = &id + return r +} + +// The unique identifier of the card manufacturer profile. +func (r CardOrdersApiListCardOrdersInput) CardManufacturingProfileId(cardManufacturingProfileId string) CardOrdersApiListCardOrdersInput { + r.cardManufacturingProfileId = &cardManufacturingProfileId + return r +} + +// The status of the card order. +func (r CardOrdersApiListCardOrdersInput) Status(status string) CardOrdersApiListCardOrdersInput { + r.status = &status + return r +} + +// The unique code of the card manufacturer profile. Possible values: **mcmaestro**, **mc**, **visa**, **mcdebit**. +func (r CardOrdersApiListCardOrdersInput) TxVariantCode(txVariantCode string) CardOrdersApiListCardOrdersInput { + r.txVariantCode = &txVariantCode + return r +} + +// Only include card orders that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r CardOrdersApiListCardOrdersInput) CreatedSince(createdSince time.Time) CardOrdersApiListCardOrdersInput { + r.createdSince = &createdSince + return r +} + +// Only include card orders that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r CardOrdersApiListCardOrdersInput) CreatedUntil(createdUntil time.Time) CardOrdersApiListCardOrdersInput { + r.createdUntil = &createdUntil + return r +} + +// Only include card orders that have been locked on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r CardOrdersApiListCardOrdersInput) LockedSince(lockedSince time.Time) CardOrdersApiListCardOrdersInput { + r.lockedSince = &lockedSince + return r +} + +// Only include card orders that have been locked on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. +func (r CardOrdersApiListCardOrdersInput) LockedUntil(lockedUntil time.Time) CardOrdersApiListCardOrdersInput { + r.lockedUntil = &lockedUntil + return r +} + +// The service center at which the card is issued. The value is case-sensitive. +func (r CardOrdersApiListCardOrdersInput) ServiceCenter(serviceCenter string) CardOrdersApiListCardOrdersInput { + r.serviceCenter = &serviceCenter + return r +} + +// Specifies the position of an element in a list of card orders. The response includes a list of card orders that starts at the specified offset. **Default:** 0, which means that the response contains all the elements in the list of card orders. +func (r CardOrdersApiListCardOrdersInput) Offset(offset int32) CardOrdersApiListCardOrdersInput { + r.offset = &offset + return r +} + +// The number of card orders returned per page. **Default:** 10. +func (r CardOrdersApiListCardOrdersInput) Limit(limit int32) CardOrdersApiListCardOrdersInput { + r.limit = &limit + return r +} + +/* +Prepare a request for ListCardOrders + +@return CardOrdersApiListCardOrdersInput +*/ +func (a *CardOrdersApi) ListCardOrdersInput() CardOrdersApiListCardOrdersInput { + return CardOrdersApiListCardOrdersInput{} +} + +/* +ListCardOrders Get a list of card orders + +Returns a paginated list of card orders. + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r CardOrdersApiListCardOrdersInput - Request parameters, see ListCardOrdersInput +@return PaginatedGetCardOrderResponse, *http.Response, error +*/ +func (a *CardOrdersApi) ListCardOrders(ctx context.Context, r CardOrdersApiListCardOrdersInput) (PaginatedGetCardOrderResponse, *http.Response, error) { + res := &PaginatedGetCardOrderResponse{} + path := "/cardorders" + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.id != nil { + common.ParameterAddToQuery(queryParams, "id", r.id, "") + } + if r.cardManufacturingProfileId != nil { + common.ParameterAddToQuery(queryParams, "cardManufacturingProfileId", r.cardManufacturingProfileId, "") + } + if r.status != nil { + common.ParameterAddToQuery(queryParams, "status", r.status, "") + } + if r.txVariantCode != nil { + common.ParameterAddToQuery(queryParams, "txVariantCode", r.txVariantCode, "") + } + if r.createdSince != nil { + common.ParameterAddToQuery(queryParams, "createdSince", r.createdSince, "") + } + if r.createdUntil != nil { + common.ParameterAddToQuery(queryParams, "createdUntil", r.createdUntil, "") + } + if r.lockedSince != nil { + common.ParameterAddToQuery(queryParams, "lockedSince", r.lockedSince, "") + } + if r.lockedUntil != nil { + common.ParameterAddToQuery(queryParams, "lockedUntil", r.lockedUntil, "") + } + if r.serviceCenter != nil { + common.ParameterAddToQuery(queryParams, "serviceCenter", r.serviceCenter, "") + } + if r.offset != nil { + common.ParameterAddToQuery(queryParams, "offset", r.offset, "") + } + if r.limit != nil { + common.ParameterAddToQuery(queryParams, "limit", r.limit, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} diff --git a/src/balanceplatform/api_pin_functionality.go b/src/balanceplatform/api_pin_functionality.go new file mode 100644 index 000000000..3d09fd643 --- /dev/null +++ b/src/balanceplatform/api_pin_functionality.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 ( + "context" + "encoding/json" + "io/ioutil" + "net/http" + "net/url" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// PINFunctionalityApi service +type PINFunctionalityApi common.Service + +// All parameters accepted by PINFunctionalityApi.ChangePin +type PINFunctionalityApiChangePinInput struct { + pinChangeRequest *PinChangeRequest +} + +func (r PINFunctionalityApiChangePinInput) PinChangeRequest(pinChangeRequest PinChangeRequest) PINFunctionalityApiChangePinInput { + r.pinChangeRequest = &pinChangeRequest + return r +} + +/* +Prepare a request for ChangePin + +@return PINFunctionalityApiChangePinInput +*/ +func (a *PINFunctionalityApi) ChangePinInput() PINFunctionalityApiChangePinInput { + return PINFunctionalityApiChangePinInput{} +} + +/* +ChangePin Change Pin + +Change Pin + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PINFunctionalityApiChangePinInput - Request parameters, see ChangePinInput +@return PinChangeResponse, *http.Response, error +*/ +func (a *PINFunctionalityApi) ChangePin(ctx context.Context, r PINFunctionalityApiChangePinInput) (PinChangeResponse, *http.Response, error) { + res := &PinChangeResponse{} + path := "/pins/change" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.pinChangeRequest, + res, + http.MethodPost, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + +// All parameters accepted by PINFunctionalityApi.GetRsaPublickey +type PINFunctionalityApiGetRsaPublickeyInput struct { + purpose *string + format *string +} + +// Purpose of publicKey. +func (r PINFunctionalityApiGetRsaPublickeyInput) Purpose(purpose string) PINFunctionalityApiGetRsaPublickeyInput { + r.purpose = &purpose + return r +} + +// Format of publicKey. +func (r PINFunctionalityApiGetRsaPublickeyInput) Format(format string) PINFunctionalityApiGetRsaPublickeyInput { + r.format = &format + return r +} + +/* +Prepare a request for GetRsaPublickey + +@return PINFunctionalityApiGetRsaPublickeyInput +*/ +func (a *PINFunctionalityApi) GetRsaPublickeyInput() PINFunctionalityApiGetRsaPublickeyInput { + return PINFunctionalityApiGetRsaPublickeyInput{} +} + +/* +GetRsaPublickey Get RSA publicKey + +Get RSA publicKey + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PINFunctionalityApiGetRsaPublickeyInput - Request parameters, see GetRsaPublickeyInput +@return PublicKeyResponse, *http.Response, error +*/ +func (a *PINFunctionalityApi) GetRsaPublickey(ctx context.Context, r PINFunctionalityApiGetRsaPublickeyInput) (PublicKeyResponse, *http.Response, error) { + res := &PublicKeyResponse{} + path := "/pins/publicKey" + queryParams := url.Values{} + headerParams := make(map[string]string) + if r.purpose != nil { + common.ParameterAddToQuery(queryParams, "purpose", r.purpose, "") + } + if r.format != nil { + common.ParameterAddToQuery(queryParams, "format", r.format, "") + } + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + nil, + res, + http.MethodGet, + a.BasePath()+path, + queryParams, + headerParams, + ) + + if httpRes == nil { + return *res, httpRes, err + } + + var serviceError common.RestServiceError + if httpRes.StatusCode == 401 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 403 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 422 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + if httpRes.StatusCode == 500 { + body, _ := ioutil.ReadAll(httpRes.Body) + decodeError := json.Unmarshal([]byte(body), &serviceError) + if decodeError != nil { + return *res, httpRes, decodeError + } + return *res, httpRes, serviceError + } + + return *res, httpRes, err +} + +// All parameters accepted by PINFunctionalityApi.RevealPin +type PINFunctionalityApiRevealPinInput struct { + revealPinRequest *RevealPinRequest +} + +func (r PINFunctionalityApiRevealPinInput) RevealPinRequest(revealPinRequest RevealPinRequest) PINFunctionalityApiRevealPinInput { + r.revealPinRequest = &revealPinRequest + return r +} + +/* +Prepare a request for RevealPin + +@return PINFunctionalityApiRevealPinInput +*/ +func (a *PINFunctionalityApi) RevealPinInput() PINFunctionalityApiRevealPinInput { + return PINFunctionalityApiRevealPinInput{} +} + +/* +RevealPin Reveal Pin + +Reveal Pin + +@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@param r PINFunctionalityApiRevealPinInput - Request parameters, see RevealPinInput +@return RevealPinResponse, *http.Response, error +*/ +func (a *PINFunctionalityApi) RevealPin(ctx context.Context, r PINFunctionalityApiRevealPinInput) (RevealPinResponse, *http.Response, error) { + res := &RevealPinResponse{} + path := "/pins/reveal" + queryParams := url.Values{} + headerParams := make(map[string]string) + httpRes, err := common.SendAPIRequest( + ctx, + a.Client, + r.revealPinRequest, + 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 f0d257f6c..494b2d291 100644 --- a/src/balanceplatform/client.go +++ b/src/balanceplatform/client.go @@ -9,7 +9,7 @@ API version: 2 package balanceplatform import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Configuration API API v2 @@ -25,12 +25,16 @@ type APIClient struct { BankAccountValidationApi *BankAccountValidationApi + CardOrdersApi *CardOrdersApi + GrantAccountsApi *GrantAccountsApi GrantOffersApi *GrantOffersApi NetworkTokensApi *NetworkTokensApi + PINFunctionalityApi *PINFunctionalityApi + PaymentInstrumentGroupsApi *PaymentInstrumentGroupsApi PaymentInstrumentsApi *PaymentInstrumentsApi @@ -45,18 +49,20 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.BalancePlatformEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.BalancePlatformEndpoint + } // API Services c.AccountHoldersApi = (*AccountHoldersApi)(&c.common) c.BalanceAccountsApi = (*BalanceAccountsApi)(&c.common) c.BankAccountValidationApi = (*BankAccountValidationApi)(&c.common) + c.CardOrdersApi = (*CardOrdersApi)(&c.common) c.GrantAccountsApi = (*GrantAccountsApi)(&c.common) c.GrantOffersApi = (*GrantOffersApi)(&c.common) c.NetworkTokensApi = (*NetworkTokensApi)(&c.common) + c.PINFunctionalityApi = (*PINFunctionalityApi)(&c.common) c.PaymentInstrumentGroupsApi = (*PaymentInstrumentGroupsApi)(&c.common) c.PaymentInstrumentsApi = (*PaymentInstrumentsApi)(&c.common) c.PlatformApi = (*PlatformApi)(&c.common) @@ -64,4 +70,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransferRoutesApi = (*TransferRoutesApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/balanceplatform/model_bank_account_model.go b/src/balanceplatform/model_bank_account_model.go new file mode 100644 index 000000000..99cab83f2 --- /dev/null +++ b/src/balanceplatform/model_bank_account_model.go @@ -0,0 +1,135 @@ +/* +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 BankAccountModel type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &BankAccountModel{} + +// BankAccountModel struct for BankAccountModel +type BankAccountModel struct { + // Form factor of the bank account - **virtual** or **physical** (default) + FormFactor *string `json:"formFactor,omitempty"` +} + +// NewBankAccountModel instantiates a new BankAccountModel 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 NewBankAccountModel() *BankAccountModel { + this := BankAccountModel{} + return &this +} + +// NewBankAccountModelWithDefaults instantiates a new BankAccountModel 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 NewBankAccountModelWithDefaults() *BankAccountModel { + this := BankAccountModel{} + return &this +} + +// GetFormFactor returns the FormFactor field value if set, zero value otherwise. +func (o *BankAccountModel) GetFormFactor() string { + if o == nil || common.IsNil(o.FormFactor) { + var ret string + return ret + } + return *o.FormFactor +} + +// GetFormFactorOk returns a tuple with the FormFactor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BankAccountModel) GetFormFactorOk() (*string, bool) { + if o == nil || common.IsNil(o.FormFactor) { + return nil, false + } + return o.FormFactor, true +} + +// HasFormFactor returns a boolean if a field has been set. +func (o *BankAccountModel) HasFormFactor() bool { + if o != nil && !common.IsNil(o.FormFactor) { + return true + } + + return false +} + +// SetFormFactor gets a reference to the given string and assigns it to the FormFactor field. +func (o *BankAccountModel) SetFormFactor(v string) { + o.FormFactor = &v +} + +func (o BankAccountModel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BankAccountModel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.FormFactor) { + toSerialize["formFactor"] = o.FormFactor + } + return toSerialize, nil +} + +type NullableBankAccountModel struct { + value *BankAccountModel + isSet bool +} + +func (v NullableBankAccountModel) Get() *BankAccountModel { + return v.value +} + +func (v *NullableBankAccountModel) Set(val *BankAccountModel) { + v.value = val + v.isSet = true +} + +func (v NullableBankAccountModel) IsSet() bool { + return v.isSet +} + +func (v *NullableBankAccountModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankAccountModel(val *BankAccountModel) *NullableBankAccountModel { + return &NullableBankAccountModel{value: val, isSet: true} +} + +func (v NullableBankAccountModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankAccountModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *BankAccountModel) isValidFormFactor() bool { + var allowedEnumValues = []string{"physical", "unknown", "virtual"} + for _, allowed := range allowedEnumValues { + if o.GetFormFactor() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_card_order.go b/src/balanceplatform/model_card_order.go new file mode 100644 index 000000000..6c790498c --- /dev/null +++ b/src/balanceplatform/model_card_order.go @@ -0,0 +1,395 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "time" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardOrder type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrder{} + +// CardOrder struct for CardOrder +type CardOrder struct { + // The date when the card order is created. + BeginDate *time.Time `json:"beginDate,omitempty"` + // The unique identifier of the card manufacturer profile. + CardManufacturingProfileId *string `json:"cardManufacturingProfileId,omitempty"` + // The date when the card order processing ends. + ClosedDate *time.Time `json:"closedDate,omitempty"` + // The date when you manually closed the card order. Card orders are automatically closed by the end of the day it was created. If you manually closed it beforehand, the closing date is shown as the `endDate`. + EndDate *time.Time `json:"endDate,omitempty"` + // The unique identifier of the card order. + Id *string `json:"id,omitempty"` + // The date when the card order processing begins. + LockDate *time.Time `json:"lockDate,omitempty"` + // The service center. + ServiceCenter *string `json:"serviceCenter,omitempty"` + // The status of the card order. Possible values: **Open**, **Closed**. + Status *string `json:"status,omitempty"` +} + +// NewCardOrder instantiates a new CardOrder 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 NewCardOrder() *CardOrder { + this := CardOrder{} + return &this +} + +// NewCardOrderWithDefaults instantiates a new CardOrder 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 NewCardOrderWithDefaults() *CardOrder { + this := CardOrder{} + return &this +} + +// GetBeginDate returns the BeginDate field value if set, zero value otherwise. +func (o *CardOrder) GetBeginDate() time.Time { + if o == nil || common.IsNil(o.BeginDate) { + var ret time.Time + return ret + } + return *o.BeginDate +} + +// GetBeginDateOk returns a tuple with the BeginDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetBeginDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.BeginDate) { + return nil, false + } + return o.BeginDate, true +} + +// HasBeginDate returns a boolean if a field has been set. +func (o *CardOrder) HasBeginDate() bool { + if o != nil && !common.IsNil(o.BeginDate) { + return true + } + + return false +} + +// SetBeginDate gets a reference to the given time.Time and assigns it to the BeginDate field. +func (o *CardOrder) SetBeginDate(v time.Time) { + o.BeginDate = &v +} + +// GetCardManufacturingProfileId returns the CardManufacturingProfileId field value if set, zero value otherwise. +func (o *CardOrder) GetCardManufacturingProfileId() string { + if o == nil || common.IsNil(o.CardManufacturingProfileId) { + var ret string + return ret + } + return *o.CardManufacturingProfileId +} + +// GetCardManufacturingProfileIdOk returns a tuple with the CardManufacturingProfileId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetCardManufacturingProfileIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CardManufacturingProfileId) { + return nil, false + } + return o.CardManufacturingProfileId, true +} + +// HasCardManufacturingProfileId returns a boolean if a field has been set. +func (o *CardOrder) HasCardManufacturingProfileId() bool { + if o != nil && !common.IsNil(o.CardManufacturingProfileId) { + return true + } + + return false +} + +// SetCardManufacturingProfileId gets a reference to the given string and assigns it to the CardManufacturingProfileId field. +func (o *CardOrder) SetCardManufacturingProfileId(v string) { + o.CardManufacturingProfileId = &v +} + +// GetClosedDate returns the ClosedDate field value if set, zero value otherwise. +func (o *CardOrder) GetClosedDate() time.Time { + if o == nil || common.IsNil(o.ClosedDate) { + var ret time.Time + return ret + } + return *o.ClosedDate +} + +// GetClosedDateOk returns a tuple with the ClosedDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetClosedDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.ClosedDate) { + return nil, false + } + return o.ClosedDate, true +} + +// HasClosedDate returns a boolean if a field has been set. +func (o *CardOrder) HasClosedDate() bool { + if o != nil && !common.IsNil(o.ClosedDate) { + return true + } + + return false +} + +// SetClosedDate gets a reference to the given time.Time and assigns it to the ClosedDate field. +func (o *CardOrder) SetClosedDate(v time.Time) { + o.ClosedDate = &v +} + +// GetEndDate returns the EndDate field value if set, zero value otherwise. +func (o *CardOrder) GetEndDate() time.Time { + if o == nil || common.IsNil(o.EndDate) { + var ret time.Time + return ret + } + return *o.EndDate +} + +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetEndDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.EndDate) { + return nil, false + } + return o.EndDate, true +} + +// HasEndDate returns a boolean if a field has been set. +func (o *CardOrder) HasEndDate() bool { + if o != nil && !common.IsNil(o.EndDate) { + return true + } + + return false +} + +// SetEndDate gets a reference to the given time.Time and assigns it to the EndDate field. +func (o *CardOrder) SetEndDate(v time.Time) { + o.EndDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CardOrder) 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 *CardOrder) 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 *CardOrder) 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 *CardOrder) SetId(v string) { + o.Id = &v +} + +// GetLockDate returns the LockDate field value if set, zero value otherwise. +func (o *CardOrder) GetLockDate() time.Time { + if o == nil || common.IsNil(o.LockDate) { + var ret time.Time + return ret + } + return *o.LockDate +} + +// GetLockDateOk returns a tuple with the LockDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetLockDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.LockDate) { + return nil, false + } + return o.LockDate, true +} + +// HasLockDate returns a boolean if a field has been set. +func (o *CardOrder) HasLockDate() bool { + if o != nil && !common.IsNil(o.LockDate) { + return true + } + + return false +} + +// SetLockDate gets a reference to the given time.Time and assigns it to the LockDate field. +func (o *CardOrder) SetLockDate(v time.Time) { + o.LockDate = &v +} + +// GetServiceCenter returns the ServiceCenter field value if set, zero value otherwise. +func (o *CardOrder) GetServiceCenter() string { + if o == nil || common.IsNil(o.ServiceCenter) { + var ret string + return ret + } + return *o.ServiceCenter +} + +// GetServiceCenterOk returns a tuple with the ServiceCenter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrder) GetServiceCenterOk() (*string, bool) { + if o == nil || common.IsNil(o.ServiceCenter) { + return nil, false + } + return o.ServiceCenter, true +} + +// HasServiceCenter returns a boolean if a field has been set. +func (o *CardOrder) HasServiceCenter() bool { + if o != nil && !common.IsNil(o.ServiceCenter) { + return true + } + + return false +} + +// SetServiceCenter gets a reference to the given string and assigns it to the ServiceCenter field. +func (o *CardOrder) SetServiceCenter(v string) { + o.ServiceCenter = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CardOrder) 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 *CardOrder) 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 *CardOrder) 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 *CardOrder) SetStatus(v string) { + o.Status = &v +} + +func (o CardOrder) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrder) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BeginDate) { + toSerialize["beginDate"] = o.BeginDate + } + if !common.IsNil(o.CardManufacturingProfileId) { + toSerialize["cardManufacturingProfileId"] = o.CardManufacturingProfileId + } + if !common.IsNil(o.ClosedDate) { + toSerialize["closedDate"] = o.ClosedDate + } + if !common.IsNil(o.EndDate) { + toSerialize["endDate"] = o.EndDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.LockDate) { + toSerialize["lockDate"] = o.LockDate + } + if !common.IsNil(o.ServiceCenter) { + toSerialize["serviceCenter"] = o.ServiceCenter + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableCardOrder struct { + value *CardOrder + isSet bool +} + +func (v NullableCardOrder) Get() *CardOrder { + return v.value +} + +func (v *NullableCardOrder) Set(val *CardOrder) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrder) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrder(val *CardOrder) *NullableCardOrder { + return &NullableCardOrder{value: val, isSet: true} +} + +func (v NullableCardOrder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *CardOrder) isValidStatus() bool { + var allowedEnumValues = []string{"closed", "open"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_card_order_item.go b/src/balanceplatform/model_card_order_item.go new file mode 100644 index 000000000..9a19fe02b --- /dev/null +++ b/src/balanceplatform/model_card_order_item.go @@ -0,0 +1,383 @@ +/* +Configuration API + +API version: 2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package balanceplatform + +import ( + "encoding/json" + "time" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the CardOrderItem type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrderItem{} + +// CardOrderItem struct for CardOrderItem +type CardOrderItem struct { + // The unique identifier of the balance platform. + BalancePlatform *string `json:"balancePlatform,omitempty"` + Card *CardOrderItemDeliveryStatus `json:"card,omitempty"` + // The unique identifier of the card order item. + CardOrderItemId *string `json:"cardOrderItemId,omitempty"` + // The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + CreationDate *time.Time `json:"creationDate,omitempty"` + // The ID of the resource. + Id *string `json:"id,omitempty"` + // The unique identifier of the payment instrument related to the card order item. + PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` + Pin *CardOrderItemDeliveryStatus `json:"pin,omitempty"` + // The shipping method used to deliver the card or the PIN. + ShippingMethod *string `json:"shippingMethod,omitempty"` +} + +// NewCardOrderItem instantiates a new CardOrderItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardOrderItem() *CardOrderItem { + this := CardOrderItem{} + return &this +} + +// NewCardOrderItemWithDefaults instantiates a new CardOrderItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardOrderItemWithDefaults() *CardOrderItem { + this := CardOrderItem{} + return &this +} + +// GetBalancePlatform returns the BalancePlatform field value if set, zero value otherwise. +func (o *CardOrderItem) GetBalancePlatform() string { + if o == nil || common.IsNil(o.BalancePlatform) { + var ret string + return ret + } + return *o.BalancePlatform +} + +// GetBalancePlatformOk returns a tuple with the BalancePlatform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetBalancePlatformOk() (*string, bool) { + if o == nil || common.IsNil(o.BalancePlatform) { + return nil, false + } + return o.BalancePlatform, true +} + +// HasBalancePlatform returns a boolean if a field has been set. +func (o *CardOrderItem) HasBalancePlatform() bool { + if o != nil && !common.IsNil(o.BalancePlatform) { + return true + } + + return false +} + +// SetBalancePlatform gets a reference to the given string and assigns it to the BalancePlatform field. +func (o *CardOrderItem) SetBalancePlatform(v string) { + o.BalancePlatform = &v +} + +// GetCard returns the Card field value if set, zero value otherwise. +func (o *CardOrderItem) GetCard() CardOrderItemDeliveryStatus { + if o == nil || common.IsNil(o.Card) { + var ret CardOrderItemDeliveryStatus + return ret + } + return *o.Card +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCardOk() (*CardOrderItemDeliveryStatus, bool) { + if o == nil || common.IsNil(o.Card) { + return nil, false + } + return o.Card, true +} + +// HasCard returns a boolean if a field has been set. +func (o *CardOrderItem) HasCard() bool { + if o != nil && !common.IsNil(o.Card) { + return true + } + + return false +} + +// SetCard gets a reference to the given CardOrderItemDeliveryStatus and assigns it to the Card field. +func (o *CardOrderItem) SetCard(v CardOrderItemDeliveryStatus) { + o.Card = &v +} + +// GetCardOrderItemId returns the CardOrderItemId field value if set, zero value otherwise. +func (o *CardOrderItem) GetCardOrderItemId() string { + if o == nil || common.IsNil(o.CardOrderItemId) { + var ret string + return ret + } + return *o.CardOrderItemId +} + +// GetCardOrderItemIdOk returns a tuple with the CardOrderItemId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCardOrderItemIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CardOrderItemId) { + return nil, false + } + return o.CardOrderItemId, true +} + +// HasCardOrderItemId returns a boolean if a field has been set. +func (o *CardOrderItem) HasCardOrderItemId() bool { + if o != nil && !common.IsNil(o.CardOrderItemId) { + return true + } + + return false +} + +// SetCardOrderItemId gets a reference to the given string and assigns it to the CardOrderItemId field. +func (o *CardOrderItem) SetCardOrderItemId(v string) { + o.CardOrderItemId = &v +} + +// GetCreationDate returns the CreationDate field value if set, zero value otherwise. +func (o *CardOrderItem) GetCreationDate() time.Time { + if o == nil || common.IsNil(o.CreationDate) { + var ret time.Time + return ret + } + return *o.CreationDate +} + +// GetCreationDateOk returns a tuple with the CreationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetCreationDateOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.CreationDate) { + return nil, false + } + return o.CreationDate, true +} + +// HasCreationDate returns a boolean if a field has been set. +func (o *CardOrderItem) HasCreationDate() bool { + if o != nil && !common.IsNil(o.CreationDate) { + return true + } + + return false +} + +// SetCreationDate gets a reference to the given time.Time and assigns it to the CreationDate field. +func (o *CardOrderItem) SetCreationDate(v time.Time) { + o.CreationDate = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CardOrderItem) GetId() string { + if o == nil || common.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetIdOk() (*string, bool) { + if o == nil || common.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CardOrderItem) HasId() bool { + if o != nil && !common.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CardOrderItem) SetId(v string) { + o.Id = &v +} + +// GetPaymentInstrumentId returns the PaymentInstrumentId field value if set, zero value otherwise. +func (o *CardOrderItem) GetPaymentInstrumentId() string { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + var ret string + return ret + } + return *o.PaymentInstrumentId +} + +// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetPaymentInstrumentIdOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrumentId) { + return nil, false + } + return o.PaymentInstrumentId, true +} + +// HasPaymentInstrumentId returns a boolean if a field has been set. +func (o *CardOrderItem) HasPaymentInstrumentId() bool { + if o != nil && !common.IsNil(o.PaymentInstrumentId) { + return true + } + + return false +} + +// SetPaymentInstrumentId gets a reference to the given string and assigns it to the PaymentInstrumentId field. +func (o *CardOrderItem) SetPaymentInstrumentId(v string) { + o.PaymentInstrumentId = &v +} + +// GetPin returns the Pin field value if set, zero value otherwise. +func (o *CardOrderItem) GetPin() CardOrderItemDeliveryStatus { + if o == nil || common.IsNil(o.Pin) { + var ret CardOrderItemDeliveryStatus + return ret + } + return *o.Pin +} + +// GetPinOk returns a tuple with the Pin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetPinOk() (*CardOrderItemDeliveryStatus, bool) { + if o == nil || common.IsNil(o.Pin) { + return nil, false + } + return o.Pin, true +} + +// HasPin returns a boolean if a field has been set. +func (o *CardOrderItem) HasPin() bool { + if o != nil && !common.IsNil(o.Pin) { + return true + } + + return false +} + +// SetPin gets a reference to the given CardOrderItemDeliveryStatus and assigns it to the Pin field. +func (o *CardOrderItem) SetPin(v CardOrderItemDeliveryStatus) { + o.Pin = &v +} + +// GetShippingMethod returns the ShippingMethod field value if set, zero value otherwise. +func (o *CardOrderItem) GetShippingMethod() string { + if o == nil || common.IsNil(o.ShippingMethod) { + var ret string + return ret + } + return *o.ShippingMethod +} + +// GetShippingMethodOk returns a tuple with the ShippingMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItem) GetShippingMethodOk() (*string, bool) { + if o == nil || common.IsNil(o.ShippingMethod) { + return nil, false + } + return o.ShippingMethod, true +} + +// HasShippingMethod returns a boolean if a field has been set. +func (o *CardOrderItem) HasShippingMethod() bool { + if o != nil && !common.IsNil(o.ShippingMethod) { + return true + } + + return false +} + +// SetShippingMethod gets a reference to the given string and assigns it to the ShippingMethod field. +func (o *CardOrderItem) SetShippingMethod(v string) { + o.ShippingMethod = &v +} + +func (o CardOrderItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrderItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.BalancePlatform) { + toSerialize["balancePlatform"] = o.BalancePlatform + } + if !common.IsNil(o.Card) { + toSerialize["card"] = o.Card + } + if !common.IsNil(o.CardOrderItemId) { + toSerialize["cardOrderItemId"] = o.CardOrderItemId + } + if !common.IsNil(o.CreationDate) { + toSerialize["creationDate"] = o.CreationDate + } + if !common.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !common.IsNil(o.PaymentInstrumentId) { + toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId + } + if !common.IsNil(o.Pin) { + toSerialize["pin"] = o.Pin + } + if !common.IsNil(o.ShippingMethod) { + toSerialize["shippingMethod"] = o.ShippingMethod + } + return toSerialize, nil +} + +type NullableCardOrderItem struct { + value *CardOrderItem + isSet bool +} + +func (v NullableCardOrderItem) Get() *CardOrderItem { + return v.value +} + +func (v *NullableCardOrderItem) Set(val *CardOrderItem) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrderItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrderItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrderItem(val *CardOrderItem) *NullableCardOrderItem { + return &NullableCardOrderItem{value: val, isSet: true} +} + +func (v NullableCardOrderItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrderItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_card_order_item_delivery_status.go b/src/balanceplatform/model_card_order_item_delivery_status.go new file mode 100644 index 000000000..ac114dc34 --- /dev/null +++ b/src/balanceplatform/model_card_order_item_delivery_status.go @@ -0,0 +1,209 @@ +/* +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 CardOrderItemDeliveryStatus type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &CardOrderItemDeliveryStatus{} + +// CardOrderItemDeliveryStatus struct for CardOrderItemDeliveryStatus +type CardOrderItemDeliveryStatus struct { + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // The status of the PIN delivery. + Status *string `json:"status,omitempty"` + // The tracking number of the PIN delivery. + TrackingNumber *string `json:"trackingNumber,omitempty"` +} + +// NewCardOrderItemDeliveryStatus instantiates a new CardOrderItemDeliveryStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardOrderItemDeliveryStatus() *CardOrderItemDeliveryStatus { + this := CardOrderItemDeliveryStatus{} + return &this +} + +// NewCardOrderItemDeliveryStatusWithDefaults instantiates a new CardOrderItemDeliveryStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardOrderItemDeliveryStatusWithDefaults() *CardOrderItemDeliveryStatus { + this := CardOrderItemDeliveryStatus{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetErrorMessage() string { + if o == nil || common.IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetErrorMessageOk() (*string, bool) { + if o == nil || common.IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasErrorMessage() bool { + if o != nil && !common.IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *CardOrderItemDeliveryStatus) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetStatus() string { + if o == nil || common.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetStatusOk() (*string, bool) { + if o == nil || common.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasStatus() bool { + if o != nil && !common.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CardOrderItemDeliveryStatus) SetStatus(v string) { + o.Status = &v +} + +// GetTrackingNumber returns the TrackingNumber field value if set, zero value otherwise. +func (o *CardOrderItemDeliveryStatus) GetTrackingNumber() string { + if o == nil || common.IsNil(o.TrackingNumber) { + var ret string + return ret + } + return *o.TrackingNumber +} + +// GetTrackingNumberOk returns a tuple with the TrackingNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardOrderItemDeliveryStatus) GetTrackingNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TrackingNumber) { + return nil, false + } + return o.TrackingNumber, true +} + +// HasTrackingNumber returns a boolean if a field has been set. +func (o *CardOrderItemDeliveryStatus) HasTrackingNumber() bool { + if o != nil && !common.IsNil(o.TrackingNumber) { + return true + } + + return false +} + +// SetTrackingNumber gets a reference to the given string and assigns it to the TrackingNumber field. +func (o *CardOrderItemDeliveryStatus) SetTrackingNumber(v string) { + o.TrackingNumber = &v +} + +func (o CardOrderItemDeliveryStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardOrderItemDeliveryStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !common.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !common.IsNil(o.TrackingNumber) { + toSerialize["trackingNumber"] = o.TrackingNumber + } + return toSerialize, nil +} + +type NullableCardOrderItemDeliveryStatus struct { + value *CardOrderItemDeliveryStatus + isSet bool +} + +func (v NullableCardOrderItemDeliveryStatus) Get() *CardOrderItemDeliveryStatus { + return v.value +} + +func (v *NullableCardOrderItemDeliveryStatus) Set(val *CardOrderItemDeliveryStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCardOrderItemDeliveryStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCardOrderItemDeliveryStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardOrderItemDeliveryStatus(val *CardOrderItemDeliveryStatus) *NullableCardOrderItemDeliveryStatus { + return &NullableCardOrderItemDeliveryStatus{value: val, isSet: true} +} + +func (v NullableCardOrderItemDeliveryStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardOrderItemDeliveryStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *CardOrderItemDeliveryStatus) isValidStatus() bool { + var allowedEnumValues = []string{"created", "delivered", "notApplicable", "processing", "produced", "rejected", "shipped", "unknown"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_grant_offer.go b/src/balanceplatform/model_grant_offer.go index 6b6540534..f641ea59a 100644 --- a/src/balanceplatform/model_grant_offer.go +++ b/src/balanceplatform/model_grant_offer.go @@ -10,6 +10,7 @@ package balanceplatform import ( "encoding/json" + "time" "github.com/adyen/adyen-go-api-library/v8/src/common" ) @@ -23,13 +24,15 @@ type GrantOffer struct { AccountHolderId string `json:"accountHolderId"` Amount *Amount `json:"amount,omitempty"` // The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. - ContractType *string `json:"contractType,omitempty"` - ExpiresAt map[string]interface{} `json:"expiresAt,omitempty"` - Fee *Fee `json:"fee,omitempty"` + ContractType *string `json:"contractType,omitempty"` + // The end date of the grant offer validity period. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + Fee *Fee `json:"fee,omitempty"` // The unique identifier of the grant offer. - Id *string `json:"id,omitempty"` - Repayment *Repayment `json:"repayment,omitempty"` - StartsAt map[string]interface{} `json:"startsAt,omitempty"` + Id *string `json:"id,omitempty"` + Repayment *Repayment `json:"repayment,omitempty"` + // The starting date of the grant offer validity period. + StartsAt *time.Time `json:"startsAt,omitempty"` } // NewGrantOffer instantiates a new GrantOffer object @@ -139,19 +142,19 @@ func (o *GrantOffer) SetContractType(v string) { } // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *GrantOffer) GetExpiresAt() map[string]interface{} { +func (o *GrantOffer) GetExpiresAt() time.Time { if o == nil || common.IsNil(o.ExpiresAt) { - var ret map[string]interface{} + var ret time.Time return ret } - return o.ExpiresAt + return *o.ExpiresAt } // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GrantOffer) GetExpiresAtOk() (map[string]interface{}, bool) { +func (o *GrantOffer) GetExpiresAtOk() (*time.Time, bool) { if o == nil || common.IsNil(o.ExpiresAt) { - return map[string]interface{}{}, false + return nil, false } return o.ExpiresAt, true } @@ -165,9 +168,9 @@ func (o *GrantOffer) HasExpiresAt() bool { return false } -// SetExpiresAt gets a reference to the given map[string]interface{} and assigns it to the ExpiresAt field. -func (o *GrantOffer) SetExpiresAt(v map[string]interface{}) { - o.ExpiresAt = v +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *GrantOffer) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v } // GetFee returns the Fee field value if set, zero value otherwise. @@ -267,19 +270,19 @@ func (o *GrantOffer) SetRepayment(v Repayment) { } // GetStartsAt returns the StartsAt field value if set, zero value otherwise. -func (o *GrantOffer) GetStartsAt() map[string]interface{} { +func (o *GrantOffer) GetStartsAt() time.Time { if o == nil || common.IsNil(o.StartsAt) { - var ret map[string]interface{} + var ret time.Time return ret } - return o.StartsAt + return *o.StartsAt } // GetStartsAtOk returns a tuple with the StartsAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GrantOffer) GetStartsAtOk() (map[string]interface{}, bool) { +func (o *GrantOffer) GetStartsAtOk() (*time.Time, bool) { if o == nil || common.IsNil(o.StartsAt) { - return map[string]interface{}{}, false + return nil, false } return o.StartsAt, true } @@ -293,9 +296,9 @@ func (o *GrantOffer) HasStartsAt() bool { return false } -// SetStartsAt gets a reference to the given map[string]interface{} and assigns it to the StartsAt field. -func (o *GrantOffer) SetStartsAt(v map[string]interface{}) { - o.StartsAt = v +// SetStartsAt gets a reference to the given time.Time and assigns it to the StartsAt field. +func (o *GrantOffer) SetStartsAt(v time.Time) { + o.StartsAt = &v } func (o GrantOffer) MarshalJSON() ([]byte, error) { diff --git a/src/balanceplatform/model_paginated_get_card_order_item_response.go b/src/balanceplatform/model_paginated_get_card_order_item_response.go new file mode 100644 index 000000000..dfe281c8a --- /dev/null +++ b/src/balanceplatform/model_paginated_get_card_order_item_response.go @@ -0,0 +1,172 @@ +/* +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 PaginatedGetCardOrderItemResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaginatedGetCardOrderItemResponse{} + +// PaginatedGetCardOrderItemResponse struct for PaginatedGetCardOrderItemResponse +type PaginatedGetCardOrderItemResponse struct { + // List of card order items in the card order batch. + Data []CardOrderItem `json:"data"` + // Indicates whether there are more items on the next page. + HasNext bool `json:"hasNext"` + // Indicates whether there are more items on the previous page. + HasPrevious bool `json:"hasPrevious"` +} + +// NewPaginatedGetCardOrderItemResponse instantiates a new PaginatedGetCardOrderItemResponse 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 NewPaginatedGetCardOrderItemResponse(data []CardOrderItem, hasNext bool, hasPrevious bool) *PaginatedGetCardOrderItemResponse { + this := PaginatedGetCardOrderItemResponse{} + this.Data = data + this.HasNext = hasNext + this.HasPrevious = hasPrevious + return &this +} + +// NewPaginatedGetCardOrderItemResponseWithDefaults instantiates a new PaginatedGetCardOrderItemResponse 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 NewPaginatedGetCardOrderItemResponseWithDefaults() *PaginatedGetCardOrderItemResponse { + this := PaginatedGetCardOrderItemResponse{} + return &this +} + +// GetData returns the Data field value +func (o *PaginatedGetCardOrderItemResponse) GetData() []CardOrderItem { + if o == nil { + var ret []CardOrderItem + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderItemResponse) GetDataOk() ([]CardOrderItem, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *PaginatedGetCardOrderItemResponse) SetData(v []CardOrderItem) { + o.Data = v +} + +// GetHasNext returns the HasNext field value +func (o *PaginatedGetCardOrderItemResponse) GetHasNext() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasNext +} + +// GetHasNextOk returns a tuple with the HasNext field value +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderItemResponse) GetHasNextOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasNext, true +} + +// SetHasNext sets field value +func (o *PaginatedGetCardOrderItemResponse) SetHasNext(v bool) { + o.HasNext = v +} + +// GetHasPrevious returns the HasPrevious field value +func (o *PaginatedGetCardOrderItemResponse) GetHasPrevious() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasPrevious +} + +// GetHasPreviousOk returns a tuple with the HasPrevious field value +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderItemResponse) GetHasPreviousOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasPrevious, true +} + +// SetHasPrevious sets field value +func (o *PaginatedGetCardOrderItemResponse) SetHasPrevious(v bool) { + o.HasPrevious = v +} + +func (o PaginatedGetCardOrderItemResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGetCardOrderItemResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["hasNext"] = o.HasNext + toSerialize["hasPrevious"] = o.HasPrevious + return toSerialize, nil +} + +type NullablePaginatedGetCardOrderItemResponse struct { + value *PaginatedGetCardOrderItemResponse + isSet bool +} + +func (v NullablePaginatedGetCardOrderItemResponse) Get() *PaginatedGetCardOrderItemResponse { + return v.value +} + +func (v *NullablePaginatedGetCardOrderItemResponse) Set(val *PaginatedGetCardOrderItemResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGetCardOrderItemResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGetCardOrderItemResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGetCardOrderItemResponse(val *PaginatedGetCardOrderItemResponse) *NullablePaginatedGetCardOrderItemResponse { + return &NullablePaginatedGetCardOrderItemResponse{value: val, isSet: true} +} + +func (v NullablePaginatedGetCardOrderItemResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGetCardOrderItemResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_paginated_get_card_order_response.go b/src/balanceplatform/model_paginated_get_card_order_response.go new file mode 100644 index 000000000..94922d293 --- /dev/null +++ b/src/balanceplatform/model_paginated_get_card_order_response.go @@ -0,0 +1,181 @@ +/* +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 PaginatedGetCardOrderResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PaginatedGetCardOrderResponse{} + +// PaginatedGetCardOrderResponse struct for PaginatedGetCardOrderResponse +type PaginatedGetCardOrderResponse struct { + // Contains objects with information about card orders. + CardOrders []CardOrder `json:"cardOrders,omitempty"` + // Indicates whether there are more items on the next page. + HasNext bool `json:"hasNext"` + // Indicates whether there are more items on the previous page. + HasPrevious bool `json:"hasPrevious"` +} + +// NewPaginatedGetCardOrderResponse instantiates a new PaginatedGetCardOrderResponse 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 NewPaginatedGetCardOrderResponse(hasNext bool, hasPrevious bool) *PaginatedGetCardOrderResponse { + this := PaginatedGetCardOrderResponse{} + this.HasNext = hasNext + this.HasPrevious = hasPrevious + return &this +} + +// NewPaginatedGetCardOrderResponseWithDefaults instantiates a new PaginatedGetCardOrderResponse 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 NewPaginatedGetCardOrderResponseWithDefaults() *PaginatedGetCardOrderResponse { + this := PaginatedGetCardOrderResponse{} + return &this +} + +// GetCardOrders returns the CardOrders field value if set, zero value otherwise. +func (o *PaginatedGetCardOrderResponse) GetCardOrders() []CardOrder { + if o == nil || common.IsNil(o.CardOrders) { + var ret []CardOrder + return ret + } + return o.CardOrders +} + +// GetCardOrdersOk returns a tuple with the CardOrders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderResponse) GetCardOrdersOk() ([]CardOrder, bool) { + if o == nil || common.IsNil(o.CardOrders) { + return nil, false + } + return o.CardOrders, true +} + +// HasCardOrders returns a boolean if a field has been set. +func (o *PaginatedGetCardOrderResponse) HasCardOrders() bool { + if o != nil && !common.IsNil(o.CardOrders) { + return true + } + + return false +} + +// SetCardOrders gets a reference to the given []CardOrder and assigns it to the CardOrders field. +func (o *PaginatedGetCardOrderResponse) SetCardOrders(v []CardOrder) { + o.CardOrders = v +} + +// GetHasNext returns the HasNext field value +func (o *PaginatedGetCardOrderResponse) GetHasNext() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasNext +} + +// GetHasNextOk returns a tuple with the HasNext field value +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderResponse) GetHasNextOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasNext, true +} + +// SetHasNext sets field value +func (o *PaginatedGetCardOrderResponse) SetHasNext(v bool) { + o.HasNext = v +} + +// GetHasPrevious returns the HasPrevious field value +func (o *PaginatedGetCardOrderResponse) GetHasPrevious() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasPrevious +} + +// GetHasPreviousOk returns a tuple with the HasPrevious field value +// and a boolean to check if the value has been set. +func (o *PaginatedGetCardOrderResponse) GetHasPreviousOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasPrevious, true +} + +// SetHasPrevious sets field value +func (o *PaginatedGetCardOrderResponse) SetHasPrevious(v bool) { + o.HasPrevious = v +} + +func (o PaginatedGetCardOrderResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGetCardOrderResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.CardOrders) { + toSerialize["cardOrders"] = o.CardOrders + } + toSerialize["hasNext"] = o.HasNext + toSerialize["hasPrevious"] = o.HasPrevious + return toSerialize, nil +} + +type NullablePaginatedGetCardOrderResponse struct { + value *PaginatedGetCardOrderResponse + isSet bool +} + +func (v NullablePaginatedGetCardOrderResponse) Get() *PaginatedGetCardOrderResponse { + return v.value +} + +func (v *NullablePaginatedGetCardOrderResponse) Set(val *PaginatedGetCardOrderResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGetCardOrderResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGetCardOrderResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGetCardOrderResponse(val *PaginatedGetCardOrderResponse) *NullablePaginatedGetCardOrderResponse { + return &NullablePaginatedGetCardOrderResponse{value: val, isSet: true} +} + +func (v NullablePaginatedGetCardOrderResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGetCardOrderResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_payment_instrument_info.go b/src/balanceplatform/model_payment_instrument_info.go index fad111e09..8d00cf82e 100644 --- a/src/balanceplatform/model_payment_instrument_info.go +++ b/src/balanceplatform/model_payment_instrument_info.go @@ -20,8 +20,9 @@ var _ common.MappedNullable = &PaymentInstrumentInfo{} // PaymentInstrumentInfo struct for PaymentInstrumentInfo type PaymentInstrumentInfo struct { // The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. - BalanceAccountId string `json:"balanceAccountId"` - Card *CardInfo `json:"card,omitempty"` + BalanceAccountId string `json:"balanceAccountId"` + BankAccount *BankAccountModel `json:"bankAccount,omitempty"` + Card *CardInfo `json:"card,omitempty"` // Your description for the payment instrument, maximum 300 characters. Description *string `json:"description,omitempty"` // The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. @@ -82,6 +83,38 @@ func (o *PaymentInstrumentInfo) SetBalanceAccountId(v string) { o.BalanceAccountId = v } +// GetBankAccount returns the BankAccount field value if set, zero value otherwise. +func (o *PaymentInstrumentInfo) GetBankAccount() BankAccountModel { + if o == nil || common.IsNil(o.BankAccount) { + var ret BankAccountModel + 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 *PaymentInstrumentInfo) GetBankAccountOk() (*BankAccountModel, 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 *PaymentInstrumentInfo) HasBankAccount() bool { + if o != nil && !common.IsNil(o.BankAccount) { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given BankAccountModel and assigns it to the BankAccount field. +func (o *PaymentInstrumentInfo) SetBankAccount(v BankAccountModel) { + o.BankAccount = &v +} + // GetCard returns the Card field value if set, zero value otherwise. func (o *PaymentInstrumentInfo) GetCard() CardInfo { if o == nil || common.IsNil(o.Card) { @@ -333,6 +366,9 @@ func (o PaymentInstrumentInfo) MarshalJSON() ([]byte, error) { func (o PaymentInstrumentInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["balanceAccountId"] = o.BalanceAccountId + if !common.IsNil(o.BankAccount) { + toSerialize["bankAccount"] = o.BankAccount + } if !common.IsNil(o.Card) { toSerialize["card"] = o.Card } diff --git a/src/balanceplatform/model_pin_change_request.go b/src/balanceplatform/model_pin_change_request.go new file mode 100644 index 000000000..5c109494c --- /dev/null +++ b/src/balanceplatform/model_pin_change_request.go @@ -0,0 +1,200 @@ +/* +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 PinChangeRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PinChangeRequest{} + +// PinChangeRequest struct for PinChangeRequest +type PinChangeRequest struct { + // Symmetric session key encrypted under the public key. + EncryptedKey string `json:"encryptedKey"` + // The encrypted PIN block + EncryptedPinBlock string `json:"encryptedPinBlock"` + // The unique identifier of the payment instrument. + PaymentInstrumentId string `json:"paymentInstrumentId"` + // The token which is used to construct the pinblock. + Token string `json:"token"` +} + +// NewPinChangeRequest instantiates a new PinChangeRequest 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 NewPinChangeRequest(encryptedKey string, encryptedPinBlock string, paymentInstrumentId string, token string) *PinChangeRequest { + this := PinChangeRequest{} + this.EncryptedKey = encryptedKey + this.EncryptedPinBlock = encryptedPinBlock + this.PaymentInstrumentId = paymentInstrumentId + this.Token = token + return &this +} + +// NewPinChangeRequestWithDefaults instantiates a new PinChangeRequest 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 NewPinChangeRequestWithDefaults() *PinChangeRequest { + this := PinChangeRequest{} + return &this +} + +// GetEncryptedKey returns the EncryptedKey field value +func (o *PinChangeRequest) GetEncryptedKey() string { + if o == nil { + var ret string + return ret + } + + return o.EncryptedKey +} + +// GetEncryptedKeyOk returns a tuple with the EncryptedKey field value +// and a boolean to check if the value has been set. +func (o *PinChangeRequest) GetEncryptedKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncryptedKey, true +} + +// SetEncryptedKey sets field value +func (o *PinChangeRequest) SetEncryptedKey(v string) { + o.EncryptedKey = v +} + +// GetEncryptedPinBlock returns the EncryptedPinBlock field value +func (o *PinChangeRequest) GetEncryptedPinBlock() string { + if o == nil { + var ret string + return ret + } + + return o.EncryptedPinBlock +} + +// GetEncryptedPinBlockOk returns a tuple with the EncryptedPinBlock field value +// and a boolean to check if the value has been set. +func (o *PinChangeRequest) GetEncryptedPinBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncryptedPinBlock, true +} + +// SetEncryptedPinBlock sets field value +func (o *PinChangeRequest) SetEncryptedPinBlock(v string) { + o.EncryptedPinBlock = v +} + +// GetPaymentInstrumentId returns the PaymentInstrumentId field value +func (o *PinChangeRequest) GetPaymentInstrumentId() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentInstrumentId +} + +// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value +// and a boolean to check if the value has been set. +func (o *PinChangeRequest) GetPaymentInstrumentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentInstrumentId, true +} + +// SetPaymentInstrumentId sets field value +func (o *PinChangeRequest) SetPaymentInstrumentId(v string) { + o.PaymentInstrumentId = v +} + +// GetToken returns the Token field value +func (o *PinChangeRequest) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *PinChangeRequest) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *PinChangeRequest) SetToken(v string) { + o.Token = v +} + +func (o PinChangeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PinChangeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encryptedKey"] = o.EncryptedKey + toSerialize["encryptedPinBlock"] = o.EncryptedPinBlock + toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullablePinChangeRequest struct { + value *PinChangeRequest + isSet bool +} + +func (v NullablePinChangeRequest) Get() *PinChangeRequest { + return v.value +} + +func (v *NullablePinChangeRequest) Set(val *PinChangeRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePinChangeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePinChangeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePinChangeRequest(val *PinChangeRequest) *NullablePinChangeRequest { + return &NullablePinChangeRequest{value: val, isSet: true} +} + +func (v NullablePinChangeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePinChangeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_pin_change_response.go b/src/balanceplatform/model_pin_change_response.go new file mode 100644 index 000000000..bbb6375fc --- /dev/null +++ b/src/balanceplatform/model_pin_change_response.go @@ -0,0 +1,126 @@ +/* +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 PinChangeResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PinChangeResponse{} + +// PinChangeResponse struct for PinChangeResponse +type PinChangeResponse struct { + // The pin change status. + Status string `json:"status"` +} + +// NewPinChangeResponse instantiates a new PinChangeResponse 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 NewPinChangeResponse(status string) *PinChangeResponse { + this := PinChangeResponse{} + this.Status = status + return &this +} + +// NewPinChangeResponseWithDefaults instantiates a new PinChangeResponse 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 NewPinChangeResponseWithDefaults() *PinChangeResponse { + this := PinChangeResponse{} + return &this +} + +// GetStatus returns the Status field value +func (o *PinChangeResponse) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *PinChangeResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *PinChangeResponse) SetStatus(v string) { + o.Status = v +} + +func (o PinChangeResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PinChangeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + return toSerialize, nil +} + +type NullablePinChangeResponse struct { + value *PinChangeResponse + isSet bool +} + +func (v NullablePinChangeResponse) Get() *PinChangeResponse { + return v.value +} + +func (v *NullablePinChangeResponse) Set(val *PinChangeResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePinChangeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePinChangeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePinChangeResponse(val *PinChangeResponse) *NullablePinChangeResponse { + return &NullablePinChangeResponse{value: val, isSet: true} +} + +func (v NullablePinChangeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePinChangeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *PinChangeResponse) isValidStatus() bool { + var allowedEnumValues = []string{"completed", "pending", "unavailable"} + for _, allowed := range allowedEnumValues { + if o.GetStatus() == allowed { + return true + } + } + return false +} diff --git a/src/balanceplatform/model_public_key_response.go b/src/balanceplatform/model_public_key_response.go new file mode 100644 index 000000000..123456fb0 --- /dev/null +++ b/src/balanceplatform/model_public_key_response.go @@ -0,0 +1,144 @@ +/* +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 PublicKeyResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &PublicKeyResponse{} + +// PublicKeyResponse struct for PublicKeyResponse +type PublicKeyResponse struct { + // The public key to be used for encrypting the symmetric session key. + PublicKey string `json:"publicKey"` + // The expiry date of the public key. + PublicKeyExpiryDate string `json:"publicKeyExpiryDate"` +} + +// NewPublicKeyResponse instantiates a new PublicKeyResponse 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 NewPublicKeyResponse(publicKey string, publicKeyExpiryDate string) *PublicKeyResponse { + this := PublicKeyResponse{} + this.PublicKey = publicKey + this.PublicKeyExpiryDate = publicKeyExpiryDate + return &this +} + +// NewPublicKeyResponseWithDefaults instantiates a new PublicKeyResponse 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 NewPublicKeyResponseWithDefaults() *PublicKeyResponse { + this := PublicKeyResponse{} + return &this +} + +// GetPublicKey returns the PublicKey field value +func (o *PublicKeyResponse) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *PublicKeyResponse) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *PublicKeyResponse) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetPublicKeyExpiryDate returns the PublicKeyExpiryDate field value +func (o *PublicKeyResponse) GetPublicKeyExpiryDate() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKeyExpiryDate +} + +// GetPublicKeyExpiryDateOk returns a tuple with the PublicKeyExpiryDate field value +// and a boolean to check if the value has been set. +func (o *PublicKeyResponse) GetPublicKeyExpiryDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKeyExpiryDate, true +} + +// SetPublicKeyExpiryDate sets field value +func (o *PublicKeyResponse) SetPublicKeyExpiryDate(v string) { + o.PublicKeyExpiryDate = v +} + +func (o PublicKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["publicKey"] = o.PublicKey + toSerialize["publicKeyExpiryDate"] = o.PublicKeyExpiryDate + return toSerialize, nil +} + +type NullablePublicKeyResponse struct { + value *PublicKeyResponse + isSet bool +} + +func (v NullablePublicKeyResponse) Get() *PublicKeyResponse { + return v.value +} + +func (v *NullablePublicKeyResponse) Set(val *PublicKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicKeyResponse(val *PublicKeyResponse) *NullablePublicKeyResponse { + return &NullablePublicKeyResponse{value: val, isSet: true} +} + +func (v NullablePublicKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_reveal_pin_request.go b/src/balanceplatform/model_reveal_pin_request.go new file mode 100644 index 000000000..4b4f324dc --- /dev/null +++ b/src/balanceplatform/model_reveal_pin_request.go @@ -0,0 +1,144 @@ +/* +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 RevealPinRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &RevealPinRequest{} + +// RevealPinRequest struct for RevealPinRequest +type RevealPinRequest struct { + // Symmetric session key encrypted under the public key. + EncryptedKey string `json:"encryptedKey"` + // The unique identifier of the payment instrument. + PaymentInstrumentId string `json:"paymentInstrumentId"` +} + +// NewRevealPinRequest instantiates a new RevealPinRequest 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 NewRevealPinRequest(encryptedKey string, paymentInstrumentId string) *RevealPinRequest { + this := RevealPinRequest{} + this.EncryptedKey = encryptedKey + this.PaymentInstrumentId = paymentInstrumentId + return &this +} + +// NewRevealPinRequestWithDefaults instantiates a new RevealPinRequest 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 NewRevealPinRequestWithDefaults() *RevealPinRequest { + this := RevealPinRequest{} + return &this +} + +// GetEncryptedKey returns the EncryptedKey field value +func (o *RevealPinRequest) GetEncryptedKey() string { + if o == nil { + var ret string + return ret + } + + return o.EncryptedKey +} + +// GetEncryptedKeyOk returns a tuple with the EncryptedKey field value +// and a boolean to check if the value has been set. +func (o *RevealPinRequest) GetEncryptedKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncryptedKey, true +} + +// SetEncryptedKey sets field value +func (o *RevealPinRequest) SetEncryptedKey(v string) { + o.EncryptedKey = v +} + +// GetPaymentInstrumentId returns the PaymentInstrumentId field value +func (o *RevealPinRequest) GetPaymentInstrumentId() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentInstrumentId +} + +// GetPaymentInstrumentIdOk returns a tuple with the PaymentInstrumentId field value +// and a boolean to check if the value has been set. +func (o *RevealPinRequest) GetPaymentInstrumentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentInstrumentId, true +} + +// SetPaymentInstrumentId sets field value +func (o *RevealPinRequest) SetPaymentInstrumentId(v string) { + o.PaymentInstrumentId = v +} + +func (o RevealPinRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RevealPinRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encryptedKey"] = o.EncryptedKey + toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId + return toSerialize, nil +} + +type NullableRevealPinRequest struct { + value *RevealPinRequest + isSet bool +} + +func (v NullableRevealPinRequest) Get() *RevealPinRequest { + return v.value +} + +func (v *NullableRevealPinRequest) Set(val *RevealPinRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRevealPinRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRevealPinRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRevealPinRequest(val *RevealPinRequest) *NullableRevealPinRequest { + return &NullableRevealPinRequest{value: val, isSet: true} +} + +func (v NullableRevealPinRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRevealPinRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/balanceplatform/model_reveal_pin_response.go b/src/balanceplatform/model_reveal_pin_response.go new file mode 100644 index 000000000..03f8639c6 --- /dev/null +++ b/src/balanceplatform/model_reveal_pin_response.go @@ -0,0 +1,144 @@ +/* +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 RevealPinResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &RevealPinResponse{} + +// RevealPinResponse struct for RevealPinResponse +type RevealPinResponse struct { + // The encrypted PIN block. + EncryptedPinBlock string `json:"encryptedPinBlock"` + // The encrypted PIN block extraction token. + Token string `json:"token"` +} + +// NewRevealPinResponse instantiates a new RevealPinResponse 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 NewRevealPinResponse(encryptedPinBlock string, token string) *RevealPinResponse { + this := RevealPinResponse{} + this.EncryptedPinBlock = encryptedPinBlock + this.Token = token + return &this +} + +// NewRevealPinResponseWithDefaults instantiates a new RevealPinResponse 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 NewRevealPinResponseWithDefaults() *RevealPinResponse { + this := RevealPinResponse{} + return &this +} + +// GetEncryptedPinBlock returns the EncryptedPinBlock field value +func (o *RevealPinResponse) GetEncryptedPinBlock() string { + if o == nil { + var ret string + return ret + } + + return o.EncryptedPinBlock +} + +// GetEncryptedPinBlockOk returns a tuple with the EncryptedPinBlock field value +// and a boolean to check if the value has been set. +func (o *RevealPinResponse) GetEncryptedPinBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncryptedPinBlock, true +} + +// SetEncryptedPinBlock sets field value +func (o *RevealPinResponse) SetEncryptedPinBlock(v string) { + o.EncryptedPinBlock = v +} + +// GetToken returns the Token field value +func (o *RevealPinResponse) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *RevealPinResponse) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *RevealPinResponse) SetToken(v string) { + o.Token = v +} + +func (o RevealPinResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RevealPinResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encryptedPinBlock"] = o.EncryptedPinBlock + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableRevealPinResponse struct { + value *RevealPinResponse + isSet bool +} + +func (v NullableRevealPinResponse) Get() *RevealPinResponse { + return v.value +} + +func (v *NullableRevealPinResponse) Set(val *RevealPinResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRevealPinResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRevealPinResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRevealPinResponse(val *RevealPinResponse) *NullableRevealPinResponse { + return &NullableRevealPinResponse{value: val, isSet: true} +} + +func (v NullableRevealPinResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRevealPinResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/checkout/client.go b/src/checkout/client.go index 3552f5796..9881a6440 100644 --- a/src/checkout/client.go +++ b/src/checkout/client.go @@ -9,7 +9,7 @@ API version: 71 package checkout import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Checkout API API v71 @@ -39,10 +39,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.CheckoutEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.CheckoutEndpoint + } // API Services c.ClassicCheckoutSDKApi = (*ClassicCheckoutSDKApi)(&c.common) @@ -55,4 +55,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.UtilityApi = (*UtilityApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/configurationwebhook/model_card_order_item.go b/src/configurationwebhook/model_card_order_item.go index 648e458f6..9d7d25192 100644 --- a/src/configurationwebhook/model_card_order_item.go +++ b/src/configurationwebhook/model_card_order_item.go @@ -32,7 +32,7 @@ type CardOrderItem struct { // The unique identifier of the payment instrument related to the card order item. PaymentInstrumentId *string `json:"paymentInstrumentId,omitempty"` Pin *CardOrderItemDeliveryStatus `json:"pin,omitempty"` - // Shipping method used to deliver the card or the PIN. + // The shipping method used to deliver the card or the PIN. ShippingMethod *string `json:"shippingMethod,omitempty"` } diff --git a/src/configurationwebhook/model_card_order_item_delivery_status.go b/src/configurationwebhook/model_card_order_item_delivery_status.go index 35121c7cb..b6724bf37 100644 --- a/src/configurationwebhook/model_card_order_item_delivery_status.go +++ b/src/configurationwebhook/model_card_order_item_delivery_status.go @@ -19,11 +19,11 @@ var _ common.MappedNullable = &CardOrderItemDeliveryStatus{} // CardOrderItemDeliveryStatus struct for CardOrderItemDeliveryStatus type CardOrderItemDeliveryStatus struct { - // Error message. + // An error message. ErrorMessage *string `json:"errorMessage,omitempty"` - // Status of the delivery. + // The status of the PIN delivery. Status *string `json:"status,omitempty"` - // Tracking number of the delivery. + // The tracking number of the PIN delivery. TrackingNumber *string `json:"trackingNumber,omitempty"` } diff --git a/src/legalentity/api_business_lines.go b/src/legalentity/api_business_lines.go index eb3c7f37b..f5241fa80 100644 --- a/src/legalentity/api_business_lines.go +++ b/src/legalentity/api_business_lines.go @@ -46,7 +46,7 @@ Creates a business line. This resource contains information about your user's line of business, including their industry and their source of funds. Adyen uses this information to verify your users as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. ->If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. +>If you are using hosted onboarding and just beginning your integration, use v3 for your API requests. Otherwise, use v2. diff --git a/src/legalentity/api_hosted_onboarding.go b/src/legalentity/api_hosted_onboarding.go index 0961d835c..382f179e6 100644 --- a/src/legalentity/api_hosted_onboarding.go +++ b/src/legalentity/api_hosted_onboarding.go @@ -47,7 +47,7 @@ GetLinkToAdyenhostedOnboardingPage Get a link to an Adyen-hosted onboarding page Returns a link to an Adyen-hosted onboarding page where you need to redirect your user. ->If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. +>If you are using hosted onboarding and just beginning your integration, use v3 for your API requests. Otherwise, use v2. @@ -94,7 +94,7 @@ func (a *HostedOnboardingApi) GetOnboardingLinkThemeInput(id string) HostedOnboa /* GetOnboardingLinkTheme Get an onboarding link theme -Returns the details of the theme identified in the path.>If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. +Returns the details of the theme identified in the path.>If you are using hosted onboarding and just beginning your integration, use v3 for your API requests. Otherwise, use v2. @@ -140,7 +140,7 @@ ListHostedOnboardingPageThemes Get a list of hosted onboarding page themes Returns a list of hosted onboarding page themes. ->If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. +>If you are using hosted onboarding and just beginning your integration, use v3 for your API requests. Otherwise, use v2. diff --git a/src/legalentity/api_legal_entities.go b/src/legalentity/api_legal_entities.go index 31eb9248b..09c2a4cdf 100644 --- a/src/legalentity/api_legal_entities.go +++ b/src/legalentity/api_legal_entities.go @@ -143,7 +143,7 @@ Creates a legal entity. This resource contains information about the user that will be onboarded in your platform. Adyen uses this information to perform verification checks as required by payment industry regulations. Adyen informs you of the verification results through webhooks or API responses. ->If you are using hosted onboarding, [only use v2](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-01-legal-entity-management-api-3) for your API requests. +>If you are using hosted onboarding and just beginning your integration, use v3 for your API requests. Otherwise, use v2. diff --git a/src/legalentity/client.go b/src/legalentity/client.go index 459ddcd2d..7a6da1508 100644 --- a/src/legalentity/client.go +++ b/src/legalentity/client.go @@ -9,7 +9,7 @@ API version: 3 package legalentity import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Legal Entity Management API API v3 @@ -37,10 +37,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.LegalEntityEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.LegalEntityEndpoint + } // API Services c.BusinessLinesApi = (*BusinessLinesApi)(&c.common) @@ -52,4 +52,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransferInstrumentsApi = (*TransferInstrumentsApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/management/client.go b/src/management/client.go index f2b026505..adfd87beb 100644 --- a/src/management/client.go +++ b/src/management/client.go @@ -9,7 +9,7 @@ API version: 3 package management import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Management API API v3 @@ -81,10 +81,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.ManagementEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.ManagementEndpoint + } // API Services c.APICredentialsCompanyLevelApi = (*APICredentialsCompanyLevelApi)(&c.common) @@ -118,4 +118,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.WebhooksMerchantLevelApi = (*WebhooksMerchantLevelApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/management/model_localization.go b/src/management/model_localization.go index 39aef3d05..60b59da67 100644 --- a/src/management/model_localization.go +++ b/src/management/model_localization.go @@ -23,6 +23,8 @@ type Localization struct { Language *string `json:"language,omitempty"` // Secondary language of the terminal. SecondaryLanguage *string `json:"secondaryLanguage,omitempty"` + // The time zone of the terminal. + Timezone *string `json:"timezone,omitempty"` } // NewLocalization instantiates a new Localization object @@ -106,6 +108,38 @@ func (o *Localization) SetSecondaryLanguage(v string) { o.SecondaryLanguage = &v } +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *Localization) GetTimezone() string { + if o == nil || common.IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Localization) GetTimezoneOk() (*string, bool) { + if o == nil || common.IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *Localization) HasTimezone() bool { + if o != nil && !common.IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *Localization) SetTimezone(v string) { + o.Timezone = &v +} + func (o Localization) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -122,6 +156,9 @@ func (o Localization) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.SecondaryLanguage) { toSerialize["secondaryLanguage"] = o.SecondaryLanguage } + if !common.IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } return toSerialize, nil } diff --git a/src/management/model_passcodes.go b/src/management/model_passcodes.go index 208010722..475685ada 100644 --- a/src/management/model_passcodes.go +++ b/src/management/model_passcodes.go @@ -21,7 +21,7 @@ var _ common.MappedNullable = &Passcodes{} type Passcodes struct { // The passcode for the Admin menu and the Settings menu. AdminMenuPin *string `json:"adminMenuPin,omitempty"` - // The passcode for unreferenced refunds on standalone terminals. + // The passcode for referenced and unreferenced refunds on standalone terminals. RefundPin *string `json:"refundPin,omitempty"` // The passcode to unlock the terminal screen after a timeout. ScreenLockPin *string `json:"screenLockPin,omitempty"` diff --git a/src/management/model_pay_at_table.go b/src/management/model_pay_at_table.go index 98bee6701..6dfa190f6 100644 --- a/src/management/model_pay_at_table.go +++ b/src/management/model_pay_at_table.go @@ -23,6 +23,8 @@ type PayAtTable struct { AuthenticationMethod *string `json:"authenticationMethod,omitempty"` // Enable Pay at table. EnablePayAtTable *bool `json:"enablePayAtTable,omitempty"` + // Sets the allowed payment instrument for Pay at table transactions. Can be: **cash** or **card**. If not set, the terminal presents both options. + PaymentInstrument *string `json:"paymentInstrument,omitempty"` } // NewPayAtTable instantiates a new PayAtTable object @@ -106,6 +108,38 @@ func (o *PayAtTable) SetEnablePayAtTable(v bool) { o.EnablePayAtTable = &v } +// GetPaymentInstrument returns the PaymentInstrument field value if set, zero value otherwise. +func (o *PayAtTable) GetPaymentInstrument() string { + if o == nil || common.IsNil(o.PaymentInstrument) { + var ret string + return ret + } + return *o.PaymentInstrument +} + +// GetPaymentInstrumentOk returns a tuple with the PaymentInstrument field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayAtTable) GetPaymentInstrumentOk() (*string, bool) { + if o == nil || common.IsNil(o.PaymentInstrument) { + return nil, false + } + return o.PaymentInstrument, true +} + +// HasPaymentInstrument returns a boolean if a field has been set. +func (o *PayAtTable) HasPaymentInstrument() bool { + if o != nil && !common.IsNil(o.PaymentInstrument) { + return true + } + + return false +} + +// SetPaymentInstrument gets a reference to the given string and assigns it to the PaymentInstrument field. +func (o *PayAtTable) SetPaymentInstrument(v string) { + o.PaymentInstrument = &v +} + func (o PayAtTable) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -122,6 +156,9 @@ func (o PayAtTable) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.EnablePayAtTable) { toSerialize["enablePayAtTable"] = o.EnablePayAtTable } + if !common.IsNil(o.PaymentInstrument) { + toSerialize["paymentInstrument"] = o.PaymentInstrument + } return toSerialize, nil } @@ -170,3 +207,12 @@ func (o *PayAtTable) isValidAuthenticationMethod() bool { } return false } +func (o *PayAtTable) isValidPaymentInstrument() bool { + var allowedEnumValues = []string{"Cash", "Card"} + for _, allowed := range allowedEnumValues { + if o.GetPaymentInstrument() == allowed { + return true + } + } + return false +} diff --git a/src/management/model_payment_method.go b/src/management/model_payment_method.go index 034d49774..e1289956b 100644 --- a/src/management/model_payment_method.go +++ b/src/management/model_payment_method.go @@ -24,7 +24,7 @@ type PaymentMethod struct { Allowed *bool `json:"allowed,omitempty"` ApplePay *ApplePayInfo `json:"applePay,omitempty"` Bcmc *BcmcInfo `json:"bcmc,omitempty"` - // The unique identifier of the business line. + // The unique identifier of the business line. Required if you have a [platform setup](https://docs.adyen.com/marketplaces-and-platforms/platform-structure-resources/platform-setup/). BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` Clearpay *ClearpayInfo `json:"clearpay,omitempty"` diff --git a/src/management/model_payment_method_setup_info.go b/src/management/model_payment_method_setup_info.go index a5ed31fb0..d40dce9fa 100644 --- a/src/management/model_payment_method_setup_info.go +++ b/src/management/model_payment_method_setup_info.go @@ -22,7 +22,7 @@ type PaymentMethodSetupInfo struct { AfterpayTouch *AfterpayTouchInfo `json:"afterpayTouch,omitempty"` ApplePay *ApplePayInfo `json:"applePay,omitempty"` Bcmc *BcmcInfo `json:"bcmc,omitempty"` - // The unique identifier of the business line. + // The unique identifier of the business line. Required if you have a [platform setup](https://docs.adyen.com/marketplaces-and-platforms/platform-structure-resources/platform-setup/). BusinessLineId *string `json:"businessLineId,omitempty"` CartesBancaires *CartesBancairesInfo `json:"cartesBancaires,omitempty"` Clearpay *ClearpayInfo `json:"clearpay,omitempty"` diff --git a/src/management/model_referenced.go b/src/management/model_referenced.go new file mode 100644 index 000000000..d37a902cb --- /dev/null +++ b/src/management/model_referenced.go @@ -0,0 +1,125 @@ +/* +Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Referenced type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Referenced{} + +// Referenced struct for Referenced +type Referenced struct { + // Indicates whether referenced refunds are enabled on the standalone terminal. + EnableStandaloneRefunds *bool `json:"enableStandaloneRefunds,omitempty"` +} + +// NewReferenced instantiates a new Referenced 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 NewReferenced() *Referenced { + this := Referenced{} + return &this +} + +// NewReferencedWithDefaults instantiates a new Referenced 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 NewReferencedWithDefaults() *Referenced { + this := Referenced{} + return &this +} + +// GetEnableStandaloneRefunds returns the EnableStandaloneRefunds field value if set, zero value otherwise. +func (o *Referenced) GetEnableStandaloneRefunds() bool { + if o == nil || common.IsNil(o.EnableStandaloneRefunds) { + var ret bool + return ret + } + return *o.EnableStandaloneRefunds +} + +// GetEnableStandaloneRefundsOk returns a tuple with the EnableStandaloneRefunds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Referenced) GetEnableStandaloneRefundsOk() (*bool, bool) { + if o == nil || common.IsNil(o.EnableStandaloneRefunds) { + return nil, false + } + return o.EnableStandaloneRefunds, true +} + +// HasEnableStandaloneRefunds returns a boolean if a field has been set. +func (o *Referenced) HasEnableStandaloneRefunds() bool { + if o != nil && !common.IsNil(o.EnableStandaloneRefunds) { + return true + } + + return false +} + +// SetEnableStandaloneRefunds gets a reference to the given bool and assigns it to the EnableStandaloneRefunds field. +func (o *Referenced) SetEnableStandaloneRefunds(v bool) { + o.EnableStandaloneRefunds = &v +} + +func (o Referenced) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Referenced) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.EnableStandaloneRefunds) { + toSerialize["enableStandaloneRefunds"] = o.EnableStandaloneRefunds + } + return toSerialize, nil +} + +type NullableReferenced struct { + value *Referenced + isSet bool +} + +func (v NullableReferenced) Get() *Referenced { + return v.value +} + +func (v *NullableReferenced) Set(val *Referenced) { + v.value = val + v.isSet = true +} + +func (v NullableReferenced) IsSet() bool { + return v.isSet +} + +func (v *NullableReferenced) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReferenced(val *Referenced) *NullableReferenced { + return &NullableReferenced{value: val, isSet: true} +} + +func (v NullableReferenced) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReferenced) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/management/model_refunds.go b/src/management/model_refunds.go new file mode 100644 index 000000000..3ce0218ef --- /dev/null +++ b/src/management/model_refunds.go @@ -0,0 +1,124 @@ +/* +Management API + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v8/src/common" +) + +// checks if the Refunds type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Refunds{} + +// Refunds struct for Refunds +type Refunds struct { + Referenced *Referenced `json:"referenced,omitempty"` +} + +// NewRefunds instantiates a new Refunds 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 NewRefunds() *Refunds { + this := Refunds{} + return &this +} + +// NewRefundsWithDefaults instantiates a new Refunds 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 NewRefundsWithDefaults() *Refunds { + this := Refunds{} + return &this +} + +// GetReferenced returns the Referenced field value if set, zero value otherwise. +func (o *Refunds) GetReferenced() Referenced { + if o == nil || common.IsNil(o.Referenced) { + var ret Referenced + return ret + } + return *o.Referenced +} + +// GetReferencedOk returns a tuple with the Referenced field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refunds) GetReferencedOk() (*Referenced, bool) { + if o == nil || common.IsNil(o.Referenced) { + return nil, false + } + return o.Referenced, true +} + +// HasReferenced returns a boolean if a field has been set. +func (o *Refunds) HasReferenced() bool { + if o != nil && !common.IsNil(o.Referenced) { + return true + } + + return false +} + +// SetReferenced gets a reference to the given Referenced and assigns it to the Referenced field. +func (o *Refunds) SetReferenced(v Referenced) { + o.Referenced = &v +} + +func (o Refunds) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Refunds) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Referenced) { + toSerialize["referenced"] = o.Referenced + } + return toSerialize, nil +} + +type NullableRefunds struct { + value *Refunds + isSet bool +} + +func (v NullableRefunds) Get() *Refunds { + return v.value +} + +func (v *NullableRefunds) Set(val *Refunds) { + v.value = val + v.isSet = true +} + +func (v NullableRefunds) IsSet() bool { + return v.isSet +} + +func (v *NullableRefunds) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefunds(val *Refunds) *NullableRefunds { + return &NullableRefunds{value: val, isSet: true} +} + +func (v NullableRefunds) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefunds) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/management/model_terminal_settings.go b/src/management/model_terminal_settings.go index 89bf7a3a4..bf11ae95d 100644 --- a/src/management/model_terminal_settings.go +++ b/src/management/model_terminal_settings.go @@ -33,6 +33,7 @@ type TerminalSettings struct { Payment *Payment `json:"payment,omitempty"` ReceiptOptions *ReceiptOptions `json:"receiptOptions,omitempty"` ReceiptPrinting *ReceiptPrinting `json:"receiptPrinting,omitempty"` + Refunds *Refunds `json:"refunds,omitempty"` Signature *Signature `json:"signature,omitempty"` Standalone *Standalone `json:"standalone,omitempty"` Surcharge *Surcharge `json:"surcharge,omitempty"` @@ -474,6 +475,38 @@ func (o *TerminalSettings) SetReceiptPrinting(v ReceiptPrinting) { o.ReceiptPrinting = &v } +// GetRefunds returns the Refunds field value if set, zero value otherwise. +func (o *TerminalSettings) GetRefunds() Refunds { + if o == nil || common.IsNil(o.Refunds) { + var ret Refunds + return ret + } + return *o.Refunds +} + +// GetRefundsOk returns a tuple with the Refunds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminalSettings) GetRefundsOk() (*Refunds, bool) { + if o == nil || common.IsNil(o.Refunds) { + return nil, false + } + return o.Refunds, true +} + +// HasRefunds returns a boolean if a field has been set. +func (o *TerminalSettings) HasRefunds() bool { + if o != nil && !common.IsNil(o.Refunds) { + return true + } + + return false +} + +// SetRefunds gets a reference to the given Refunds and assigns it to the Refunds field. +func (o *TerminalSettings) SetRefunds(v Refunds) { + o.Refunds = &v +} + // GetSignature returns the Signature field value if set, zero value otherwise. func (o *TerminalSettings) GetSignature() Signature { if o == nil || common.IsNil(o.Signature) { @@ -715,6 +748,9 @@ func (o TerminalSettings) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.ReceiptPrinting) { toSerialize["receiptPrinting"] = o.ReceiptPrinting } + if !common.IsNil(o.Refunds) { + toSerialize["refunds"] = o.Refunds + } if !common.IsNil(o.Signature) { toSerialize["signature"] = o.Signature } diff --git a/src/payments/client.go b/src/payments/client.go index a50371720..4c5b549cf 100644 --- a/src/payments/client.go +++ b/src/payments/client.go @@ -9,7 +9,7 @@ API version: 68 package payments import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Payment API API v68 @@ -27,14 +27,14 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.Endpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.Endpoint + } // API Services c.ModificationsApi = (*ModificationsApi)(&c.common) c.PaymentsApi = (*PaymentsApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/payout/client.go b/src/payout/client.go index 6935c66e0..8e5c147a2 100644 --- a/src/payout/client.go +++ b/src/payout/client.go @@ -9,7 +9,7 @@ API version: 68 package payout import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Adyen Payout API API v68 @@ -29,10 +29,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.Endpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.Endpoint + } // API Services c.InitializationApi = (*InitializationApi)(&c.common) @@ -40,4 +40,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.ReviewingApi = (*ReviewingApi)(&c.common) return c -} +} \ No newline at end of file diff --git a/src/transfers/client.go b/src/transfers/client.go index edfeb7681..f56efa84b 100644 --- a/src/transfers/client.go +++ b/src/transfers/client.go @@ -9,7 +9,7 @@ API version: 4 package transfers import ( - "github.com/adyen/adyen-go-api-library/v8/src/common" + "github.com/adyen/adyen-go-api-library/v8/src/common" ) // APIClient manages communication with the Transfers API API v4 @@ -29,10 +29,10 @@ type APIClient struct { // NewAPIClient creates a new API client. func NewAPIClient(client *common.Client) *APIClient { c := &APIClient{} - c.common.Client = client - c.common.BasePath = func() string { - return client.Cfg.TransfersEndpoint - } + c.common.Client = client + c.common.BasePath = func() string { + return client.Cfg.TransfersEndpoint + } // API Services c.CapitalApi = (*CapitalApi)(&c.common) @@ -40,4 +40,4 @@ func NewAPIClient(client *common.Client) *APIClient { c.TransfersApi = (*TransfersApi)(&c.common) return c -} +} \ No newline at end of file