package
0.0.0-20240110232416-24cc659731e0
Repository: https://github.com/tendant/marqeta-client.git
Documentation: pkg.go.dev

# README

Go API client for coreapi

Marqeta's Core API endpoints, conveniently annotated to enable code generation (including SDKs), test cases, and documentation. Currently in beta.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 3.0.11
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import coreapi "github.com/tendant/marqeta-client/coreapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), coreapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), coreapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), coreapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), coreapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to /v3

ClassMethodHTTP requestDescription
BusinessTransitionsAPIGetBusinesstransitionsBusinessBusinesstokenGet /businesstransitions/business/{business_token}List business transitions
BusinessTransitionsAPIGetBusinesstransitionsTokenGet /businesstransitions/{token}Retrieve business transition
BusinessTransitionsAPIPostBusinesstransitionsPost /businesstransitionsCreate business transition
BusinessesAPIGetBusinessesGet /businessesList businesses
BusinessesAPIGetBusinessesParenttokenChildrenGet /businesses/{parent_token}/childrenList business children
BusinessesAPIGetBusinessesTokenGet /businesses/{token}Retrieve business
BusinessesAPIGetBusinessesTokenSsnGet /businesses/{token}/ssnRetrieve business identification number
BusinessesAPIPostBusinessesPost /businessesCreate business
BusinessesAPIPostBusinessesLookupPost /businesses/lookupSearch businesses
BusinessesAPIPutBusinessesTokenPut /businesses/{token}Update business
CardTransitionsAPIGetCardtransitionsCardTokenGet /cardtransitions/card/{token}List transitions for card
CardTransitionsAPIGetCardtransitionsTokenGet /cardtransitions/{token}Retrieve card transition
CardTransitionsAPIPostCardtransitionsPost /cardtransitionsCreate card transition
CardsAPIGetCardsGet /cardsList cards by last 4 digits of PAN
CardsAPIGetCardsBarcodeBarcodeGet /cards/barcode/{barcode}Retrieve card by barcode
CardsAPIGetCardsTokenGet /cards/{token}Retrieve card
CardsAPIGetCardsTokenShowpanGet /cards/{token}/showpanShow card PAN
CardsAPIGetCardsUserTokenGet /cards/user/{token}List cards for user
CardsAPIPostCardsPost /cardsCreate card
CardsAPIPostCardsGetbypanPost /cards/getbypanRetrieve card by PAN
CardsAPIPutCardsTokenPut /cards/{token}Update card
DigitalWalletsManagementAPIGenerateApplePayWPPJWTPost /digitalwallets/wpp/applePayJWTCreate request for Apple Wallet web push provisioning
DigitalWalletsManagementAPIGetDigitalwallettokensGet /digitalwallettokensList digital wallet tokens
DigitalWalletsManagementAPIGetDigitalwallettokensCardCardtokenGet /digitalwallettokens/card/{card_token}List digital wallet tokens for card
DigitalWalletsManagementAPIGetDigitalwallettokensTokenGet /digitalwallettokens/{token}Retrieve digital wallet token
DigitalWalletsManagementAPIGetDigitalwallettokensTokenShowtokenpanGet /digitalwallettokens/{token}/showtokenpanRetrieve digital wallet token PAN
DigitalWalletsManagementAPIGetDigitalwallettokentransitionsDigitalwallettokenTokenGet /digitalwallettokentransitions/digitalwallettoken/{token}List transitions for digital wallet token
DigitalWalletsManagementAPIGetDigitalwallettokentransitionsTokenGet /digitalwallettokentransitions/{token}Retrieve digital wallet token transition
DigitalWalletsManagementAPIPostDigitalwalletprovisionrequestsAndroidpayPost /digitalwalletprovisionrequests/androidpayCreate digital wallet token provisioning request for Google Wallet
DigitalWalletsManagementAPIPostDigitalwalletprovisionrequestsApplepayPost /digitalwalletprovisionrequests/applepayCreate digital wallet token provisioning request for Apple Wallet
DigitalWalletsManagementAPIPostDigitalwalletprovisionrequestsSamsungpayPost /digitalwalletprovisionrequests/samsungpayCreate digital wallet token provisioning request for Samsung Wallet
DigitalWalletsManagementAPIPostDigitalwalletprovisionrequestsXPayPost /digitalwalletprovisionrequests/xpayCreate digital wallet token provisioning request for XPay
DigitalWalletsManagementAPIPostDigitalwallettokentransitionsPost /digitalwallettokentransitionsCreate digital wallet token transition
DigitalWalletsManagementAPISendOPCDataToGooglePayPost /digitalwallets/wpp/googlePayPushProvisioningNotificationCreate request for Google Wallet web push provisioning
FeeChargesAPIGetFeeChargeTokenGet /feecharges/{token}Retrieve fee charge
FeeChargesAPIPostFeeChargePost /feechargesCreate fee charge
FeeRefundsAPIPostFeeRefundsPost /feerefundsCreate fee refund
FeesAPIGetFeesGet /feesList fees
FeesAPIGetFeesTokenGet /fees/{token}Retrieve fee
FeesAPIPostFeesPost /feesCreate fee
FeesAPIPutFeesTokenPut /fees/{token}Update fee
PingAPIGetPingGet /pingReturns a heartbeat to the consumer
PingAPIPostPingPost /pingEcho test for sending payload to server
SimulationsCardTransactionsAPIAccountFundingAuthPlusCaptureEventPost /simulations/cardtransactions/account.funding.auth_plus_captureSimulate AFT authorization and capture
SimulationsCardTransactionsAPIAccountFundingAuthPlusCaptureReversalEventPost /simulations/cardtransactions/account.funding.auth_plus_capture.reversalSimulate AFT authorization and capture reversal
SimulationsCardTransactionsAPIAccountFundingAuthorizationClearingEventPost /simulations/cardtransactions/account.funding.authorization.clearingSimulate AFT authorization clearing
SimulationsCardTransactionsAPIAccountFundingAuthorizationEventPost /simulations/cardtransactions/account.funding.authorizationSimulate AFT authorization
SimulationsCardTransactionsAPIAccountFundingAuthorizationReversalEventPost /simulations/cardtransactions/account.funding.authorization.reversalSimulate AFT authorization reversal
SimulationsCardTransactionsAPIAuthorizationAdviceEventPost /simulations/cardtransactions/authorization.adviceSimulate authorization advice
SimulationsCardTransactionsAPIAuthorizationAtmWithdrawalEventPost /simulations/cardtransactions/authorization.atm.withdrawalSimulate ATM withdrawal authorization
SimulationsCardTransactionsAPIAuthorizationCashbackEventPost /simulations/cardtransactions/authorization.cashbackSimulate authorization cash back
SimulationsCardTransactionsAPIAuthorizationClearingAtmWithdrawalEventPost /simulations/cardtransactions/authorization.clearing.atm.withdrawalSimulate ATM withdrawal authorization clearing
SimulationsCardTransactionsAPIAuthorizationClearingEventPost /simulations/cardtransactions/authorization.clearingSimulate authorization clearing
SimulationsCardTransactionsAPIAuthorizationClearingQuasiCashEventPost /simulations/cardtransactions/authorization.clearing.quasi.cashSimulate quasi-cash authorization clearing
SimulationsCardTransactionsAPIAuthorizationEventPost /simulations/cardtransactions/authorizationSimulate authorization
SimulationsCardTransactionsAPIAuthorizationIncrementalEventPost /simulations/cardtransactions/authorization.incrementalSimulate incremental authorization
SimulationsCardTransactionsAPIAuthorizationQuasiCashEventPost /simulations/cardtransactions/authorization.quasi.cashSimulate quasi-cash authorization
SimulationsCardTransactionsAPIAuthorizationReversalEventPost /simulations/cardtransactions/authorization.reversalSimulate authorization reversal
SimulationsCardTransactionsAPIRefundAuthorizationClearingEventPost /simulations/cardtransactions/refund.authorization.clearingSimulate refund authorization clearing
SimulationsCardTransactionsAPIRefundAuthorizationEventPost /simulations/cardtransactions/refund.authorizationSimulate refund authorization
SimulationsCardTransactionsAPIRefundAuthorizationReversalEventPost /simulations/cardtransactions/refund.authorization.reversalSimulate refund authorization reversal
SimulationsCardTransactionsAPIRefundEventPost /simulations/cardtransactions/refundSimulate refund
TransactionsAPIGetTransactionsGet /transactionsList transactions
TransactionsAPIGetTransactionsFundingsourceFundingsourcetokenGet /transactions/fundingsource/{funding_source_token}List transactions for a funding account
TransactionsAPIGetTransactionsTokenGet /transactions/{token}Retrieve transaction
TransactionsAPIGetTransactionsTokenRelatedGet /transactions/{token}/relatedList related transactions
UserTransitionsAPIGetUsertransitionsTokenGet /usertransitions/{token}Retrieve user transition
UserTransitionsAPIGetUsertransitionsUserUsertokenGet /usertransitions/user/{user_token}List transitions for user
UserTransitionsAPIPostUsertransitionsPost /usertransitionsCreate user transition
UsersAPIGetUsersGet /usersList users
UsersAPIGetUsersAuthClientaccesstokenTokenGet /users/auth/clientaccesstoken/{token}Retrieve client access token
UsersAPIGetUsersParenttokenChildrenGet /users/{parent_token}/childrenList user child accounts
UsersAPIGetUsersTokenGet /users/{token}Retrieve user
UsersAPIGetUsersTokenSsnGet /users/{token}/ssnRetrieve user identification number
UsersAPIPostUsersPost /usersCreate user
UsersAPIPostUsersAuthChangepasswordPost /users/auth/changepasswordUpdate user password
UsersAPIPostUsersAuthClientaccesstokenPost /users/auth/clientaccesstokenCreate client access token
UsersAPIPostUsersAuthLoginPost /users/auth/loginLog in user
UsersAPIPostUsersAuthLogoutPost /users/auth/logoutLog out user
UsersAPIPostUsersAuthOnetimePost /users/auth/onetimeCreate single-use token
UsersAPIPostUsersAuthResetpasswordPost /users/auth/resetpasswordRequest user password reset token
UsersAPIPostUsersAuthResetpasswordTokenPost /users/auth/resetpassword/{token}Reset user password
UsersAPIPostUsersAuthVerifyemailPost /users/auth/verifyemailRequest email verification token
UsersAPIPostUsersAuthVerifyemailTokenPost /users/auth/verifyemail/{token}Verify email address
UsersAPIPostUsersLookupPost /users/lookupSearch users
UsersAPIPutUsersTokenPut /users/{token}Update user
WebhooksAPIGetWebhooksGet /webhooksList webhooks
WebhooksAPIGetWebhooksTokenGet /webhooks/{token}Retrieve webhook
WebhooksAPIPostWebhooksPost /webhooksCreate webhook
WebhooksAPIPostWebhooksTokenEventtypeEventtokenPost /webhooks/{token}/{event_type}/{event_token}Resend event notification
WebhooksAPIPostWebhooksTokenPingPost /webhooks/{token}/pingPing webhook
WebhooksAPIPutWebhooksCustomHeadersTokenPut /webhooks/customheaders/{token}Update webhook custom headers
WebhooksAPIPutWebhooksTokenPut /webhooks/{token}Update webhook

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

mqAppAndAccessToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]