Documentation
¶
Overview ¶
Package vendorTransaction provides primitives to interact the openapi HTTP API.
Code generated by go-sdk-codegen DO NOT EDIT.
Package vendorTransaction provides primitives to interact the openapi HTTP API.
Code generated by go-sdk-codegen DO NOT EDIT.
Index ¶
- func NewGetTransactionStatusRequest(endpoint string, transactionId string) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type Error
- type ErrorList
- type GetTransactionStatusResp
- type HttpRequestDoer
- type RequestBeforeFn
- type ResponseAfterFn
- type Transaction
- type TransactionStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Endpoint string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A callback for modifying requests which are generated before sending over // the network. RequestBefore RequestBeforeFn // A callback for modifying response which are generated before sending over // the network. ResponseAfter ResponseAfterFn // The user agent header identifies your application, its version number, and the platform and programming language you are using. // You must include a user agent header in each request submitted to the sales partner API. UserAgent string }
Client which conforms to the OpenAPI3 specification for this service.
type ClientInterface ¶
type ClientInterface interface { // GetTransactionStatus request GetTransactionStatus(ctx context.Context, transactionId string) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestBefore ¶
func WithRequestBefore(fn RequestBeforeFn) ClientOption
WithRequestBefore allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
func WithResponseAfter ¶
func WithResponseAfter(fn ResponseAfterFn) ClientOption
WithResponseAfter allows setting up a callback function, which will be called right after get response the request. This can be used to log.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent set up useragent add user agent to every request automatically
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(endpoint string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetTransactionStatusWithResponse ¶
func (c *ClientWithResponses) GetTransactionStatusWithResponse(ctx context.Context, transactionId string) (*GetTransactionStatusResp, error)
GetTransactionStatusWithResponse request returning *GetTransactionStatusResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetTransactionStatus request GetTransactionStatusWithResponse(ctx context.Context, transactionId string) (*GetTransactionStatusResp, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct { // An error code that identifies the type of error that occurred. Code string `json:"code"` // Additional details that can help the caller understand or fix the issue. Details *string `json:"details,omitempty"` // A message that describes the error condition. Message string `json:"message"` }
Error defines model for Error.
type ErrorList ¶
type ErrorList struct {
Errors []Error `json:"errors"`
}
ErrorList defines model for ErrorList.
type GetTransactionStatusResp ¶
type GetTransactionStatusResp struct { Body []byte HTTPResponse *http.Response JSON200 *TransactionStatus JSON400 *ErrorList JSON401 *Error JSON403 *Error JSON404 *Error JSON415 *Error JSON429 *Error JSON500 *Error JSON503 *Error }
func ParseGetTransactionStatusResp ¶
func ParseGetTransactionStatusResp(rsp *http.Response) (*GetTransactionStatusResp, error)
ParseGetTransactionStatusResp parses an HTTP response from a GetTransactionStatusWithResponse call
func (GetTransactionStatusResp) Status ¶
func (r GetTransactionStatusResp) Status() string
Status returns HTTPResponse.Status
func (GetTransactionStatusResp) StatusCode ¶
func (r GetTransactionStatusResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type RequestBeforeFn ¶
RequestBeforeFn is the function signature for the RequestBefore callback function
type ResponseAfterFn ¶
ResponseAfterFn is the function signature for the ResponseAfter callback function
type Transaction ¶
type Transaction struct { // A list of error responses returned when a request is unsuccessful. Errors *ErrorList `json:"errors,omitempty"` // Current processing status of the transaction. Status string `json:"status"` // The unique identifier sent in the 'transactionId' field in response to the post request of a specific transaction. TransactionId string `json:"transactionId"` }
Transaction defines model for Transaction.
type TransactionStatus ¶
type TransactionStatus struct { // The transaction status details. TransactionStatus *Transaction `json:"transactionStatus,omitempty"` }
TransactionStatus defines model for TransactionStatus.