carts

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

View Source
const (
	Oauth2Scopes = "oauth2.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewBatchUpsertCartsRequest

func NewBatchUpsertCartsRequest(server string, body BatchUpsertCartsJSONRequestBody) (*http.Request, error)

NewBatchUpsertCartsRequest calls the generic BatchUpsertCarts builder with application/json body

func NewBatchUpsertCartsRequestWithBody

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

NewBatchUpsertCartsRequestWithBody generates requests for BatchUpsertCarts with any type of body

func NewCreateCartRequest

func NewCreateCartRequest(server string, body CreateCartJSONRequestBody) (*http.Request, error)

NewCreateCartRequest calls the generic CreateCart builder with application/json body

func NewCreateCartRequestWithBody

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

NewCreateCartRequestWithBody generates requests for CreateCart with any type of body

func NewDeleteCartByIdRequest

func NewDeleteCartByIdRequest(server string, cartId string) (*http.Request, error)

NewDeleteCartByIdRequest generates requests for DeleteCartById

func NewGetCartByIdRequest

func NewGetCartByIdRequest(server string, cartId string, params *GetCartByIdParams) (*http.Request, error)

NewGetCartByIdRequest generates requests for GetCartById

func NewGetCartsRequest

func NewGetCartsRequest(server string, params *GetCartsParams) (*http.Request, error)

NewGetCartsRequest generates requests for GetCarts

func NewSearchCartsRequest

func NewSearchCartsRequest(server string, body SearchCartsJSONRequestBody) (*http.Request, error)

NewSearchCartsRequest calls the generic SearchCarts builder with application/json body

func NewSearchCartsRequestWithBody

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

NewSearchCartsRequestWithBody generates requests for SearchCarts with any type of body

func NewUpdateCartRequest

func NewUpdateCartRequest(server string, cartId string, body UpdateCartJSONRequestBody) (*http.Request, error)

NewUpdateCartRequest calls the generic UpdateCart builder with application/json body

func NewUpdateCartRequestWithBody

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

NewUpdateCartRequestWithBody generates requests for UpdateCart with any type of body

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Archived

type Archived = bool

Archived defines model for Archived.

type AssociationRequest

type AssociationRequest struct {
	To    *AssociationTarget `json:"to,omitempty"`
	Types *[]AssociationType `json:"types,omitempty"`
}

AssociationRequest defines model for AssociationRequest.

type AssociationTarget

type AssociationTarget struct {
	Id *string `json:"id,omitempty"`
}

AssociationTarget defines model for AssociationTarget.

type AssociationType

type AssociationType struct {
	AssociationCategory *AssociationTypeAssociationCategory `json:"associationCategory,omitempty"`
}

AssociationType defines model for AssociationType.

type AssociationTypeAssociationCategory

type AssociationTypeAssociationCategory string

AssociationTypeAssociationCategory defines model for AssociationType.AssociationCategory.

const (
	AssociationCategoryHubspotDefined    AssociationTypeAssociationCategory = "HUBSPOT_DEFINED"
	AssociationCategoryIntegratorDefined AssociationTypeAssociationCategory = "INTEGRATOR_DEFINED"
	AssociationCategoryUserDefined       AssociationTypeAssociationCategory = "USER_DEFINED"
)

Defines values for AssociationTypeAssociationCategory.

type Associations

type Associations = []string

Associations defines model for Associations.

type BatchCartsResponse

type BatchCartsResponse struct {
	Errors  *[]ErrorItem              `json:"errors,omitempty"`
	Results *[]CartResponse           `json:"results,omitempty"`
	Status  *BatchCartsResponseStatus `json:"status,omitempty"`
}

BatchCartsResponse defines model for BatchCartsResponse.

type BatchCartsResponseStatus

type BatchCartsResponseStatus string

BatchCartsResponseStatus defines model for BatchCartsResponse.Status.

const (
	COMPLETE   BatchCartsResponseStatus = "COMPLETE"
	PENDING    BatchCartsResponseStatus = "PENDING"
	PROCESSING BatchCartsResponseStatus = "PROCESSING"
)

Defines values for BatchCartsResponseStatus.

type BatchCartsUpsertRequest

type BatchCartsUpsertRequest struct {
	Inputs []BatchInputItem `json:"inputs"`
}

BatchCartsUpsertRequest defines model for BatchCartsUpsertRequest.

type BatchInputItem

type BatchInputItem struct {
	Associations *[]AssociationRequest `json:"associations,omitempty"`

	// Id The ID of the product to update (optional for creates)
	Id string `json:"id"`

	// IdProperty The name of a property whose values are unique for this object
	IdProperty *string           `json:"idProperty,omitempty"`
	Properties map[string]string `json:"properties"`
}

BatchInputItem defines model for BatchInputItem.

type BatchUpsertCartsJSONRequestBody

type BatchUpsertCartsJSONRequestBody = BatchCartsUpsertRequest

BatchUpsertCartsJSONRequestBody defines body for BatchUpsertCarts for application/json ContentType.

type BatchUpsertCartsResponse

type BatchUpsertCartsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BatchCartsResponse
	JSON400      *ErrorResponse
}

func ParseBatchUpsertCartsResponse

func ParseBatchUpsertCartsResponse(rsp *http.Response) (*BatchUpsertCartsResponse, error)

ParseBatchUpsertCartsResponse parses an HTTP response from a BatchUpsertCartsWithResponse call

func (BatchUpsertCartsResponse) Status

func (r BatchUpsertCartsResponse) Status() string

Status returns HTTPResponse.Status

func (BatchUpsertCartsResponse) StatusCode

func (r BatchUpsertCartsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CartResponse

type CartResponse struct {
	// Archived Indicates if the discount is archived.
	Archived bool `json:"archived,omitempty"`

	// ArchivedAt When the discount was archived.
	ArchivedAt time.Time `json:"archivedAt,omitempty"`

	// CreatedAt When the discount was created.
	CreatedAt time.Time `json:"createdAt,omitempty"`

	// Id Unique identifier for the discount.
	Id string `json:"id,omitempty"`

	// ObjectWriteTraceId Unique trace ID for the operation.
	ObjectWriteTraceId string `json:"objectWriteTraceId,omitempty"`

	// Properties A key-value map of the contact's properties.
	Properties map[string]string `json:"properties,omitempty"`

	// PropertiesWithHistory A map of the contact's properties including historical values.
	PropertiesWithHistory map[string][]PropertyHistory `json:"propertiesWithHistory,omitempty"`

	// UpdatedAt When the discount was last updated.
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

CartResponse defines model for CartResponse.

type CartsResponse

type CartsResponse struct {
	Paging  *Paging        `json:"paging,omitempty"`
	Results []CartResponse `json:"results,omitempty"`
}

CartsResponse defines model for CartsResponse.

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

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

func (*Client) BatchUpsertCartsWithBody

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

func (*Client) CreateCart

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

func (*Client) CreateCartWithBody

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

func (*Client) DeleteCartById

func (c *Client) DeleteCartById(ctx context.Context, cartId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCartById

func (c *Client) GetCartById(ctx context.Context, cartId string, params *GetCartByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetCarts

func (c *Client) GetCarts(ctx context.Context, params *GetCartsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SearchCarts

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

func (*Client) SearchCartsWithBody

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

func (*Client) UpdateCart

func (c *Client) UpdateCart(ctx context.Context, cartId string, body UpdateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateCartWithBody

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

type ClientInterface

type ClientInterface interface {
	// GetCarts request
	GetCarts(ctx context.Context, params *GetCartsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCartWithBody request with any body
	CreateCartWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateCart(ctx context.Context, body CreateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// BatchUpsertCartsWithBody request with any body
	BatchUpsertCartsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	BatchUpsertCarts(ctx context.Context, body BatchUpsertCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchCartsWithBody request with any body
	SearchCartsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SearchCarts(ctx context.Context, body SearchCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteCartById request
	DeleteCartById(ctx context.Context, cartId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCartById request
	GetCartById(ctx context.Context, cartId string, params *GetCartByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateCartWithBody request with any body
	UpdateCartWithBody(ctx context.Context, cartId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateCart(ctx context.Context, cartId string, body UpdateCartJSONRequestBody, 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) BatchUpsertCartsWithBodyWithResponse

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

BatchUpsertCartsWithBodyWithResponse request with arbitrary body returning *BatchUpsertCartsResponse

func (*ClientWithResponses) BatchUpsertCartsWithResponse

func (c *ClientWithResponses) BatchUpsertCartsWithResponse(ctx context.Context, body BatchUpsertCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchUpsertCartsResponse, error)

func (*ClientWithResponses) CreateCartWithBodyWithResponse

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

CreateCartWithBodyWithResponse request with arbitrary body returning *CreateCartResponse

func (*ClientWithResponses) CreateCartWithResponse

func (c *ClientWithResponses) CreateCartWithResponse(ctx context.Context, body CreateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCartResponse, error)

func (*ClientWithResponses) DeleteCartByIdWithResponse

func (c *ClientWithResponses) DeleteCartByIdWithResponse(ctx context.Context, cartId string, reqEditors ...RequestEditorFn) (*DeleteCartByIdResponse, error)

DeleteCartByIdWithResponse request returning *DeleteCartByIdResponse

func (*ClientWithResponses) GetCartByIdWithResponse

func (c *ClientWithResponses) GetCartByIdWithResponse(ctx context.Context, cartId string, params *GetCartByIdParams, reqEditors ...RequestEditorFn) (*GetCartByIdResponse, error)

GetCartByIdWithResponse request returning *GetCartByIdResponse

func (*ClientWithResponses) GetCartsWithResponse

func (c *ClientWithResponses) GetCartsWithResponse(ctx context.Context, params *GetCartsParams, reqEditors ...RequestEditorFn) (*GetCartsResponse, error)

GetCartsWithResponse request returning *GetCartsResponse

func (*ClientWithResponses) SearchCartsWithBodyWithResponse

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

SearchCartsWithBodyWithResponse request with arbitrary body returning *SearchCartsResponse

func (*ClientWithResponses) SearchCartsWithResponse

func (c *ClientWithResponses) SearchCartsWithResponse(ctx context.Context, body SearchCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchCartsResponse, error)

func (*ClientWithResponses) UpdateCartWithBodyWithResponse

func (c *ClientWithResponses) UpdateCartWithBodyWithResponse(ctx context.Context, cartId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCartResponse, error)

UpdateCartWithBodyWithResponse request with arbitrary body returning *UpdateCartResponse

func (*ClientWithResponses) UpdateCartWithResponse

func (c *ClientWithResponses) UpdateCartWithResponse(ctx context.Context, cartId string, body UpdateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCartResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetCartsWithResponse request
	GetCartsWithResponse(ctx context.Context, params *GetCartsParams, reqEditors ...RequestEditorFn) (*GetCartsResponse, error)

	// CreateCartWithBodyWithResponse request with any body
	CreateCartWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCartResponse, error)

	CreateCartWithResponse(ctx context.Context, body CreateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCartResponse, error)

	// BatchUpsertCartsWithBodyWithResponse request with any body
	BatchUpsertCartsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BatchUpsertCartsResponse, error)

	BatchUpsertCartsWithResponse(ctx context.Context, body BatchUpsertCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchUpsertCartsResponse, error)

	// SearchCartsWithBodyWithResponse request with any body
	SearchCartsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchCartsResponse, error)

	SearchCartsWithResponse(ctx context.Context, body SearchCartsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchCartsResponse, error)

	// DeleteCartByIdWithResponse request
	DeleteCartByIdWithResponse(ctx context.Context, cartId string, reqEditors ...RequestEditorFn) (*DeleteCartByIdResponse, error)

	// GetCartByIdWithResponse request
	GetCartByIdWithResponse(ctx context.Context, cartId string, params *GetCartByIdParams, reqEditors ...RequestEditorFn) (*GetCartByIdResponse, error)

	// UpdateCartWithBodyWithResponse request with any body
	UpdateCartWithBodyWithResponse(ctx context.Context, cartId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCartResponse, error)

	UpdateCartWithResponse(ctx context.Context, cartId string, body UpdateCartJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCartResponse, error)
}

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

type CreateCartJSONBody

type CreateCartJSONBody struct {
	// Associations List of associations for the cart.
	Associations *[]struct {
		// To Target object details for the association.
		To *struct {
			// Id Target object ID.
			Id *string `json:"id,omitempty"`
		} `json:"to,omitempty"`
		Types *[]struct {
			// AssociationCategory Category of the association.
			AssociationCategory *CreateCartJSONBodyAssociationsTypesAssociationCategory `json:"associationCategory,omitempty"`

			// AssociationTypeId ID of the association type.
			AssociationTypeId *int32 `json:"associationTypeId,omitempty"`
		} `json:"types,omitempty"`
	} `json:"associations,omitempty"`

	// Properties Key-value pairs of cart properties.
	Properties map[string]string `json:"properties"`
}

CreateCartJSONBody defines parameters for CreateCart.

type CreateCartJSONBodyAssociationsTypesAssociationCategory

type CreateCartJSONBodyAssociationsTypesAssociationCategory string

CreateCartJSONBodyAssociationsTypesAssociationCategory defines parameters for CreateCart.

Defines values for CreateCartJSONBodyAssociationsTypesAssociationCategory.

type CreateCartJSONRequestBody

type CreateCartJSONRequestBody CreateCartJSONBody

CreateCartJSONRequestBody defines body for CreateCart for application/json ContentType.

type CreateCartResponse

type CreateCartResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *CartResponse
}

func ParseCreateCartResponse

func ParseCreateCartResponse(rsp *http.Response) (*CreateCartResponse, error)

ParseCreateCartResponse parses an HTTP response from a CreateCartWithResponse call

func (CreateCartResponse) Status

func (r CreateCartResponse) Status() string

Status returns HTTPResponse.Status

func (CreateCartResponse) StatusCode

func (r CreateCartResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteCartByIdResponse

type DeleteCartByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteCartByIdResponse

func ParseDeleteCartByIdResponse(rsp *http.Response) (*DeleteCartByIdResponse, error)

ParseDeleteCartByIdResponse parses an HTTP response from a DeleteCartByIdWithResponse call

func (DeleteCartByIdResponse) Status

func (r DeleteCartByIdResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteCartByIdResponse) StatusCode

func (r DeleteCartByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Error

type Error struct {
	Category      *string            `json:"category,omitempty"`
	Context       *ErrorContext      `json:"context,omitempty"`
	CorrelationId *string            `json:"correlationId,omitempty"`
	Errors        *[]ErrorDetail     `json:"errors,omitempty"`
	Links         *map[string]string `json:"links,omitempty"`
	Message       *string            `json:"message,omitempty"`
	SubCategory   *string            `json:"subCategory,omitempty"`
}

Error defines model for Error.

type ErrorContext

type ErrorContext struct {
	InvalidPropertyName *[]string `json:"invalidPropertyName,omitempty"`
	MissingScopes       *[]string `json:"missingScopes,omitempty"`
}

ErrorContext defines model for ErrorContext.

type ErrorDetail

type ErrorDetail struct {
	Code        *string                 `json:"code,omitempty"`
	Context     *map[string]interface{} `json:"context,omitempty"`
	In          *string                 `json:"in,omitempty"`
	Message     *string                 `json:"message,omitempty"`
	SubCategory *string                 `json:"subCategory,omitempty"`
}

ErrorDetail defines model for ErrorDetail.

type ErrorItem

type ErrorItem struct {
	Context   *map[string]interface{} `json:"context,omitempty"`
	ErrorType *string                 `json:"errorType,omitempty"`
	Message   *string                 `json:"message,omitempty"`
}

ErrorItem defines model for ErrorItem.

type ErrorResponse

type ErrorResponse = Error

ErrorResponse defines model for ErrorResponse.

type Filter

type Filter struct {
	// HighValue A high-value filter criterion.
	HighValue string `json:"highValue,omitempty"`

	// Operator defines model for Filter.Operator
	Operator FilterOperator `json:"operator,omitempty"`

	// PropertyName The property name to filter by.
	PropertyName string `json:"propertyName,omitempty"`

	// Value A single value to match for the property.
	Value string `json:"value,omitempty"`

	// Values List of values to match for the property.
	Values []string `json:"values,omitempty"`
}

Filter defines model for Filter.

type FilterGroups

type FilterGroups struct {
	Filters []Filter `json:"filters,omitempty"`
}

FilterGroups defines model for FilterGroups.

type FilterOperator

type FilterOperator string

FilterOperator defines model for Filter.Operator

const (
	CONTAINSTOKEN    FilterOperator = "CONTAINS_TOKEN"
	EQ               FilterOperator = "EQ"
	GT               FilterOperator = "GT"
	GTE              FilterOperator = "GTE"
	HASPROPERTY      FilterOperator = "HAS_PROPERTY"
	LT               FilterOperator = "LT"
	LTE              FilterOperator = "LTE"
	NEQ              FilterOperator = "NEQ"
	NOTCONTAINSTOKEN FilterOperator = "NOT_CONTAINS_TOKEN"
	NOTHASPROPERTY   FilterOperator = "NOT_HAS_PROPERTY"
)

Defines values for FilterOperator.

type GetCartByIdParams

type GetCartByIdParams struct {
	// Properties Properties to include in the response.
	Properties *[]string `form:"properties,omitempty" json:"properties,omitempty"`

	// PropertiesWithHistory Properties to include with their history.
	PropertiesWithHistory *[]string `form:"propertiesWithHistory,omitempty" json:"propertiesWithHistory,omitempty"`

	// Associations Associations to include in the response.
	Associations *string `form:"associations,omitempty" json:"associations,omitempty"`

	// Archived Whether to include archived carts.
	Archived *bool `form:"archived,omitempty" json:"archived,omitempty"`
}

GetCartByIdParams defines parameters for GetCartById.

type GetCartByIdResponse

type GetCartByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CartResponse
}

func ParseGetCartByIdResponse

func ParseGetCartByIdResponse(rsp *http.Response) (*GetCartByIdResponse, error)

ParseGetCartByIdResponse parses an HTTP response from a GetCartByIdWithResponse call

func (GetCartByIdResponse) Status

func (r GetCartByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetCartByIdResponse) StatusCode

func (r GetCartByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCartsParams

type GetCartsParams struct {
	// Limit Maximum number of results per page.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor token for the next page of results.
	After *string `form:"after,omitempty" json:"after,omitempty"`

	// Properties Comma-separated list of properties to include in the response.
	// If a specified property is not present, it will be ignored.
	Properties *Properties `form:"properties,omitempty" json:"properties,omitempty"`

	// PropertiesWithHistory Comma-separated list of properties to include with their historical values.
	// Historical data reduces the maximum number of objects returned per request.
	PropertiesWithHistory *PropertiesWithHistory `form:"propertiesWithHistory,omitempty" json:"propertiesWithHistory,omitempty"`

	// Associations Comma-separated list of object types to retrieve associated IDs for.
	// Nonexistent associations will be ignored.
	Associations *Associations `form:"associations,omitempty" json:"associations,omitempty"`

	// Archived Include only archived results.
	Archived *Archived `form:"archived,omitempty" json:"archived,omitempty"`
}

GetCartsParams defines parameters for GetCarts.

type GetCartsResponse

type GetCartsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CartsResponse
}

func ParseGetCartsResponse

func ParseGetCartsResponse(rsp *http.Response) (*GetCartsResponse, error)

ParseGetCartsResponse parses an HTTP response from a GetCartsWithResponse call

func (GetCartsResponse) Status

func (r GetCartsResponse) Status() string

Status returns HTTPResponse.Status

func (GetCartsResponse) StatusCode

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

type Paging struct {
	Next PagingNext `json:"next,omitempty"`
}

Paging defines model for Paging.

type PagingNext

type PagingNext struct {
	// After The cursor token for the next page of results.
	After string `json:"after,omitempty"`

	// Link The link for the next page of results.
	Link string `json:"link,omitempty"`
}

PagingNext defines model for PagingNext.

type Properties

type Properties = []string

Properties defines model for Properties.

type PropertiesWithHistory

type PropertiesWithHistory = []string

PropertiesWithHistory defines model for PropertiesWithHistory.

type PropertyHistory

type PropertyHistory struct {
	// SourceId The source ID of the historical property value.
	SourceId string `json:"sourceId,omitempty"`

	// SourceLabel The source label for the historical property.
	SourceLabel string `json:"sourceLabel,omitempty"`

	// SourceType The source type of the historical property value.
	SourceType string `json:"sourceType,omitempty"`

	// Timestamp When the property value was set.
	Timestamp time.Time `json:"timestamp,omitempty"`

	// UpdatedByUserId The user ID who updated the property.
	UpdatedByUserId int `json:"updatedByUserId,omitempty"`

	// Value The historical value of the property.
	Value string `json:"value,omitempty"`
}

PropertyHistory defines model for PropertyHistory.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type SearchCartsJSONBody

type SearchCartsJSONBody struct {
	After        *string        `json:"after,omitempty"`
	FilterGroups []FilterGroups `json:"filterGroups,omitempty"`
	Limit        *int           `json:"limit,omitempty"`
	Properties   *[]string      `json:"properties,omitempty"`
	Query        *string        `json:"query,omitempty"`
	Sorts        *[]string      `json:"sorts,omitempty"`
}

SearchCartsJSONBody defines parameters for SearchCarts.

type SearchCartsJSONRequestBody

type SearchCartsJSONRequestBody SearchCartsJSONBody

SearchCartsJSONRequestBody defines body for SearchCarts for application/json ContentType.

type SearchCartsResponse

type SearchCartsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *CartsResponse
}

func ParseSearchCartsResponse

func ParseSearchCartsResponse(rsp *http.Response) (*SearchCartsResponse, error)

ParseSearchCartsResponse parses an HTTP response from a SearchCartsWithResponse call

func (SearchCartsResponse) Status

func (r SearchCartsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchCartsResponse) StatusCode

func (r SearchCartsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchParams

type SearchParams struct {
	After      *int         `json:"after,omitempty"`
	Limit      *int         `json:"limit,omitempty"`
	Properties *[]string    `json:"properties,omitempty"`
	Query      *string      `json:"query,omitempty"`
	Schema     FilterGroups `json:"schema,omitempty"`

	// Sorts Use a sorting rule in the request body to see results in a specific order (ascending or descending). Only one sorting rule can be applied to any search.
	Sorts *[]Sort `json:"sorts,omitempty"`
}

SearchParams defines model for SearchParams.

type ServerInterface

type ServerInterface interface {
	// Retrieve a list of carts
	// (GET /crm/v3/objects/carts)
	GetCarts(ctx echo.Context, params GetCartsParams) error
	// Create a single cart
	// (POST /crm/v3/objects/carts)
	CreateCart(ctx echo.Context) error
	// Batch create or update carts
	// (POST /crm/v3/objects/carts/batch/upsert)
	BatchUpsertCarts(ctx echo.Context) error
	// Search for carts
	// (POST /crm/v3/objects/carts/search)
	SearchCarts(ctx echo.Context) error
	// Delete a cart
	// (DELETE /crm/v3/objects/carts/{cartId})
	DeleteCartById(ctx echo.Context, cartId string) error
	// Get a cart by ID
	// (GET /crm/v3/objects/carts/{cartId})
	GetCartById(ctx echo.Context, cartId string, params GetCartByIdParams) error
	// Update a cart
	// (PATCH /crm/v3/objects/carts/{cartId})
	UpdateCart(ctx echo.Context, cartId string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) BatchUpsertCarts

func (w *ServerInterfaceWrapper) BatchUpsertCarts(ctx echo.Context) error

BatchUpsertCarts converts echo context to params.

func (*ServerInterfaceWrapper) CreateCart

func (w *ServerInterfaceWrapper) CreateCart(ctx echo.Context) error

CreateCart converts echo context to params.

func (*ServerInterfaceWrapper) DeleteCartById

func (w *ServerInterfaceWrapper) DeleteCartById(ctx echo.Context) error

DeleteCartById converts echo context to params.

func (*ServerInterfaceWrapper) GetCartById

func (w *ServerInterfaceWrapper) GetCartById(ctx echo.Context) error

GetCartById converts echo context to params.

func (*ServerInterfaceWrapper) GetCarts

func (w *ServerInterfaceWrapper) GetCarts(ctx echo.Context) error

GetCarts converts echo context to params.

func (*ServerInterfaceWrapper) SearchCarts

func (w *ServerInterfaceWrapper) SearchCarts(ctx echo.Context) error

SearchCarts converts echo context to params.

func (*ServerInterfaceWrapper) UpdateCart

func (w *ServerInterfaceWrapper) UpdateCart(ctx echo.Context) error

UpdateCart converts echo context to params.

type Sort

type Sort struct {
	Direction    *SortDirection `json:"direction,omitempty"`
	PropertyName *string        `json:"propertyName,omitempty"`
}

Sort defines model for Sort.

type SortDirection

type SortDirection string

SortDirection defines model for Sort.Direction.

const (
	ASCENDING  SortDirection = "ASCENDING"
	DESCENDING SortDirection = "DESCENDING"
)

Defines values for SortDirection.

type UpdateCartJSONBody

type UpdateCartJSONBody struct {
	// Properties Key-value pairs representing the deal properties to update.
	Properties map[string]string `json:"properties"`
}

UpdateCartJSONBody defines parameters for UpdateCart.

type UpdateCartJSONRequestBody

type UpdateCartJSONRequestBody UpdateCartJSONBody

UpdateCartJSONRequestBody defines body for UpdateCart for application/json ContentType.

type UpdateCartResponse

type UpdateCartResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Archived Whether the customer is archived or not.
		Archived bool `json:"archived,omitempty"`

		// ArchivedAt Timestamp when the cart was archived.
		ArchivedAt time.Time `json:"archivedAt,omitempty"`

		// CreatedAt Timestamp when the cart was created.
		CreatedAt time.Time `json:"createdAt,omitempty"`

		// Id Unique ID of the updated cart.
		Id string `json:"id,omitempty"`

		// Properties Properties of the updated cart.
		Properties map[string]interface{} `json:"properties,omitempty"`

		// PropertiesWithHistory A map of the cart's properties including historical values.
		PropertiesWithHistory map[string][]PropertyHistory `json:"propertiesWithHistory,omitempty"`

		// UpdatedAt Timestamp when the cart was last updated.
		UpdatedAt time.Time `json:"updatedAt,omitempty"`
	}
}

func ParseUpdateCartResponse

func ParseUpdateCartResponse(rsp *http.Response) (*UpdateCartResponse, error)

ParseUpdateCartResponse parses an HTTP response from a UpdateCartWithResponse call

func (UpdateCartResponse) Status

func (r UpdateCartResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateCartResponse) StatusCode

func (r UpdateCartResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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