articles

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListArticle

type ListArticle struct {
	// Query used for searching products by title, description, variant's title, variant's sku, and collection's title
	Q string `json:"q,omitempty" url:"q,omitempty"`

	// product IDs to search for.
	Ids []string `json:"id,omitempty" url:"id,omitempty"`

	// Tag IDs to search for
	Tags []string `json:"tags,omitempty" url:"tags,omitempty"`

	// title to search for.
	Title string `json:"title,omitempty" url:"title,omitempty"`

	// content to search for
	Content string `json:"content,omitempty" url:"content,omitempty"`

	// handle to search for.
	Handle string `json:"handle,omitempty" url:"handle,omitempty"`

	// Date comparison for when resulting products were created.
	CreatedAt *common.DateComparison `json:"created_at,omitempty" url:"created_at,omitempty"`

	// Date comparison for when resulting products were updated.
	UpdatedAt *common.DateComparison `json:"updated_at,omitempty" url:"updated_at,omitempty"`

	// How many products to skip in the result.
	Offset int `json:"offset" url:"offset"`

	// Limit the number of products returned.
	Limit int `json:"limit" url:"limit"`

	// (Comma separated) Which fields should be expanded in each order of the result.)
	Expand string `json:"expand,omitempty" url:"expand,omitempty"`

	// (Comma separated) Which fields should be included in each order of the result.
	Fields string `json:"fields,omitempty" url:"fields,omitempty"`
}

func NewListArticle

func NewListArticle() *ListArticle

func (*ListArticle) List

func (c *ListArticle) List(config *medusa.Config) (*ListArticleResponse, error)

Retrieve a list of Articles.

func (*ListArticle) SetContent

func (p *ListArticle) SetContent(content string) *ListArticle

func (*ListArticle) SetCreatedAt

func (p *ListArticle) SetCreatedAt(creatdAt *common.DateComparison) *ListArticle

func (*ListArticle) SetExpand

func (p *ListArticle) SetExpand(expand string) *ListArticle

func (*ListArticle) SetFields

func (p *ListArticle) SetFields(fields string) *ListArticle

func (*ListArticle) SetHandle

func (p *ListArticle) SetHandle(handle string) *ListArticle

func (*ListArticle) SetIds

func (p *ListArticle) SetIds(ids []string) *ListArticle

func (*ListArticle) SetLimit

func (p *ListArticle) SetLimit(limit int) *ListArticle

func (*ListArticle) SetOffset

func (p *ListArticle) SetOffset(offset int) *ListArticle

func (*ListArticle) SetQ

func (p *ListArticle) SetQ(q string) *ListArticle

func (*ListArticle) SetTags

func (p *ListArticle) SetTags(tags []string) *ListArticle

func (*ListArticle) SetTitle

func (p *ListArticle) SetTitle(title string) *ListArticle

func (*ListArticle) SetUpdatedAt

func (p *ListArticle) SetUpdatedAt(updatedAt *common.DateComparison) *ListArticle

type ListArticleData

type ListArticleData struct {
	// Array of articles
	Articles []*schema.Article `json:"articles"`

	// The total number of items available
	Count uint `json:"count"`

	// The number of items skipped before these items
	Offset uint `json:"offset"`

	// The number of items per page
	Limit uint `json:"limit"`
}

type ListArticleResponse

type ListArticleResponse struct {
	// Success response
	Data *ListArticleData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

type RetrieveArticleData

type RetrieveArticleData struct {
	Article *schema.Article `json:"article"`
}

type RetrieveArticleResponse

type RetrieveArticleResponse struct {
	// Success response
	Data *RetrieveArticleData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

func Retrieve

func Retrieve(id string, config *medusa.Config) (*RetrieveArticleResponse, error)

Retrieves a Product.

Jump to

Keyboard shortcuts

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