shipenrollment

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

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

Index

Constants

View Source
const (
	OAuthScopes = "OAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewGetEnrollmentRequest

func NewGetEnrollmentRequest(server string, body GetEnrollmentJSONRequestBody) (*http.Request, error)

NewGetEnrollmentRequest calls the generic GetEnrollment builder with application/json body

func NewGetEnrollmentRequestWithBody

func NewGetEnrollmentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewGetEnrollmentRequestWithBody generates requests for GetEnrollment with any type of body

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
}

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) GetEnrollment

func (c *Client) GetEnrollment(ctx context.Context, body GetEnrollmentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetEnrollmentWithBody

func (c *Client) GetEnrollmentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetEnrollmentWithBody request with any body
	GetEnrollmentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	GetEnrollment(ctx context.Context, body GetEnrollmentJSONRequestBody, reqEditors ...RequestEditorFn) (*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.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetEnrollmentWithBodyWithResponse

func (c *ClientWithResponses) GetEnrollmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetEnrollmentResponse, error)

GetEnrollmentWithBodyWithResponse request with arbitrary body returning *GetEnrollmentResponse

func (*ClientWithResponses) GetEnrollmentWithResponse

func (c *ClientWithResponses) GetEnrollmentWithResponse(ctx context.Context, body GetEnrollmentJSONRequestBody, reqEditors ...RequestEditorFn) (*GetEnrollmentResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetEnrollmentWithBodyWithResponse request with any body
	GetEnrollmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetEnrollmentResponse, error)

	GetEnrollmentWithResponse(ctx context.Context, body GetEnrollmentJSONRequestBody, reqEditors ...RequestEditorFn) (*GetEnrollmentResponse, error)
}

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

type EnrollmentRequest

type EnrollmentRequest struct {
	// MIDs The Mailer IDs (MIDs) whose enrollment is being checked. Currently only one MID is allowed per request. Multiple MIDs will be supported in a future version.
	MIDs []string `json:"MIDs"`
}

EnrollmentRequest defines model for EnrollmentRequest.

type EnrollmentStatus

type EnrollmentStatus struct {
	// MID The MID to which the information in this object applies.
	MID *string `json:"MID,omitempty"`

	// EpsAccountNumber The EPS account number tied to the MID, if found and available.
	EpsAccountNumber *string `json:"epsAccountNumber"`

	// Program The program (Outbound or USPS Returns) in which the MID is enrolled. If the MID is enrolled in both programs, two objects will be returned, one for each program.
	//
	// Note:
	// - `OUTBOUND` and `RETURNS` are obsolete.  The API will return either `Outbound` or `USPS Returns` instead.
	// - `NONE` is obsolete.  The API will return a `404 - Not Found` error if the MID is not found.
	Program *EnrollmentStatusProgram `json:"program,omitempty"`

	// StartDate The date on which the MID's enrollment began.
	StartDate *openapi_types.Date `json:"startDate,omitempty"`
}

EnrollmentStatus USPS Ship enrollment information for a single MID.

type EnrollmentStatusProgram

type EnrollmentStatusProgram string

EnrollmentStatusProgram The program (Outbound or USPS Returns) in which the MID is enrolled. If the MID is enrolled in both programs, two objects will be returned, one for each program.

Note: - `OUTBOUND` and `RETURNS` are obsolete. The API will return either `Outbound` or `USPS Returns` instead. - `NONE` is obsolete. The API will return a `404 - Not Found` error if the MID is not found.

const (
	NONE        EnrollmentStatusProgram = "NONE"
	OUTBOUND    EnrollmentStatusProgram = "OUTBOUND"
	Outbound    EnrollmentStatusProgram = "Outbound"
	RETURNS     EnrollmentStatusProgram = "RETURNS"
	USPSReturns EnrollmentStatusProgram = "USPS Returns"
)

Defines values for EnrollmentStatusProgram.

type EnrollmentStatuses

type EnrollmentStatuses struct {
	MIDs *[]EnrollmentStatus `json:"MIDs,omitempty"`
}

EnrollmentStatuses A list of enrollment status information for one or more MIDs.

type ErrorMessage

type ErrorMessage struct {
	// ApiVersion The version of the API that was used and that raised the error.
	ApiVersion *string `json:"apiVersion,omitempty"`

	// Error The high-level error that has occurred as indicated by the status code.
	Error                *ErrorMessage_Error    `json:"error,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage Standard error message response.

func (ErrorMessage) Get

func (a ErrorMessage) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage. Returns the specified element and whether it was found

func (ErrorMessage) MarshalJSON

func (a ErrorMessage) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage to handle AdditionalProperties

func (*ErrorMessage) Set

func (a *ErrorMessage) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage

func (*ErrorMessage) UnmarshalJSON

func (a *ErrorMessage) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage to handle AdditionalProperties

type ErrorMessage_Error

type ErrorMessage_Error struct {
	// Code The error status code that has been returned in response to the request.
	Code   *string                           `json:"code,omitempty"`
	Errors *[]ErrorMessage_Error_Errors_Item `json:"errors,omitempty"`

	// Message A human-readable message describing the error.
	Message              *string                `json:"message,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error The high-level error that has occurred as indicated by the status code.

func (ErrorMessage_Error) Get

func (a ErrorMessage_Error) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error. Returns the specified element and whether it was found

func (ErrorMessage_Error) MarshalJSON

func (a ErrorMessage_Error) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

func (*ErrorMessage_Error) Set

func (a *ErrorMessage_Error) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error

func (*ErrorMessage_Error) UnmarshalJSON

func (a *ErrorMessage_Error) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

type ErrorMessage_Error_Errors_Item

type ErrorMessage_Error_Errors_Item struct {
	// Code An internal subordinate code used for error diagnosis.
	Code *string `json:"code,omitempty"`

	// Detail A human-readable description of the error that occurred.
	Detail *string `json:"detail,omitempty"`

	// Source The element that is suspected of originating the error.  Helps to pinpoint the problem.
	Source *ErrorMessage_Error_Errors_Source `json:"source,omitempty"`

	// Status The status code response returned to the client.
	Status *string `json:"status,omitempty"`

	// Title A human-readable title that identifies the error.
	Title                *string                `json:"title,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Item defines model for ErrorMessage.Error.Errors.Item.

func (ErrorMessage_Error_Errors_Item) Get

func (a ErrorMessage_Error_Errors_Item) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Item. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Item) MarshalJSON

func (a ErrorMessage_Error_Errors_Item) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Item) Set

func (a *ErrorMessage_Error_Errors_Item) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Item

func (*ErrorMessage_Error_Errors_Item) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Item) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

type ErrorMessage_Error_Errors_Source

type ErrorMessage_Error_Errors_Source struct {
	// Example An example of a valid value for the input parameter.
	Example *string `json:"example,omitempty"`

	// Parameter The input in the request which caused an error.
	Parameter            *string                `json:"parameter,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Source The element that is suspected of originating the error. Helps to pinpoint the problem.

func (ErrorMessage_Error_Errors_Source) Get

func (a ErrorMessage_Error_Errors_Source) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Source. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Source) MarshalJSON

func (a ErrorMessage_Error_Errors_Source) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Source) Set

func (a *ErrorMessage_Error_Errors_Source) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Source

func (*ErrorMessage_Error_Errors_Source) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Source) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

type GetEnrollmentJSONRequestBody

type GetEnrollmentJSONRequestBody = EnrollmentRequest

GetEnrollmentJSONRequestBody defines body for GetEnrollment for application/json ContentType.

type GetEnrollmentResponse

type GetEnrollmentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EnrollmentStatuses
	XML200       *EnrollmentStatuses
	JSON400      *ErrorMessage
	XML400       *ErrorMessage
	JSON401      *ErrorMessage
	XML401       *ErrorMessage
	JSON403      *ErrorMessage
	XML403       *ErrorMessage
	JSON404      *ErrorMessage
	XML404       *ErrorMessage
	JSON503      *ErrorMessage
	XML503       *ErrorMessage
}

func ParseGetEnrollmentResponse

func ParseGetEnrollmentResponse(rsp *http.Response) (*GetEnrollmentResponse, error)

ParseGetEnrollmentResponse parses an HTTP response from a GetEnrollmentWithResponse call

func (GetEnrollmentResponse) Status

func (r GetEnrollmentResponse) Status() string

Status returns HTTPResponse.Status

func (GetEnrollmentResponse) StatusCode

func (r GetEnrollmentResponse) 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

Jump to

Keyboard shortcuts

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