client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHmrcCallbackPayload

func BuildHmrcCallbackPayload(mtdHmrcCallbackCode string, mtdHmrcCallbackState string, mtdHmrcCallbackError string, mtdHmrcCallbackErrorDescription string, mtdHmrcCallbackErrorCode string) (*mtd.CodePayload, error)

BuildHmrcCallbackPayload builds the payload for the mtd hmrc_callback endpoint from CLI flags.

func BuildRegisterPayload

func BuildRegisterPayload(mtdRegisterState string) (*mtd.StatePayload, error)

BuildRegisterPayload builds the payload for the mtd register endpoint from CLI flags.

func BuildRetrievePayload

func BuildRetrievePayload(mtdRetrieveState string) (*mtd.StatePayload, error)

BuildRetrievePayload builds the payload for the mtd retrieve endpoint from CLI flags.

func DecodeHmrcCallbackResponse

func DecodeHmrcCallbackResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeHmrcCallbackResponse returns a decoder for responses returned by the mtd hmrc_callback endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeHmrcCallbackResponse may return the following errors:

  • "matching_key_not_found" (type *goa.ServiceError): http.StatusNotFound
  • "invalid_request" (type *goa.ServiceError): http.StatusBadRequest
  • "key_length_error" (type *goa.ServiceError): http.StatusPreconditionFailed
  • error: internal error

func DecodeRegisterResponse

func DecodeRegisterResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeRegisterResponse returns a decoder for responses returned by the mtd register endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeRegisterResponse may return the following errors:

  • "key_length_error" (type *goa.ServiceError): http.StatusPreconditionFailed
  • "key_already_exists" (type *goa.ServiceError): http.StatusConflict
  • "key_ip_mismatch" (type *goa.ServiceError): http.StatusUnauthorized
  • error: internal error

func DecodeRetrieveResponse

func DecodeRetrieveResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeRetrieveResponse returns a decoder for responses returned by the mtd retrieve endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeRetrieveResponse may return the following errors:

  • "invalid_request" (type *goa.ServiceError): http.StatusBadRequest
  • "key_has_no_token" (type *goa.ServiceError): http.StatusPartialContent
  • "key_ip_mismatch" (type *goa.ServiceError): http.StatusUnauthorized
  • "matching_key_not_found" (type *goa.ServiceError): http.StatusNotFound
  • error: internal error

func EncodeHmrcCallbackRequest

func EncodeHmrcCallbackRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeHmrcCallbackRequest returns an encoder for requests sent to the mtd hmrc_callback server.

func HmrcCallbackMtdPath

func HmrcCallbackMtdPath() string

HmrcCallbackMtdPath returns the URL path to the mtd service hmrc_callback HTTP endpoint.

func NewHmrcCallbackInvalidRequest

func NewHmrcCallbackInvalidRequest(body *HmrcCallbackInvalidRequestResponseBody) *goa.ServiceError

NewHmrcCallbackInvalidRequest builds a mtd service hmrc_callback endpoint invalid_request error.

func NewHmrcCallbackKeyLengthError

func NewHmrcCallbackKeyLengthError(body *HmrcCallbackKeyLengthErrorResponseBody) *goa.ServiceError

NewHmrcCallbackKeyLengthError builds a mtd service hmrc_callback endpoint key_length_error error.

func NewHmrcCallbackMatchingKeyNotFound

func NewHmrcCallbackMatchingKeyNotFound(body *HmrcCallbackMatchingKeyNotFoundResponseBody) *goa.ServiceError

NewHmrcCallbackMatchingKeyNotFound builds a mtd service hmrc_callback endpoint matching_key_not_found error.

func NewRegisterKeyAlreadyExists

func NewRegisterKeyAlreadyExists(body *RegisterKeyAlreadyExistsResponseBody) *goa.ServiceError

NewRegisterKeyAlreadyExists builds a mtd service register endpoint key_already_exists error.

func NewRegisterKeyIPMismatch

func NewRegisterKeyIPMismatch(body *RegisterKeyIPMismatchResponseBody) *goa.ServiceError

NewRegisterKeyIPMismatch builds a mtd service register endpoint key_ip_mismatch error.

func NewRegisterKeyLengthError

func NewRegisterKeyLengthError(body *RegisterKeyLengthErrorResponseBody) *goa.ServiceError

NewRegisterKeyLengthError builds a mtd service register endpoint key_length_error error.

func NewRetrieveInvalidRequest

func NewRetrieveInvalidRequest(body *RetrieveInvalidRequestResponseBody) *goa.ServiceError

NewRetrieveInvalidRequest builds a mtd service retrieve endpoint invalid_request error.

func NewRetrieveKeyHasNoToken

func NewRetrieveKeyHasNoToken(body *RetrieveKeyHasNoTokenResponseBody) *goa.ServiceError

NewRetrieveKeyHasNoToken builds a mtd service retrieve endpoint key_has_no_token error.

func NewRetrieveKeyIPMismatch

func NewRetrieveKeyIPMismatch(body *RetrieveKeyIPMismatchResponseBody) *goa.ServiceError

NewRetrieveKeyIPMismatch builds a mtd service retrieve endpoint key_ip_mismatch error.

func NewRetrieveMatchingKeyNotFound

func NewRetrieveMatchingKeyNotFound(body *RetrieveMatchingKeyNotFoundResponseBody) *goa.ServiceError

NewRetrieveMatchingKeyNotFound builds a mtd service retrieve endpoint matching_key_not_found error.

func RegisterMtdPath

func RegisterMtdPath(state string) string

RegisterMtdPath returns the URL path to the mtd service register HTTP endpoint.

func RetrieveMtdPath

func RetrieveMtdPath(state string) string

RetrieveMtdPath returns the URL path to the mtd service retrieve HTTP endpoint.

func ValidateHmrcCallbackInvalidRequestResponseBody

func ValidateHmrcCallbackInvalidRequestResponseBody(body *HmrcCallbackInvalidRequestResponseBody) (err error)

ValidateHmrcCallbackInvalidRequestResponseBody runs the validations defined on hmrc_callback_invalid_request_response_body

func ValidateHmrcCallbackKeyLengthErrorResponseBody

func ValidateHmrcCallbackKeyLengthErrorResponseBody(body *HmrcCallbackKeyLengthErrorResponseBody) (err error)

ValidateHmrcCallbackKeyLengthErrorResponseBody runs the validations defined on hmrc_callback_key_length_error_response_body

func ValidateHmrcCallbackMatchingKeyNotFoundResponseBody

func ValidateHmrcCallbackMatchingKeyNotFoundResponseBody(body *HmrcCallbackMatchingKeyNotFoundResponseBody) (err error)

ValidateHmrcCallbackMatchingKeyNotFoundResponseBody runs the validations defined on hmrc_callback_matching_key_not_found_response_body

func ValidateRegisterKeyAlreadyExistsResponseBody

func ValidateRegisterKeyAlreadyExistsResponseBody(body *RegisterKeyAlreadyExistsResponseBody) (err error)

ValidateRegisterKeyAlreadyExistsResponseBody runs the validations defined on register_key_already_exists_response_body

func ValidateRegisterKeyIPMismatchResponseBody

func ValidateRegisterKeyIPMismatchResponseBody(body *RegisterKeyIPMismatchResponseBody) (err error)

ValidateRegisterKeyIPMismatchResponseBody runs the validations defined on register_key_ip_mismatch_response_body

func ValidateRegisterKeyLengthErrorResponseBody

func ValidateRegisterKeyLengthErrorResponseBody(body *RegisterKeyLengthErrorResponseBody) (err error)

ValidateRegisterKeyLengthErrorResponseBody runs the validations defined on register_key_length_error_response_body

func ValidateRetrieveInvalidRequestResponseBody

func ValidateRetrieveInvalidRequestResponseBody(body *RetrieveInvalidRequestResponseBody) (err error)

ValidateRetrieveInvalidRequestResponseBody runs the validations defined on retrieve_invalid_request_response_body

func ValidateRetrieveKeyHasNoTokenResponseBody

func ValidateRetrieveKeyHasNoTokenResponseBody(body *RetrieveKeyHasNoTokenResponseBody) (err error)

ValidateRetrieveKeyHasNoTokenResponseBody runs the validations defined on retrieve_key_has_no_token_response_body

func ValidateRetrieveKeyIPMismatchResponseBody

func ValidateRetrieveKeyIPMismatchResponseBody(body *RetrieveKeyIPMismatchResponseBody) (err error)

ValidateRetrieveKeyIPMismatchResponseBody runs the validations defined on retrieve_key_ip_mismatch_response_body

func ValidateRetrieveMatchingKeyNotFoundResponseBody

func ValidateRetrieveMatchingKeyNotFoundResponseBody(body *RetrieveMatchingKeyNotFoundResponseBody) (err error)

ValidateRetrieveMatchingKeyNotFoundResponseBody runs the validations defined on retrieve_matching_key_not_found_response_body

Types

type Client

type Client struct {
	// Register Doer is the HTTP client used to make requests to the register
	// endpoint.
	RegisterDoer goahttp.Doer

	// Retrieve Doer is the HTTP client used to make requests to the retrieve
	// endpoint.
	RetrieveDoer goahttp.Doer

	// HmrcCallback Doer is the HTTP client used to make requests to the
	// hmrc_callback endpoint.
	HmrcCallbackDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the mtd service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the mtd service servers.

func (*Client) BuildHmrcCallbackRequest

func (c *Client) BuildHmrcCallbackRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildHmrcCallbackRequest instantiates a HTTP request object with method and path set to call the "mtd" service "hmrc_callback" endpoint

func (*Client) BuildRegisterRequest

func (c *Client) BuildRegisterRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildRegisterRequest instantiates a HTTP request object with method and path set to call the "mtd" service "register" endpoint

func (*Client) BuildRetrieveRequest

func (c *Client) BuildRetrieveRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildRetrieveRequest instantiates a HTTP request object with method and path set to call the "mtd" service "retrieve" endpoint

func (*Client) HmrcCallback

func (c *Client) HmrcCallback() goa.Endpoint

HmrcCallback returns an endpoint that makes HTTP requests to the mtd service hmrc_callback server.

func (*Client) Register

func (c *Client) Register() goa.Endpoint

Register returns an endpoint that makes HTTP requests to the mtd service register server.

func (*Client) Retrieve

func (c *Client) Retrieve() goa.Endpoint

Retrieve returns an endpoint that makes HTTP requests to the mtd service retrieve server.

type HmrcCallbackInvalidRequestResponseBody

type HmrcCallbackInvalidRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

HmrcCallbackInvalidRequestResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "invalid_request" error.

type HmrcCallbackKeyLengthErrorResponseBody

type HmrcCallbackKeyLengthErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

HmrcCallbackKeyLengthErrorResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "key_length_error" error.

type HmrcCallbackMatchingKeyNotFoundResponseBody

type HmrcCallbackMatchingKeyNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

HmrcCallbackMatchingKeyNotFoundResponseBody is the type of the "mtd" service "hmrc_callback" endpoint HTTP response body for the "matching_key_not_found" error.

type RegisterKeyAlreadyExistsResponseBody

type RegisterKeyAlreadyExistsResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RegisterKeyAlreadyExistsResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_already_exists" error.

type RegisterKeyIPMismatchResponseBody

type RegisterKeyIPMismatchResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RegisterKeyIPMismatchResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_ip_mismatch" error.

type RegisterKeyLengthErrorResponseBody

type RegisterKeyLengthErrorResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RegisterKeyLengthErrorResponseBody is the type of the "mtd" service "register" endpoint HTTP response body for the "key_length_error" error.

type RetrieveInvalidRequestResponseBody

type RetrieveInvalidRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RetrieveInvalidRequestResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "invalid_request" error.

type RetrieveKeyHasNoTokenResponseBody

type RetrieveKeyHasNoTokenResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RetrieveKeyHasNoTokenResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "key_has_no_token" error.

type RetrieveKeyIPMismatchResponseBody

type RetrieveKeyIPMismatchResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RetrieveKeyIPMismatchResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "key_ip_mismatch" error.

type RetrieveMatchingKeyNotFoundResponseBody

type RetrieveMatchingKeyNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

RetrieveMatchingKeyNotFoundResponseBody is the type of the "mtd" service "retrieve" endpoint HTTP response body for the "matching_key_not_found" error.

Jump to

Keyboard shortcuts

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