models

package
v0.0.0-...-ade036e Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLimit is the number of results we will return per page if the user doesn't specify another amount
	DefaultLimit = 25
	// DefaultLimitString is DefaultLimit but in string form because types are a thing
	DefaultLimitString = "25"
	// MaxLimit is the maximum number of objects Dairycart will return in a response
	MaxLimit = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dairytime

type Dairytime struct {
	time.Time
}

Dairytime is a custom time pointer struct that should interface well with Postgres's time type and allow for easily nullable time

func (Dairytime) MarshalText

func (dt Dairytime) MarshalText() ([]byte, error)

MarshalText satisfies the encoding.TestMarshaler interface

func (*Dairytime) Scan

func (dt *Dairytime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*Dairytime) String

func (dt *Dairytime) String() string

func (*Dairytime) UnmarshalText

func (dt *Dairytime) UnmarshalText(text []byte) (err error)

UnmarshalText is a function which unmarshals a NullTime

func (Dairytime) Value

func (dt Dairytime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Discount

type Discount struct {
	ID            uint64     `json:"id"`             // id
	Name          string     `json:"name"`           // name
	DiscountType  string     `json:"discount_type"`  // discount_type
	Amount        float64    `json:"amount"`         // amount
	ExpiresOn     *Dairytime `json:"expires_on"`     // expires_on
	RequiresCode  bool       `json:"requires_code"`  // requires_code
	Code          string     `json:"code"`           // code
	LimitedUse    bool       `json:"limited_use"`    // limited_use
	NumberOfUses  uint64     `json:"number_of_uses"` // number_of_uses
	LoginRequired bool       `json:"login_required"` // login_required
	StartsOn      time.Time  `json:"starts_on"`      // starts_on
	CreatedOn     time.Time  `json:"created_on"`     // created_on
	UpdatedOn     *Dairytime `json:"updated_on"`     // updated_on
	ArchivedOn    *Dairytime `json:"archived_on"`    // archived_on
}

Discount represents a Dairycart discount

type DiscountCreationInput

type DiscountCreationInput struct {
	Name          string     `json:"name,omitempty"`           // name
	DiscountType  string     `json:"discount_type,omitempty"`  // discount_type
	Amount        float64    `json:"amount,omitempty"`         // amount
	ExpiresOn     *Dairytime `json:"expires_on,omitempty"`     // expires_on
	RequiresCode  bool       `json:"requires_code,omitempty"`  // requires_code
	Code          string     `json:"code,omitempty"`           // code
	LimitedUse    bool       `json:"limited_use,omitempty"`    // limited_use
	NumberOfUses  uint64     `json:"number_of_uses,omitempty"` // number_of_uses
	LoginRequired bool       `json:"login_required,omitempty"` // login_required
	StartsOn      *Dairytime `json:"starts_on,omitempty"`      // starts_on
}

DiscountCreationInput is a struct to use for creating Discounts

type DiscountListResponse

type DiscountListResponse struct {
	ListResponse
	Discounts []Discount `json:"discounts"`
}

type DiscountUpdateInput

type DiscountUpdateInput struct {
	Name          string     `json:"name,omitempty"`           // name
	DiscountType  string     `json:"discount_type,omitempty"`  // discount_type
	Amount        float64    `json:"amount,omitempty"`         // amount
	ExpiresOn     *Dairytime `json:"expires_on,omitempty"`     // expires_on
	RequiresCode  bool       `json:"requires_code,omitempty"`  // requires_code
	Code          string     `json:"code,omitempty"`           // code
	LimitedUse    bool       `json:"limited_use,omitempty"`    // limited_use
	NumberOfUses  uint64     `json:"number_of_uses,omitempty"` // number_of_uses
	LoginRequired bool       `json:"login_required,omitempty"` // login_required
	StartsOn      *Dairytime `json:"starts_on,omitempty"`      // starts_on
}

DiscountUpdateInput is a struct to use for updating Discounts

type ErrorResponse

type ErrorResponse struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

ErrorResponse is a handy struct we can respond with in the event we have an error to report

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ListResponse

type ListResponse struct {
	Count uint64 `json:"count"`
	Limit uint8  `json:"limit"`
	Page  uint64 `json:"page"`
}

ListResponse is a generic list response struct containing values that represent pagination, meant to be embedded into other object response structs

type LoginAttempt

type LoginAttempt struct {
	ID         uint64    `json:"id"`         // id
	Username   string    `json:"username"`   // username
	Successful bool      `json:"successful"` // successful
	CreatedOn  time.Time `json:"created_on"` // created_on
}

LoginAttempt represents a Dairycart login attempt

type LoginAttemptCreationInput

type LoginAttemptCreationInput struct {
	Username   string `json:"username,omitempty"`   // username
	Successful bool   `json:"successful,omitempty"` // successful
}

LoginAttemptCreationInput is a struct to use for creating LoginAttempts

type LoginAttemptListResponse

type LoginAttemptListResponse struct {
	ListResponse
	LoginAttempts []LoginAttempt `json:"login_attempts"`
}

type LoginAttemptUpdateInput

type LoginAttemptUpdateInput struct {
	Username   string `json:"username,omitempty"`   // username
	Successful bool   `json:"successful,omitempty"` // successful
}

LoginAttemptUpdateInput is a struct to use for updating LoginAttempts

type PasswordResetToken

type PasswordResetToken struct {
	ID              uint64     `json:"id"`                // id
	UserID          uint64     `json:"user_id"`           // user_id
	Token           string     `json:"token"`             // token
	CreatedOn       time.Time  `json:"created_on"`        // created_on
	ExpiresOn       time.Time  `json:"expires_on"`        // expires_on
	PasswordResetOn *Dairytime `json:"password_reset_on"` // password_reset_on
}

PasswordResetToken represents a Dairycart password reset token

type PasswordResetTokenListResponse

type PasswordResetTokenListResponse struct {
	ListResponse
	PasswordResetTokens []PasswordResetToken `json:"password_reset_tokens"`
}

type Product

type Product struct {
	ID                 uint64     `json:"id"`                   // id
	ProductRootID      uint64     `json:"product_root_id"`      // product_root_id
	PrimaryImageID     *uint64    `json:"primary_image_id"`     // primary_image_id
	Name               string     `json:"name"`                 // name
	Subtitle           string     `json:"subtitle"`             // subtitle
	Description        string     `json:"description"`          // description
	OptionSummary      string     `json:"option_summary"`       // option_summary
	SKU                string     `json:"sku"`                  // sku
	UPC                string     `json:"upc"`                  // upc
	Manufacturer       string     `json:"manufacturer"`         // manufacturer
	Brand              string     `json:"brand"`                // brand
	Quantity           uint32     `json:"quantity"`             // quantity
	Taxable            bool       `json:"taxable"`              // taxable
	Price              float64    `json:"price"`                // price
	OnSale             bool       `json:"on_sale"`              // on_sale
	SalePrice          float64    `json:"sale_price"`           // sale_price
	Cost               float64    `json:"cost"`                 // cost
	ProductWeight      float64    `json:"product_weight"`       // product_weight
	ProductHeight      float64    `json:"product_height"`       // product_height
	ProductWidth       float64    `json:"product_width"`        // product_width
	ProductLength      float64    `json:"product_length"`       // product_length
	PackageWeight      float64    `json:"package_weight"`       // package_weight
	PackageHeight      float64    `json:"package_height"`       // package_height
	PackageWidth       float64    `json:"package_width"`        // package_width
	PackageLength      float64    `json:"package_length"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package"` // quantity_per_package
	AvailableOn        time.Time  `json:"available_on"`         // available_on
	CreatedOn          time.Time  `json:"created_on"`           // created_on
	UpdatedOn          *Dairytime `json:"updated_on"`           // updated_on
	ArchivedOn         *Dairytime `json:"archived_on"`          // archived_on

	// useful for responses
	Images                 []ProductImage       `json:"images"`
	ApplicableOptionValues []ProductOptionValue `json:"applicable_options,omitempty"`
}

Product represents a Dairycart product

type ProductCreationInput

type ProductCreationInput struct {
	Name               string     `json:"name,omitempty"`                 // name
	Subtitle           string     `json:"subtitle,omitempty"`             // subtitle
	Description        string     `json:"description,omitempty"`          // description
	OptionSummary      string     `json:"option_summary,omitempty"`       // option_summary
	SKU                string     `json:"sku,omitempty"`                  // sku
	UPC                string     `json:"upc,omitempty"`                  // upc
	Manufacturer       string     `json:"manufacturer,omitempty"`         // manufacturer
	Brand              string     `json:"brand,omitempty"`                // brand
	Quantity           uint32     `json:"quantity,omitempty"`             // quantity
	Taxable            bool       `json:"taxable,omitempty"`              // taxable
	Price              float64    `json:"price,omitempty"`                // price
	OnSale             bool       `json:"on_sale,omitempty"`              // on_sale
	SalePrice          float64    `json:"sale_price,omitempty"`           // sale_price
	Cost               float64    `json:"cost,omitempty"`                 // cost
	ProductWeight      float64    `json:"product_weight,omitempty"`       // product_weight
	ProductHeight      float64    `json:"product_height,omitempty"`       // product_height
	ProductWidth       float64    `json:"product_width,omitempty"`        // product_width
	ProductLength      float64    `json:"product_length,omitempty"`       // product_length
	PackageWeight      float64    `json:"package_weight,omitempty"`       // package_weight
	PackageHeight      float64    `json:"package_height,omitempty"`       // package_height
	PackageWidth       float64    `json:"package_width,omitempty"`        // package_width
	PackageLength      float64    `json:"package_length,omitempty"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package,omitempty"` // quantity_per_package
	AvailableOn        *Dairytime `json:"available_on,omitempty"`         // available_on

	Images  []ProductImageCreationInput  `json:"images,omitempty"`
	Options []ProductOptionCreationInput `json:"options,omitempty"`
}

ProductCreationInput is a struct to use for creating Products

type ProductImage

type ProductImage struct {
	ID            uint64     `json:"id"`              // id
	ProductRootID uint64     `json:"product_root_id"` // product_root_id
	ThumbnailURL  string     `json:"thumbnail_url"`   // thumbnail_url
	MainURL       string     `json:"main_url"`        // main_url
	OriginalURL   string     `json:"original_url"`    // original_url
	SourceURL     string     `json:"source_url"`      // source_url
	CreatedOn     time.Time  `json:"created_on"`      // created_on
	UpdatedOn     *Dairytime `json:"updated_on"`      // updated_on
	ArchivedOn    *Dairytime `json:"archived_on"`     // archived_on
}

ProductImage represents a Dairycart product image

type ProductImageBridge

type ProductImageBridge struct {
	ID             uint64 `json:"id"`               // id
	ProductID      uint64 `json:"product_id"`       // product_id
	ProductImageID uint64 `json:"product_image_id"` // product_image_id
}

ProductImageBridge represents a Dairycart product image bridge

type ProductImageBridgeCreationInput

type ProductImageBridgeCreationInput struct {
}

ProductImageBridgeCreationInput is a struct to use for creating ProductImageBridges

type ProductImageBridgeListResponse

type ProductImageBridgeListResponse struct {
	ListResponse
	ProductImageBridges []ProductImageBridge `json:"product_image_bridge"`
}

type ProductImageBridgeUpdateInput

type ProductImageBridgeUpdateInput struct {
	ProductID      uint64 `json:"product_id,omitempty"`       // product_id
	ProductImageID uint64 `json:"product_image_id,omitempty"` // product_image_id
}

ProductImageBridgeUpdateInput is a struct to use for updating ProductImageBridges

type ProductImageCreationInput

type ProductImageCreationInput struct {
	IsPrimary bool   `json:"is_primary"`
	Type      string `json:"type"`
	Data      string `json:"data"`
}

ProductImageCreationInput is a struct to use for creating ProductImages

type ProductImageListResponse

type ProductImageListResponse struct {
	ListResponse
	ProductImages []ProductImage `json:"product_images"`
}

type ProductImageUpdateInput

type ProductImageUpdateInput struct {
	ProductRootID uint64 `json:"product_root_id,omitempty"` // product_root_id
	ThumbnailURL  string `json:"thumbnail_url,omitempty"`   // thumbnail_url
	MainURL       string `json:"main_url,omitempty"`        // main_url
	OriginalURL   string `json:"original_url,omitempty"`    // original_url
}

ProductImageUpdateInput is a struct to use for updating ProductImages

type ProductListResponse

type ProductListResponse struct {
	ListResponse
	Products []Product `json:"products"`
}

type ProductOption

type ProductOption struct {
	ID            uint64     `json:"id"`              // id
	Name          string     `json:"name"`            // name
	ProductRootID uint64     `json:"product_root_id"` // product_root_id
	CreatedOn     time.Time  `json:"created_on"`      // created_on
	UpdatedOn     *Dairytime `json:"updated_on"`      // updated_on
	ArchivedOn    *Dairytime `json:"archived_on"`     // archived_on

	// useful for responses
	Values []ProductOptionValue `json:"values"`
}

ProductOption represents a Dairycart product option

type ProductOptionCreationInput

type ProductOptionCreationInput struct {
	Name   string   `json:"name,omitempty"`
	Values []string `json:"values,omitempty"`
}

ProductOptionCreationInput is a struct to use for creating ProductOptions

type ProductOptionListResponse

type ProductOptionListResponse struct {
	ListResponse
	ProductOptions []ProductOption `json:"product_options"`
}

type ProductOptionUpdateInput

type ProductOptionUpdateInput struct {
	Name          string `json:"name,omitempty"`            // name
	ProductRootID uint64 `json:"product_root_id,omitempty"` // product_root_id
}

ProductOptionUpdateInput is a struct to use for updating ProductOptions

type ProductOptionValue

type ProductOptionValue struct {
	ID              uint64     `json:"id"`                // id
	ProductOptionID uint64     `json:"product_option_id"` // product_option_id
	Value           string     `json:"value"`             // value
	CreatedOn       time.Time  `json:"created_on"`        // created_on
	UpdatedOn       *Dairytime `json:"updated_on"`        // updated_on
	ArchivedOn      *Dairytime `json:"archived_on"`       // archived_on
}

ProductOptionValue represents a Dairycart product option value

type ProductOptionValueCreationInput

type ProductOptionValueCreationInput struct {
	Value string `json:"value,omitempty"` // value
}

ProductOptionValueCreationInput is a struct to use for creating ProductOptionValues

type ProductOptionValueListResponse

type ProductOptionValueListResponse struct {
	ListResponse
	ProductOptionValues []ProductOptionValue `json:"product_option_values"`
}

type ProductOptionValueUpdateInput

type ProductOptionValueUpdateInput struct {
	ProductOptionID uint64 `json:"product_option_id,omitempty"` // product_option_id
	Value           string `json:"value,omitempty"`             // value
}

ProductOptionValueUpdateInput is a struct to use for updating ProductOptionValues

type ProductRoot

type ProductRoot struct {
	ID                 uint64     `json:"id"`                   // id
	Name               string     `json:"name"`                 // name
	PrimaryImageID     *uint64    `json:"primary_image_id"`     // primary_image_id
	Subtitle           string     `json:"subtitle"`             // subtitle
	Description        string     `json:"description"`          // description
	SKUPrefix          string     `json:"sku_prefix"`           // sku_prefix
	Manufacturer       string     `json:"manufacturer"`         // manufacturer
	Brand              string     `json:"brand"`                // brand
	Taxable            bool       `json:"taxable"`              // taxable
	Cost               float64    `json:"cost"`                 // cost
	ProductWeight      float64    `json:"product_weight"`       // product_weight
	ProductHeight      float64    `json:"product_height"`       // product_height
	ProductWidth       float64    `json:"product_width"`        // product_width
	ProductLength      float64    `json:"product_length"`       // product_length
	PackageWeight      float64    `json:"package_weight"`       // package_weight
	PackageHeight      float64    `json:"package_height"`       // package_height
	PackageWidth       float64    `json:"package_width"`        // package_width
	PackageLength      float64    `json:"package_length"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package"` // quantity_per_package
	AvailableOn        time.Time  `json:"available_on"`         // available_on
	CreatedOn          time.Time  `json:"created_on"`           // created_on
	UpdatedOn          *Dairytime `json:"updated_on"`           // updated_on
	ArchivedOn         *Dairytime `json:"archived_on"`          // archived_on

	// useful for responses
	Options  []ProductOption `json:"options"`
	Images   []ProductImage  `json:"images"`
	Products []Product       `json:"products"`
}

ProductRoot represents a Dairycart product root

type ProductRootCreationInput

type ProductRootCreationInput struct {
	Name               string     `json:"name,omitempty"`                 // name
	Subtitle           string     `json:"subtitle,omitempty"`             // subtitle
	Description        string     `json:"description,omitempty"`          // description
	SKUPrefix          string     `json:"sku_prefix,omitempty"`           // sku_prefix
	Manufacturer       string     `json:"manufacturer,omitempty"`         // manufacturer
	Brand              string     `json:"brand,omitempty"`                // brand
	Taxable            bool       `json:"taxable,omitempty"`              // taxable
	Cost               float64    `json:"cost,omitempty"`                 // cost
	ProductWeight      float64    `json:"product_weight,omitempty"`       // product_weight
	ProductHeight      float64    `json:"product_height,omitempty"`       // product_height
	ProductWidth       float64    `json:"product_width,omitempty"`        // product_width
	ProductLength      float64    `json:"product_length,omitempty"`       // product_length
	PackageWeight      float64    `json:"package_weight,omitempty"`       // package_weight
	PackageHeight      float64    `json:"package_height,omitempty"`       // package_height
	PackageWidth       float64    `json:"package_width,omitempty"`        // package_width
	PackageLength      float64    `json:"package_length,omitempty"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package,omitempty"` // quantity_per_package
	AvailableOn        *Dairytime `json:"available_on,omitempty"`         // available_on
}

ProductRootCreationInput is a struct to use for creating ProductRoots

type ProductRootListResponse

type ProductRootListResponse struct {
	ListResponse
	ProductRoots []ProductRoot `json:"product_roots"`
}

type ProductRootUpdateInput

type ProductRootUpdateInput struct {
	Name               string     `json:"name,omitempty"`                 // name
	PrimaryImageID     *uint64    `json:"primary_image_id,omitempty"`     // primary_image_id
	Subtitle           string     `json:"subtitle,omitempty"`             // subtitle
	Description        string     `json:"description,omitempty"`          // description
	SKUPrefix          string     `json:"sku_prefix,omitempty"`           // sku_prefix
	Manufacturer       string     `json:"manufacturer,omitempty"`         // manufacturer
	Brand              string     `json:"brand,omitempty"`                // brand
	Taxable            bool       `json:"taxable,omitempty"`              // taxable
	Cost               float64    `json:"cost,omitempty"`                 // cost
	ProductWeight      float64    `json:"product_weight,omitempty"`       // product_weight
	ProductHeight      float64    `json:"product_height,omitempty"`       // product_height
	ProductWidth       float64    `json:"product_width,omitempty"`        // product_width
	ProductLength      float64    `json:"product_length,omitempty"`       // product_length
	PackageWeight      float64    `json:"package_weight,omitempty"`       // package_weight
	PackageHeight      float64    `json:"package_height,omitempty"`       // package_height
	PackageWidth       float64    `json:"package_width,omitempty"`        // package_width
	PackageLength      float64    `json:"package_length,omitempty"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package,omitempty"` // quantity_per_package
	AvailableOn        *Dairytime `json:"available_on,omitempty"`         // available_on
}

ProductRootUpdateInput is a struct to use for updating ProductRoots

type ProductUpdateInput

type ProductUpdateInput struct {
	ProductRootID      uint64     `json:"product_root_id,omitempty"`      // product_root_id
	PrimaryImageID     *uint64    `json:"primary_image_id,omitempty"`     // primary_image_id
	Name               string     `json:"name,omitempty"`                 // name
	Subtitle           string     `json:"subtitle,omitempty"`             // subtitle
	Description        string     `json:"description,omitempty"`          // description
	OptionSummary      string     `json:"option_summary,omitempty"`       // option_summary
	SKU                string     `json:"sku,omitempty"`                  // sku
	UPC                string     `json:"upc,omitempty"`                  // upc
	Manufacturer       string     `json:"manufacturer,omitempty"`         // manufacturer
	Brand              string     `json:"brand,omitempty"`                // brand
	Quantity           uint32     `json:"quantity,omitempty"`             // quantity
	Taxable            bool       `json:"taxable,omitempty"`              // taxable
	Price              float64    `json:"price,omitempty"`                // price
	OnSale             bool       `json:"on_sale,omitempty"`              // on_sale
	SalePrice          float64    `json:"sale_price,omitempty"`           // sale_price
	Cost               float64    `json:"cost,omitempty"`                 // cost
	ProductWeight      float64    `json:"product_weight,omitempty"`       // product_weight
	ProductHeight      float64    `json:"product_height,omitempty"`       // product_height
	ProductWidth       float64    `json:"product_width,omitempty"`        // product_width
	ProductLength      float64    `json:"product_length,omitempty"`       // product_length
	PackageWeight      float64    `json:"package_weight,omitempty"`       // package_weight
	PackageHeight      float64    `json:"package_height,omitempty"`       // package_height
	PackageWidth       float64    `json:"package_width,omitempty"`        // package_width
	PackageLength      float64    `json:"package_length,omitempty"`       // package_length
	QuantityPerPackage uint32     `json:"quantity_per_package,omitempty"` // quantity_per_package
	AvailableOn        *Dairytime `json:"available_on,omitempty"`         // available_on
}

ProductUpdateInput is a struct to use for updating Products

type ProductVariantBridge

type ProductVariantBridge struct {
	ID                   uint64     `json:"id"`                      // id
	ProductID            uint64     `json:"product_id"`              // product_id
	ProductOptionValueID uint64     `json:"product_option_value_id"` // product_option_value_id
	CreatedOn            time.Time  `json:"created_on"`              // created_on
	ArchivedOn           *Dairytime `json:"archived_on"`             // archived_on
}

ProductVariantBridge represents a Dairycart product variant bridge

type ProductVariantBridgeCreationInput

type ProductVariantBridgeCreationInput struct {
}

ProductVariantBridgeCreationInput is a struct to use for creating ProductVariantBridges

type ProductVariantBridgeListResponse

type ProductVariantBridgeListResponse struct {
	ListResponse
	ProductVariantBridges []ProductVariantBridge `json:"product_variant_bridge"`
}

type ProductVariantBridgeUpdateInput

type ProductVariantBridgeUpdateInput struct {
	ProductID            uint64 `json:"product_id,omitempty"`              // product_id
	ProductOptionValueID uint64 `json:"product_option_value_id,omitempty"` // product_option_value_id
}

ProductVariantBridgeUpdateInput is a struct to use for updating ProductVariantBridges

type QueryFilter

type QueryFilter struct {
	Page            uint64
	Limit           uint8
	CreatedAfter    time.Time
	CreatedBefore   time.Time
	UpdatedAfter    time.Time
	UpdatedBefore   time.Time
	IncludeArchived bool
}

QueryFilter represents a query filter

type User

type User struct {
	ID                    uint64     `json:"id"`                       // id
	FirstName             string     `json:"first_name"`               // first_name
	LastName              string     `json:"last_name"`                // last_name
	Username              string     `json:"username"`                 // username
	Email                 string     `json:"email"`                    // email
	Password              string     `json:"password"`                 // password
	IsAdmin               bool       `json:"is_admin"`                 // is_admin
	PasswordLastChangedOn *Dairytime `json:"password_last_changed_on"` // password_last_changed_on
	CreatedOn             time.Time  `json:"created_on"`               // created_on
	UpdatedOn             *Dairytime `json:"updated_on"`               // updated_on
	ArchivedOn            *Dairytime `json:"archived_on"`              // archived_on
}

User represents a Dairycart user

type UserCreationInput

type UserCreationInput struct {
	FirstName string `json:"first_name,omitempty"` // first_name
	LastName  string `json:"last_name,omitempty"`  // last_name
	Username  string `json:"username,omitempty"`   // username
	Email     string `json:"email,omitempty"`      // email
	Password  string `json:"password,omitempty"`   // password
	IsAdmin   bool   `json:"is_admin,omitempty"`   // is_admin
}

UserCreationInput is a struct to use for creating Users

type UserListResponse

type UserListResponse struct {
	ListResponse
	Users []User `json:"users"`
}

type UserResponse

type UserResponse struct {
	ID                    uint64     `json:"id"`                       // id
	FirstName             string     `json:"first_name"`               // first_name
	LastName              string     `json:"last_name"`                // last_name
	Username              string     `json:"username"`                 // username
	Email                 string     `json:"email"`                    // email
	IsAdmin               bool       `json:"is_admin"`                 // is_admin
	PasswordLastChangedOn *Dairytime `json:"password_last_changed_on"` // password_last_changed_on
	CreatedOn             time.Time  `json:"created_on"`               // created_on
	UpdatedOn             *Dairytime `json:"updated_on"`               // updated_on
	ArchivedOn            *Dairytime `json:"archived_on"`              // archived_on
}

type UserUpdateInput

type UserUpdateInput struct {
	FirstName       string `json:"first_name,omitempty"`       // first_name
	LastName        string `json:"last_name,omitempty"`        // last_name
	Username        string `json:"username,omitempty"`         // username
	Email           string `json:"email,omitempty"`            // email
	NewPassword     string `json:"new_password,omitempty"`     // password
	CurrentPassword string `json:"current_password,omitempty"` // password
	IsAdmin         bool   `json:"is_admin,omitempty"`         // is_admin
}

UserUpdateInput is a struct to use for updating Users

type Webhook

type Webhook struct {
	ID          uint64     `json:"id"`           // id
	URL         string     `json:"url"`          // url
	EventType   string     `json:"event_type"`   // event_type
	ContentType string     `json:"content_type"` // content_type
	CreatedOn   time.Time  `json:"created_on"`   // created_on
	UpdatedOn   *Dairytime `json:"updated_on"`   // updated_on
	ArchivedOn  *Dairytime `json:"archived_on"`  // archived_on
}

Webhook represents a Dairycart webhook

type WebhookCreationInput

type WebhookCreationInput struct {
	URL         string `json:"url,omitempty"`          // url
	EventType   string `json:"event_type,omitempty"`   // event_type
	ContentType string `json:"content_type,omitempty"` // content_type
}

WebhookCreationInput is a struct to use for creating Webhooks

type WebhookExecutionLog

type WebhookExecutionLog struct {
	ID         uint64    `json:"id"`          // id
	WebhookID  uint64    `json:"webhook_id"`  // webhook_id
	StatusCode int       `json:"status_code"` // status_code
	Succeeded  bool      `json:"succeeded"`   // succeeded
	ExecutedOn time.Time `json:"executed_on"` // executed_on
}

WebhookExecutionLog represents a Dairycart webhook execution log

type WebhookExecutionLogCreationInput

type WebhookExecutionLogCreationInput struct {
	StatusCode int  `json:"status_code,omitempty"` // status_code
	Succeeded  bool `json:"succeeded,omitempty"`   // succeeded
}

WebhookExecutionLogCreationInput is a struct to use for creating WebhookExecutionLogs

type WebhookExecutionLogListResponse

type WebhookExecutionLogListResponse struct {
	ListResponse
	WebhookExecutionLogs []WebhookExecutionLog `json:"webhook_execution_logs"`
}

type WebhookExecutionLogUpdateInput

type WebhookExecutionLogUpdateInput struct {
	WebhookID  uint64 `json:"webhook_id,omitempty"`  // webhook_id
	StatusCode int    `json:"status_code,omitempty"` // status_code
	Succeeded  bool   `json:"succeeded,omitempty"`   // succeeded
}

WebhookExecutionLogUpdateInput is a struct to use for updating WebhookExecutionLogs

type WebhookListResponse

type WebhookListResponse struct {
	ListResponse
	Webhooks []Webhook `json:"webhooks"`
}

type WebhookUpdateInput

type WebhookUpdateInput struct {
	URL         string `json:"url,omitempty"`          // url
	EventType   string `json:"event_type,omitempty"`   // event_type
	ContentType string `json:"content_type,omitempty"` // content_type
}

WebhookUpdateInput is a struct to use for updating Webhooks

Jump to

Keyboard shortcuts

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