vdftransactionsv1

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package vdftransactionsv1 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetTransactionStatusRequest

func NewGetTransactionStatusRequest(server string, transactionId string) (*http.Request, error)

NewGetTransactionStatusRequest generates requests for GetTransactionStatus

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.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn

	// A callback for modifying response which are generated after receive from the network.
	ResponseEditors []ResponseEditorFn

	// 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.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetTransactionStatus

func (c *Client) GetTransactionStatus(ctx context.Context, transactionId string) (*http.Response, error)

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

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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 WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

func WithResponseEditorFn

func WithResponseEditorFn(fn ResponseEditorFn) ClientOption

WithResponseEditorFn allows setting up a callback function, which will be called right after receive the response.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

func NewClientWithResponses

func NewClientWithResponses(server 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 *GetTransactionStatusResp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetTransactionStatusWithResponse request
	GetTransactionStatusWithResponse(ctx context.Context, transactionId string) (*GetTransactionStatusResp, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CustomeTransactionStatus

type CustomeTransactionStatus struct {
	// TransactionStatus The transaction status details.
	TransactionStatus *Transaction `json:"transactionStatus,omitempty"`
}

CustomeTransactionStatus The payload for the getTransactionStatus operation.

type Error

type Error struct {
	// Code An error code that identifies the type of error that occurred.
	Code string `json:"code"`

	// Details Additional details that can help the caller understand or fix the issue.
	Details *string `json:"details,omitempty"`

	// Message A message that describes the error condition.
	Message string `json:"message"`
}

Error Error response returned when the request is unsuccessful.

type ErrorList

type ErrorList = []Error

ErrorList A list of error responses returned when a request is unsuccessful.

type GetTransactionResponse

type GetTransactionResponse struct {
	// Errors A list of error responses returned when a request is unsuccessful.
	Errors *ErrorList `json:"errors,omitempty"`

	// Payload The payload for the getTransactionStatus operation.
	CustomeTransactionStatus *CustomeTransactionStatus `json:"payload,omitempty"`
}

GetTransactionResponse The response schema for the getTransactionStatus operation.

type GetTransactionStatusResp

type GetTransactionStatusResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GetTransactionResponse
	JSON400      *GetTransactionResponse
	JSON401      *GetTransactionResponse
	JSON403      *GetTransactionResponse
	JSON404      *GetTransactionResponse
	JSON415      *GetTransactionResponse
	JSON429      *GetTransactionResponse
	JSON500      *GetTransactionResponse
	JSON503      *GetTransactionResponse
}

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

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseEditorFn

type ResponseEditorFn func(ctx context.Context, rsp *http.Response) error

ResponseEditorFn is the function signature for the ResponseEditor callback function

type Transaction

type Transaction struct {
	// Errors A list of error responses returned when a request is unsuccessful.
	Errors *ErrorList `json:"errors,omitempty"`

	// Status Current processing status of the transaction.
	Status TransactionStatus `json:"status"`

	// TransactionId The unique identifier sent in the 'transactionId' field in response to the post request of a specific transaction.
	TransactionId string `json:"transactionId"`
}

Transaction The transaction status details.

type TransactionStatus

type TransactionStatus string

TransactionStatus Current processing status of the transaction.

const (
	Failure    TransactionStatus = "Failure"
	Processing TransactionStatus = "Processing"
	Success    TransactionStatus = "Success"
)

Defines values for TransactionStatus.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL