discounts

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 discounts 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 discounts 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 discounts 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 NewCreateDiscountRequest

func NewCreateDiscountRequest(server string, body CreateDiscountJSONRequestBody) (*http.Request, error)

NewCreateDiscountRequest calls the generic CreateDiscount builder with application/json body

func NewCreateDiscountRequestWithBody

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

NewCreateDiscountRequestWithBody generates requests for CreateDiscount with any type of body

func NewDeleteDiscountByIdRequest

func NewDeleteDiscountByIdRequest(server string, discountId string) (*http.Request, error)

NewDeleteDiscountByIdRequest generates requests for DeleteDiscountById

func NewGetDiscountByIdRequest

func NewGetDiscountByIdRequest(server string, discountId int64, params *GetDiscountByIdParams) (*http.Request, error)

NewGetDiscountByIdRequest generates requests for GetDiscountById

func NewGetDiscountsRequest

func NewGetDiscountsRequest(server string, params *GetDiscountsParams) (*http.Request, error)

NewGetDiscountsRequest generates requests for GetDiscounts

func NewSearchDiscountsRequest

func NewSearchDiscountsRequest(server string, body SearchDiscountsJSONRequestBody) (*http.Request, error)

NewSearchDiscountsRequest calls the generic SearchDiscounts builder with application/json body

func NewSearchDiscountsRequestWithBody

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

NewSearchDiscountsRequestWithBody generates requests for SearchDiscounts with any type of body

func NewUpdateDiscountRequest

func NewUpdateDiscountRequest(server string, discountId string, body UpdateDiscountJSONRequestBody) (*http.Request, error)

NewUpdateDiscountRequest calls the generic UpdateDiscount builder with application/json body

func NewUpdateDiscountRequestWithBody

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

NewUpdateDiscountRequestWithBody generates requests for UpdateDiscount 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 AssociationResponse

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

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

AssociationResponse defines model for AssociationResponse.

type Associations

type Associations = []string

Associations defines model for Associations.

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

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

func (*Client) CreateDiscountWithBody

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

func (*Client) DeleteDiscountById

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

func (*Client) GetDiscountById

func (c *Client) GetDiscountById(ctx context.Context, discountId int64, params *GetDiscountByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDiscounts

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

func (*Client) SearchDiscounts

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

func (*Client) SearchDiscountsWithBody

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

func (*Client) UpdateDiscount

func (c *Client) UpdateDiscount(ctx context.Context, discountId string, body UpdateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateDiscountWithBody

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

type ClientInterface

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

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

	CreateDiscount(ctx context.Context, body CreateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	SearchDiscounts(ctx context.Context, body SearchDiscountsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// GetDiscountById request
	GetDiscountById(ctx context.Context, discountId int64, params *GetDiscountByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	UpdateDiscount(ctx context.Context, discountId string, body UpdateDiscountJSONRequestBody, 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) CreateDiscountWithBodyWithResponse

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

CreateDiscountWithBodyWithResponse request with arbitrary body returning *CreateDiscountResponse

func (*ClientWithResponses) CreateDiscountWithResponse

func (c *ClientWithResponses) CreateDiscountWithResponse(ctx context.Context, body CreateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDiscountResponse, error)

func (*ClientWithResponses) DeleteDiscountByIdWithResponse

func (c *ClientWithResponses) DeleteDiscountByIdWithResponse(ctx context.Context, discountId string, reqEditors ...RequestEditorFn) (*DeleteDiscountByIdResponse, error)

DeleteDiscountByIdWithResponse request returning *DeleteDiscountByIdResponse

func (*ClientWithResponses) GetDiscountByIdWithResponse

func (c *ClientWithResponses) GetDiscountByIdWithResponse(ctx context.Context, discountId int64, params *GetDiscountByIdParams, reqEditors ...RequestEditorFn) (*GetDiscountByIdResponse, error)

GetDiscountByIdWithResponse request returning *GetDiscountByIdResponse

func (*ClientWithResponses) GetDiscountsWithResponse

func (c *ClientWithResponses) GetDiscountsWithResponse(ctx context.Context, params *GetDiscountsParams, reqEditors ...RequestEditorFn) (*GetDiscountsResponse, error)

GetDiscountsWithResponse request returning *GetDiscountsResponse

func (*ClientWithResponses) SearchDiscountsWithBodyWithResponse

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

SearchDiscountsWithBodyWithResponse request with arbitrary body returning *SearchDiscountsResponse

func (*ClientWithResponses) SearchDiscountsWithResponse

func (c *ClientWithResponses) SearchDiscountsWithResponse(ctx context.Context, body SearchDiscountsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchDiscountsResponse, error)

func (*ClientWithResponses) UpdateDiscountWithBodyWithResponse

func (c *ClientWithResponses) UpdateDiscountWithBodyWithResponse(ctx context.Context, discountId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDiscountResponse, error)

UpdateDiscountWithBodyWithResponse request with arbitrary body returning *UpdateDiscountResponse

func (*ClientWithResponses) UpdateDiscountWithResponse

func (c *ClientWithResponses) UpdateDiscountWithResponse(ctx context.Context, discountId string, body UpdateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDiscountResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetDiscountsWithResponse request
	GetDiscountsWithResponse(ctx context.Context, params *GetDiscountsParams, reqEditors ...RequestEditorFn) (*GetDiscountsResponse, error)

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

	CreateDiscountWithResponse(ctx context.Context, body CreateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDiscountResponse, error)

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

	SearchDiscountsWithResponse(ctx context.Context, body SearchDiscountsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchDiscountsResponse, error)

	// DeleteDiscountByIdWithResponse request
	DeleteDiscountByIdWithResponse(ctx context.Context, discountId string, reqEditors ...RequestEditorFn) (*DeleteDiscountByIdResponse, error)

	// GetDiscountByIdWithResponse request
	GetDiscountByIdWithResponse(ctx context.Context, discountId int64, params *GetDiscountByIdParams, reqEditors ...RequestEditorFn) (*GetDiscountByIdResponse, error)

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

	UpdateDiscountWithResponse(ctx context.Context, discountId string, body UpdateDiscountJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDiscountResponse, error)
}

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

type CreateDiscountJSONBody

type CreateDiscountJSONBody struct {
	// Associations List of associations for the discount.
	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 *CreateDiscountJSONBodyAssociationsTypesAssociationCategory `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 discount properties.
	Properties map[string]string `json:"properties"`
}

CreateDiscountJSONBody defines parameters for CreateDiscount.

type CreateDiscountJSONBodyAssociationsTypesAssociationCategory

type CreateDiscountJSONBodyAssociationsTypesAssociationCategory string

CreateDiscountJSONBodyAssociationsTypesAssociationCategory defines parameters for CreateDiscount.

Defines values for CreateDiscountJSONBodyAssociationsTypesAssociationCategory.

type CreateDiscountJSONRequestBody

type CreateDiscountJSONRequestBody CreateDiscountJSONBody

CreateDiscountJSONRequestBody defines body for CreateDiscount for application/json ContentType.

type CreateDiscountResponse

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

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

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

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

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

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

func ParseCreateDiscountResponse

func ParseCreateDiscountResponse(rsp *http.Response) (*CreateDiscountResponse, error)

ParseCreateDiscountResponse parses an HTTP response from a CreateDiscountWithResponse call

func (CreateDiscountResponse) Status

func (r CreateDiscountResponse) Status() string

Status returns HTTPResponse.Status

func (CreateDiscountResponse) StatusCode

func (r CreateDiscountResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteDiscountByIdResponse

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

func ParseDeleteDiscountByIdResponse

func ParseDeleteDiscountByIdResponse(rsp *http.Response) (*DeleteDiscountByIdResponse, error)

ParseDeleteDiscountByIdResponse parses an HTTP response from a DeleteDiscountByIdWithResponse call

func (DeleteDiscountByIdResponse) Status

Status returns HTTPResponse.Status

func (DeleteDiscountByIdResponse) StatusCode

func (r DeleteDiscountByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DiscountAssociations

type DiscountAssociations struct {
	Contacts ObjectAssociationsResponse `json:"contacts,omitempty"`
	Deals    ObjectAssociationsResponse `json:"deals,omitempty"`
	Tickets  ObjectAssociationsResponse `json:"tickets,omitempty"`
}

DiscountAssociations defines model for DiscountAssociations.

type DiscountResponse

type DiscountResponse struct {
	// Archived Indicates if the discount is archived.
	Archived     bool                 `json:"archived,omitempty"`
	Associations DiscountAssociations `json:"associations,omitempty"`

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

	// Id Unique identifier for the discount.
	Id string `json:"id,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"`
}

DiscountResponse defines model for DiscountResponse.

type DiscountsResponse

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

DiscountsResponse defines model for DiscountsResponse.

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 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 GetDiscountByIdParams

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

GetDiscountByIdParams defines parameters for GetDiscountById.

type GetDiscountByIdResponse

type GetDiscountByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DiscountResponse
}

func ParseGetDiscountByIdResponse

func ParseGetDiscountByIdResponse(rsp *http.Response) (*GetDiscountByIdResponse, error)

ParseGetDiscountByIdResponse parses an HTTP response from a GetDiscountByIdWithResponse call

func (GetDiscountByIdResponse) Status

func (r GetDiscountByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetDiscountByIdResponse) StatusCode

func (r GetDiscountByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetDiscountsParams

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

GetDiscountsParams defines parameters for GetDiscounts.

type GetDiscountsResponse

type GetDiscountsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DiscountsResponse
}

func ParseGetDiscountsResponse

func ParseGetDiscountsResponse(rsp *http.Response) (*GetDiscountsResponse, error)

ParseGetDiscountsResponse parses an HTTP response from a GetDiscountsWithResponse call

func (GetDiscountsResponse) Status

func (r GetDiscountsResponse) Status() string

Status returns HTTPResponse.Status

func (GetDiscountsResponse) StatusCode

func (r GetDiscountsResponse) 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 {
	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 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 SearchDiscountsJSONBody

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

SearchDiscountsJSONBody defines parameters for SearchDiscounts.

type SearchDiscountsJSONRequestBody

type SearchDiscountsJSONRequestBody SearchDiscountsJSONBody

SearchDiscountsJSONRequestBody defines body for SearchDiscounts for application/json ContentType.

type SearchDiscountsResponse

type SearchDiscountsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DiscountsResponse
}

func ParseSearchDiscountsResponse

func ParseSearchDiscountsResponse(rsp *http.Response) (*SearchDiscountsResponse, error)

ParseSearchDiscountsResponse parses an HTTP response from a SearchDiscountsWithResponse call

func (SearchDiscountsResponse) Status

func (r SearchDiscountsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchDiscountsResponse) StatusCode

func (r SearchDiscountsResponse) 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 discounts
	// (GET /crm/v3/objects/discounts)
	GetDiscounts(ctx echo.Context, params GetDiscountsParams) error
	// Create a new discount
	// (POST /crm/v3/objects/discounts)
	CreateDiscount(ctx echo.Context) error
	// Search for discounts by email
	// (POST /crm/v3/objects/discounts/search)
	SearchDiscounts(ctx echo.Context) error
	// Delete a discount
	// (DELETE /crm/v3/objects/discounts/{discountId})
	DeleteDiscountById(ctx echo.Context, discountId string) error
	// Get Discount Details
	// (GET /crm/v3/objects/discounts/{discountId})
	GetDiscountById(ctx echo.Context, discountId int64, params GetDiscountByIdParams) error
	// Update a discount
	// (PATCH /crm/v3/objects/discounts/{discountId})
	UpdateDiscount(ctx echo.Context, discountId string) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateDiscount

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

CreateDiscount converts echo context to params.

func (*ServerInterfaceWrapper) DeleteDiscountById

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

DeleteDiscountById converts echo context to params.

func (*ServerInterfaceWrapper) GetDiscountById

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

GetDiscountById converts echo context to params.

func (*ServerInterfaceWrapper) GetDiscounts

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

GetDiscounts converts echo context to params.

func (*ServerInterfaceWrapper) SearchDiscounts

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

SearchDiscounts converts echo context to params.

func (*ServerInterfaceWrapper) UpdateDiscount

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

UpdateDiscount 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 UpdateDiscountJSONBody

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

UpdateDiscountJSONBody defines parameters for UpdateDiscount.

type UpdateDiscountJSONRequestBody

type UpdateDiscountJSONRequestBody UpdateDiscountJSONBody

UpdateDiscountJSONRequestBody defines body for UpdateDiscount for application/json ContentType.

type UpdateDiscountResponse

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

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

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

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

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

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

func ParseUpdateDiscountResponse

func ParseUpdateDiscountResponse(rsp *http.Response) (*UpdateDiscountResponse, error)

ParseUpdateDiscountResponse parses an HTTP response from a UpdateDiscountWithResponse call

func (UpdateDiscountResponse) Status

func (r UpdateDiscountResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateDiscountResponse) StatusCode

func (r UpdateDiscountResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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