products

package
v0.0.19 Latest Latest
Warning

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

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

Documentation

Overview

Package products 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 products 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 products 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 NewBatchUpsertProductsRequest added in v0.0.16

func NewBatchUpsertProductsRequest(server string, body BatchUpsertProductsJSONRequestBody) (*http.Request, error)

NewBatchUpsertProductsRequest calls the generic BatchUpsertProducts builder with application/json body

func NewBatchUpsertProductsRequestWithBody added in v0.0.16

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

NewBatchUpsertProductsRequestWithBody generates requests for BatchUpsertProducts with any type of body

func NewCreateProductRequest

func NewCreateProductRequest(server string, body CreateProductJSONRequestBody) (*http.Request, error)

NewCreateProductRequest calls the generic CreateProduct builder with application/json body

func NewCreateProductRequestWithBody

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

NewCreateProductRequestWithBody generates requests for CreateProduct with any type of body

func NewDeleteProductByIdRequest

func NewDeleteProductByIdRequest(server string, productId string) (*http.Request, error)

NewDeleteProductByIdRequest generates requests for DeleteProductById

func NewGetProductByIdRequest

func NewGetProductByIdRequest(server string, productId string, params *GetProductByIdParams) (*http.Request, error)

NewGetProductByIdRequest generates requests for GetProductById

func NewGetProductsRequest

func NewGetProductsRequest(server string, params *GetProductsParams) (*http.Request, error)

NewGetProductsRequest generates requests for GetProducts

func NewSearchProductsRequest added in v0.0.7

func NewSearchProductsRequest(server string, body SearchProductsJSONRequestBody) (*http.Request, error)

NewSearchProductsRequest calls the generic SearchProducts builder with application/json body

func NewSearchProductsRequestWithBody added in v0.0.7

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

NewSearchProductsRequestWithBody generates requests for SearchProducts with any type of body

func NewUpdateProductRequest

func NewUpdateProductRequest(server string, productId string, body UpdateProductJSONRequestBody) (*http.Request, error)

NewUpdateProductRequest calls the generic UpdateProduct builder with application/json body

func NewUpdateProductRequestWithBody

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

NewUpdateProductRequestWithBody generates requests for UpdateProduct 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 added in v0.0.16

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

AssociationRequest defines model for AssociationRequest.

type AssociationResponse

type AssociationResponse struct {
	// Id The ID of the associated object.
	Id *string `json:"id,omitempty"`

	// Type The type of association.
	Type *string `json:"type,omitempty"`
}

AssociationResponse defines model for AssociationResponse.

type AssociationTarget added in v0.0.16

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

AssociationTarget defines model for AssociationTarget.

type AssociationType added in v0.0.16

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

AssociationType defines model for AssociationType.

type AssociationTypeAssociationCategory added in v0.0.16

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 BatchInputItem added in v0.0.16

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 BatchProductsResponse added in v0.0.16

type BatchProductsResponse struct {
	Errors  *[]ErrorItem                 `json:"errors,omitempty"`
	Results *[]ProductResponse           `json:"results,omitempty"`
	Status  *BatchProductsResponseStatus `json:"status,omitempty"`
}

BatchProductsResponse defines model for BatchProductsResponse.

type BatchProductsResponseStatus added in v0.0.16

type BatchProductsResponseStatus string

BatchProductsResponseStatus defines model for BatchProductsResponse.Status.

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

Defines values for BatchProductsResponseStatus.

type BatchProductsUpsertRequest added in v0.0.16

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

BatchProductsUpsertRequest defines model for BatchProductsUpsertRequest.

type BatchUpsertProductsJSONRequestBody added in v0.0.16

type BatchUpsertProductsJSONRequestBody = BatchProductsUpsertRequest

BatchUpsertProductsJSONRequestBody defines body for BatchUpsertProducts for application/json ContentType.

type BatchUpsertProductsResponse added in v0.0.16

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

func ParseBatchUpsertProductsResponse added in v0.0.16

func ParseBatchUpsertProductsResponse(rsp *http.Response) (*BatchUpsertProductsResponse, error)

ParseBatchUpsertProductsResponse parses an HTTP response from a BatchUpsertProductsWithResponse call

func (BatchUpsertProductsResponse) Status added in v0.0.16

Status returns HTTPResponse.Status

func (BatchUpsertProductsResponse) StatusCode added in v0.0.16

func (r BatchUpsertProductsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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) BatchUpsertProducts added in v0.0.16

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

func (*Client) BatchUpsertProductsWithBody added in v0.0.16

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

func (*Client) CreateProduct

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

func (*Client) CreateProductWithBody

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

func (*Client) DeleteProductById

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

func (*Client) GetProductById

func (c *Client) GetProductById(ctx context.Context, productId string, params *GetProductByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetProducts

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

func (*Client) SearchProducts added in v0.0.7

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

func (*Client) SearchProductsWithBody added in v0.0.7

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

func (*Client) UpdateProduct

func (c *Client) UpdateProduct(ctx context.Context, productId string, body UpdateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateProductWithBody

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

type ClientInterface

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

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

	CreateProduct(ctx context.Context, body CreateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	BatchUpsertProducts(ctx context.Context, body BatchUpsertProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	SearchProducts(ctx context.Context, body SearchProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetProductById request
	GetProductById(ctx context.Context, productId string, params *GetProductByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	UpdateProduct(ctx context.Context, productId string, body UpdateProductJSONRequestBody, 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) BatchUpsertProductsWithBodyWithResponse added in v0.0.16

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

BatchUpsertProductsWithBodyWithResponse request with arbitrary body returning *BatchUpsertProductsResponse

func (*ClientWithResponses) BatchUpsertProductsWithResponse added in v0.0.16

func (c *ClientWithResponses) BatchUpsertProductsWithResponse(ctx context.Context, body BatchUpsertProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchUpsertProductsResponse, error)

func (*ClientWithResponses) CreateProductWithBodyWithResponse

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

CreateProductWithBodyWithResponse request with arbitrary body returning *CreateProductResponse

func (*ClientWithResponses) CreateProductWithResponse

func (c *ClientWithResponses) CreateProductWithResponse(ctx context.Context, body CreateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProductResponse, error)

func (*ClientWithResponses) DeleteProductByIdWithResponse

func (c *ClientWithResponses) DeleteProductByIdWithResponse(ctx context.Context, productId string, reqEditors ...RequestEditorFn) (*DeleteProductByIdResponse, error)

DeleteProductByIdWithResponse request returning *DeleteProductByIdResponse

func (*ClientWithResponses) GetProductByIdWithResponse

func (c *ClientWithResponses) GetProductByIdWithResponse(ctx context.Context, productId string, params *GetProductByIdParams, reqEditors ...RequestEditorFn) (*GetProductByIdResponse, error)

GetProductByIdWithResponse request returning *GetProductByIdResponse

func (*ClientWithResponses) GetProductsWithResponse

func (c *ClientWithResponses) GetProductsWithResponse(ctx context.Context, params *GetProductsParams, reqEditors ...RequestEditorFn) (*GetProductsResponse, error)

GetProductsWithResponse request returning *GetProductsResponse

func (*ClientWithResponses) SearchProductsWithBodyWithResponse added in v0.0.7

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

SearchProductsWithBodyWithResponse request with arbitrary body returning *SearchProductsResponse

func (*ClientWithResponses) SearchProductsWithResponse added in v0.0.7

func (c *ClientWithResponses) SearchProductsWithResponse(ctx context.Context, body SearchProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchProductsResponse, error)

func (*ClientWithResponses) UpdateProductWithBodyWithResponse

func (c *ClientWithResponses) UpdateProductWithBodyWithResponse(ctx context.Context, productId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateProductResponse, error)

UpdateProductWithBodyWithResponse request with arbitrary body returning *UpdateProductResponse

func (*ClientWithResponses) UpdateProductWithResponse

func (c *ClientWithResponses) UpdateProductWithResponse(ctx context.Context, productId string, body UpdateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateProductResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetProductsWithResponse request
	GetProductsWithResponse(ctx context.Context, params *GetProductsParams, reqEditors ...RequestEditorFn) (*GetProductsResponse, error)

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

	CreateProductWithResponse(ctx context.Context, body CreateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProductResponse, error)

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

	BatchUpsertProductsWithResponse(ctx context.Context, body BatchUpsertProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchUpsertProductsResponse, error)

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

	SearchProductsWithResponse(ctx context.Context, body SearchProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchProductsResponse, error)

	// DeleteProductByIdWithResponse request
	DeleteProductByIdWithResponse(ctx context.Context, productId string, reqEditors ...RequestEditorFn) (*DeleteProductByIdResponse, error)

	// GetProductByIdWithResponse request
	GetProductByIdWithResponse(ctx context.Context, productId string, params *GetProductByIdParams, reqEditors ...RequestEditorFn) (*GetProductByIdResponse, error)

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

	UpdateProductWithResponse(ctx context.Context, productId string, body UpdateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateProductResponse, error)
}

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

type CreateProductJSONBody

type CreateProductJSONBody struct {
	// Associations List of associations for the product.
	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 *CreateProductJSONBodyAssociationsTypesAssociationCategory `json:"associationCategory,omitempty"`

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

	// ObjectWriteTraceId Trace ID for object write operations.
	ObjectWriteTraceId *string `json:"objectWriteTraceId,omitempty"`

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

CreateProductJSONBody defines parameters for CreateProduct.

type CreateProductJSONBodyAssociationsTypesAssociationCategory added in v0.0.9

type CreateProductJSONBodyAssociationsTypesAssociationCategory string

CreateProductJSONBodyAssociationsTypesAssociationCategory defines parameters for CreateProduct.

Defines values for CreateProductJSONBodyAssociationsTypesAssociationCategory.

type CreateProductJSONRequestBody

type CreateProductJSONRequestBody CreateProductJSONBody

CreateProductJSONRequestBody defines body for CreateProduct for application/json ContentType.

type CreateProductResponse

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

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

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

		// Id Unique ID of the created product.
		Id string `json:"id,omitempty"`

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

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

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

func ParseCreateProductResponse

func ParseCreateProductResponse(rsp *http.Response) (*CreateProductResponse, error)

ParseCreateProductResponse parses an HTTP response from a CreateProductWithResponse call

func (CreateProductResponse) Status

func (r CreateProductResponse) Status() string

Status returns HTTPResponse.Status

func (CreateProductResponse) StatusCode

func (r CreateProductResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteProductByIdResponse

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

func ParseDeleteProductByIdResponse

func ParseDeleteProductByIdResponse(rsp *http.Response) (*DeleteProductByIdResponse, error)

ParseDeleteProductByIdResponse parses an HTTP response from a DeleteProductByIdWithResponse call

func (DeleteProductByIdResponse) Status

func (r DeleteProductByIdResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteProductByIdResponse) StatusCode

func (r DeleteProductByIdResponse) 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 added in v0.0.16

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 added in v0.0.16

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

ErrorContext defines model for ErrorContext.

type ErrorDetail added in v0.0.16

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 added in v0.0.16

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 added in v0.0.16

type ErrorResponse = Error

ErrorResponse defines model for ErrorResponse.

type Filter added in v0.0.7

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 added in v0.0.9

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

FilterGroups defines model for FilterGroups.

type FilterOperator added in v0.0.7

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 GetProductByIdParams

type GetProductByIdParams struct {
	// IdProperty The property to use as the ID.
	IdProperty *string `form:"idProperty,omitempty" json:"idProperty,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"`
}

GetProductByIdParams defines parameters for GetProductById.

type GetProductByIdResponse

type GetProductByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ProductResponse
}

func ParseGetProductByIdResponse

func ParseGetProductByIdResponse(rsp *http.Response) (*GetProductByIdResponse, error)

ParseGetProductByIdResponse parses an HTTP response from a GetProductByIdWithResponse call

func (GetProductByIdResponse) Status

func (r GetProductByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetProductByIdResponse) StatusCode

func (r GetProductByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetProductsParams

type GetProductsParams 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"`
}

GetProductsParams defines parameters for GetProducts.

type GetProductsResponse

type GetProductsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ProductsResponse
}

func ParseGetProductsResponse

func ParseGetProductsResponse(rsp *http.Response) (*GetProductsResponse, error)

ParseGetProductsResponse parses an HTTP response from a GetProductsWithResponse call

func (GetProductsResponse) Status

func (r GetProductsResponse) Status() string

Status returns HTTPResponse.Status

func (GetProductsResponse) StatusCode

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

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

ObjectAssociationsResponse defines model for ObjectAssociationsResponse.

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 ProductResponse

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

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

	// Associations A map of associated objects.
	Associations map[string]ObjectAssociationsResponse `json:"associations,omitempty"`

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

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

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

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

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

ProductResponse defines model for ProductResponse.

type ProductsResponse

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

ProductsResponse defines model for ProductsResponse.

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 SearchProductsJSONBody added in v0.0.7

type SearchProductsJSONBody 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"`
}

SearchProductsJSONBody defines parameters for SearchProducts.

type SearchProductsJSONRequestBody added in v0.0.7

type SearchProductsJSONRequestBody SearchProductsJSONBody

SearchProductsJSONRequestBody defines body for SearchProducts for application/json ContentType.

type SearchProductsResponse added in v0.0.7

type SearchProductsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ProductsResponse
}

func ParseSearchProductsResponse added in v0.0.7

func ParseSearchProductsResponse(rsp *http.Response) (*SearchProductsResponse, error)

ParseSearchProductsResponse parses an HTTP response from a SearchProductsWithResponse call

func (SearchProductsResponse) Status added in v0.0.7

func (r SearchProductsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchProductsResponse) StatusCode added in v0.0.7

func (r SearchProductsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ServerInterface

type ServerInterface interface {
	// Retrieve a list of products
	// (GET /crm/v3/objects/products)
	GetProducts(ctx echo.Context, params GetProductsParams) error
	// Create a new product
	// (POST /crm/v3/objects/products)
	CreateProduct(ctx echo.Context) error
	// Batch create or update products
	// (POST /crm/v3/objects/products/batch/upsert)
	BatchUpsertProducts(ctx echo.Context) error
	// Search for products by email
	// (POST /crm/v3/objects/products/search)
	SearchProducts(ctx echo.Context) error
	// Delete a product
	// (DELETE /crm/v3/objects/products/{productId})
	DeleteProductById(ctx echo.Context, productId string) error
	// Get Product Details
	// (GET /crm/v3/objects/products/{productId})
	GetProductById(ctx echo.Context, productId string, params GetProductByIdParams) error
	// Update a product
	// (PATCH /crm/v3/objects/products/{productId})
	UpdateProduct(ctx echo.Context, productId string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) BatchUpsertProducts added in v0.0.16

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

BatchUpsertProducts converts echo context to params.

func (*ServerInterfaceWrapper) CreateProduct

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

CreateProduct converts echo context to params.

func (*ServerInterfaceWrapper) DeleteProductById

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

DeleteProductById converts echo context to params.

func (*ServerInterfaceWrapper) GetProductById

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

GetProductById converts echo context to params.

func (*ServerInterfaceWrapper) GetProducts

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

GetProducts converts echo context to params.

func (*ServerInterfaceWrapper) SearchProducts added in v0.0.7

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

SearchProducts converts echo context to params.

func (*ServerInterfaceWrapper) UpdateProduct

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

UpdateProduct converts echo context to params.

type UpdateProductJSONBody

type UpdateProductJSONBody struct {
	// ObjectWriteTraceId Unique trace ID for the operation.
	ObjectWriteTraceId *string `json:"objectWriteTraceId,omitempty"`

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

UpdateProductJSONBody defines parameters for UpdateProduct.

type UpdateProductJSONRequestBody

type UpdateProductJSONRequestBody UpdateProductJSONBody

UpdateProductJSONRequestBody defines body for UpdateProduct for application/json ContentType.

type UpdateProductResponse

type UpdateProductResponse 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 product was archived.
		ArchivedAt time.Time `json:"archivedAt,omitempty"`

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

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

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

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

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

func ParseUpdateProductResponse

func ParseUpdateProductResponse(rsp *http.Response) (*UpdateProductResponse, error)

ParseUpdateProductResponse parses an HTTP response from a UpdateProductWithResponse call

func (UpdateProductResponse) Status

func (r UpdateProductResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateProductResponse) StatusCode

func (r UpdateProductResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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