Documentation
¶
Index ¶
- Variables
- func Count(ctx context.Context, c *Client, path string, opts ...RequestOption) (int, error)
- func CreateCustomerCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
- func CreateProductCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
- func DeleteChannel(ctx context.Context, c *Client, slug string, opts ...RequestOption) error
- func DownloadPageAssets(ctx context.Context, c *Client, doc PageDocument, dir string) (int, []string, error)
- func ExpandPageAttachmentPaths(doc PageDocument) error
- func ExpandPageAttachmentPathsWithOptions(doc PageDocument, opts PageAttachmentExpansionOptions) error
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimit(err error) bool
- func IsUnauthorized(err error) bool
- func List[T any](ctx context.Context, c *Client, path string, opts ...RequestOption) ([]T, error)
- func MenuDocumentHandle(doc MenuDocument) string
- func MenuDocumentHasItems(doc MenuDocument) bool
- func MenuDocumentName(doc MenuDocument) string
- func MenuDocumentSlug(doc MenuDocument) string
- func NewUploadCreateFileRefPayload(sourceURI string) map[string]any
- func NewUploadCreatePayload(filename string, content []byte, contentType string) map[string]any
- func NormalizeMenuDocumentForWrite(doc MenuDocument)
- func NormalizePageDocumentForWrite(doc PageDocument)
- func NormalizePageFullpath(fullpath string) string
- func PageCanvasRepeatableCounts(doc PageDocument) map[string]int
- func PageCanvasRepeatableInstanceCounts(doc PageDocument) map[string]int
- func PageDocumentFullpath(doc PageDocument) string
- func PageDocumentLocale(doc PageDocument) string
- func PageDocumentParentPath(doc PageDocument) string
- func PageDocumentPublished(doc PageDocument) bool
- func PageDocumentTemplate(doc PageDocument) string
- func PageDocumentTitle(doc PageDocument) string
- func PageEditableFile(editable map[string]any) map[string]any
- func PageShape(doc PageDocument) any
- func ReplaceCustomerCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
- func ReplaceProductCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
- func WalkPageEditables(doc PageDocument, fn func(name string, editable map[string]any) error) error
- type Account
- type ActionStatus
- type App
- type AppCallback
- type AppCodeFile
- type AppFunction
- type AppJob
- type AppLog
- type AppLogOptions
- type AppRoute
- type AppSchedule
- type AuthResponse
- type Blog
- type BlogPost
- type Channel
- type ChannelDependencyGraph
- func (g ChannelDependencyGraph) DirectDependants(slug string) []string
- func (g ChannelDependencyGraph) DirectDependencies(slug string) []string
- func (g ChannelDependencyGraph) HasCircularDependencies(slug string) bool
- func (g ChannelDependencyGraph) TransitiveDependants(slug string) []string
- func (g ChannelDependencyGraph) TransitiveDependencies(slug string) []string
- type ChannelDetail
- func CreateChannel(ctx context.Context, c *Client, payload any, opts ...RequestOption) (ChannelDetail, error)
- func GetChannelDetail(ctx context.Context, c *Client, slug string, opts ...RequestOption) (ChannelDetail, error)
- func ListChannelDetails(ctx context.Context, c *Client, opts ...RequestOption) ([]ChannelDetail, error)
- func PatchChannelCustomizations(ctx context.Context, c *Client, slug string, fields any, replace bool, ...) (ChannelDetail, error)
- type ChannelSummary
- type Client
- func (c *Client) Delete(ctx context.Context, path string, result any, opts ...RequestOption) error
- func (c *Client) DownloadURL(ctx context.Context, rawURL string) (*http.Response, string, error)
- func (c *Client) Get(ctx context.Context, path string, result any, opts ...RequestOption) error
- func (c *Client) Patch(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
- func (c *Client) Post(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
- func (c *Client) Put(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
- func (c *Client) RawRequest(ctx context.Context, method, path string, body any, opts ...RequestOption) (*http.Response, error)
- func (c *Client) Request(ctx context.Context, method, path string, body any, result any, ...) error
- func (c *Client) SimulatorRender(ctx context.Context, payload SimulatorPayload) (*SimulatorResponse, error)
- func (c *Client) WithDebug(debug bool) *Client
- func (c *Client) WithReadonly(readonly bool) *Client
- func (c *Client) WithSite(site string) *Client
- func (c *Client) WithTimeout(timeout time.Duration) *Client
- func (c *Client) WithVersion(version string) *Client
- type Collection
- type CollectionImage
- type Coupon
- type CustomField
- func GetChannelCustomizations(ctx context.Context, c *Client, slug string, opts ...RequestOption) ([]CustomField, error)
- func GetCustomerCustomizations(ctx context.Context, c *Client, opts ...RequestOption) ([]CustomField, error)
- func GetProductCustomizations(ctx context.Context, c *Client, opts ...RequestOption) ([]CustomField, error)
- type Customer
- type Domain
- type Entry
- type Error
- type JobRunResult
- type Links
- type LoginRequest
- type Menu
- type MenuDocument
- func GetMenuDocument(ctx context.Context, c *Client, identifier string, opts ...RequestOption) (MenuDocument, error)
- func PatchMenuDocument(ctx context.Context, c *Client, slug string, doc MenuDocument, ...) (MenuDocument, error)
- func PostMenuDocument(ctx context.Context, c *Client, doc MenuDocument, opts ...RequestOption) (MenuDocument, error)
- func SelectMenuDocument(menus []MenuDocument, identifier string) (MenuDocument, bool)
- type MenuDocumentStats
- type MenuItem
- type MenuSummary
- type Notification
- type OperationClass
- type Order
- type Page
- type PageAttachmentExpansionOptions
- type PageDocument
- type PageDocumentStats
- type PageSummary
- type PagedResponse
- type Pagination
- type Product
- type ReadonlyError
- type Redirect
- type RequestBody
- type RequestOption
- func WithContentLocale(locale string) RequestOption
- func WithFields(fields string) RequestOption
- func WithHeader(key, value string) RequestOption
- func WithIdempotent(idempotent bool) RequestOption
- func WithInclude(include string) RequestOption
- func WithLocale(locale string) RequestOption
- func WithOperationClass(class OperationClass) RequestOption
- func WithPage(page, perPage int) RequestOption
- func WithParam(key, value string) RequestOption
- func WithQuery(params map[string]string) RequestOption
- func WithReplace(replace bool) RequestOption
- func WithSite(site string) RequestOption
- type RetryTransport
- type Role
- type SelectOption
- type SenderDNSRecord
- type SenderDomain
- type SimulatorPayload
- type SimulatorRequest
- type SimulatorRequestContext
- type SimulatorResponse
- type Site
- type Theme
- type ThemeFile
- type ThemeResource
- type Token
- type Translation
- type Upload
- type User
- type ValidationError
- type Webhook
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrForbidden = errors.New("forbidden") ErrRateLimit = errors.New("rate limit exceeded") )
Common error checks
Functions ¶
func CreateCustomerCustomizations ¶
func CreateCustomerCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
CreateCustomerCustomizations creates the customer field schema.
func CreateProductCustomizations ¶
func CreateProductCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
CreateProductCustomizations creates the product field schema.
func DeleteChannel ¶ added in v0.2.3
DeleteChannel deletes a channel by slug or ID.
func DownloadPageAssets ¶
func DownloadPageAssets(ctx context.Context, c *Client, doc PageDocument, dir string) (int, []string, error)
DownloadPageAssets downloads remote file editables and rewrites them to local attachment_path refs. Returns the count of successful downloads, any per-asset warnings (non-fatal), and a fatal error.
func ExpandPageAttachmentPaths ¶
func ExpandPageAttachmentPaths(doc PageDocument) error
ExpandPageAttachmentPaths prepares file editables for an API write:
- attachment_path: read the local file, base64-encode it, mark __type "File"
- attachment_url: rewrite the file to a {__type:FileRef, source:<url>} ref
A file editable that ends up with neither an inline attachment nor a writable source is an error, since writing it would silently clear the asset.
func ExpandPageAttachmentPathsWithOptions ¶ added in v0.2.4
func ExpandPageAttachmentPathsWithOptions(doc PageDocument, opts PageAttachmentExpansionOptions) error
ExpandPageAttachmentPathsWithOptions prepares file editables for an API write with explicit handling for dangerous empty-file payloads.
func IsForbidden ¶
IsForbidden checks if any error in the chain is a 403.
func IsNotFound ¶
IsNotFound checks if any error in the chain is a 404.
func IsRateLimit ¶
IsRateLimit checks if any error in the chain is a 429.
func IsUnauthorized ¶
IsUnauthorized checks if any error in the chain is a 401.
func MenuDocumentHandle ¶
func MenuDocumentHandle(doc MenuDocument) string
MenuDocumentHandle returns the menu handle when present.
func MenuDocumentHasItems ¶
func MenuDocumentHasItems(doc MenuDocument) bool
MenuDocumentHasItems returns whether the raw menu response explicitly includes a nested items tree.
func MenuDocumentName ¶
func MenuDocumentName(doc MenuDocument) string
MenuDocumentName returns the menu name when present.
func MenuDocumentSlug ¶
func MenuDocumentSlug(doc MenuDocument) string
MenuDocumentSlug returns the canonical slug when present.
func NewUploadCreateFileRefPayload ¶ added in v0.2.5
NewUploadCreateFileRefPayload builds the JSON upload body for copying an existing Nimbu file.
func NewUploadCreatePayload ¶ added in v0.1.13
NewUploadCreatePayload builds the JSON upload body expected by POST /uploads.
func NormalizeMenuDocumentForWrite ¶
func NormalizeMenuDocumentForWrite(doc MenuDocument)
NormalizeMenuDocumentForWrite strips write-unsafe fields from a nested menu tree.
func NormalizePageDocumentForWrite ¶ added in v0.2.4
func NormalizePageDocumentForWrite(doc PageDocument)
NormalizePageDocumentForWrite removes server-managed top-level keys so the document can be safely sent on create/update requests.
func NormalizePageFullpath ¶
NormalizePageFullpath strips leading slashes and whitespace from a page fullpath.
func PageCanvasRepeatableCounts ¶ added in v0.2.4
func PageCanvasRepeatableCounts(doc PageDocument) map[string]int
PageCanvasRepeatableCounts returns, for each canvas editable path, the number of repeatables it contains. Nested paths use dot notation and aggregate repeatables across repeated instances of the same editable path.
func PageCanvasRepeatableInstanceCounts ¶ added in v0.2.4
func PageCanvasRepeatableInstanceCounts(doc PageDocument) map[string]int
PageCanvasRepeatableInstanceCounts returns repeatable counts for each canvas instance. Nested paths include repeatable indexes, e.g. blocks[0].gallery.
func PageDocumentFullpath ¶
func PageDocumentFullpath(doc PageDocument) string
PageDocumentFullpath returns the canonical page fullpath when present.
func PageDocumentLocale ¶
func PageDocumentLocale(doc PageDocument) string
PageDocumentLocale returns the page locale when present.
func PageDocumentParentPath ¶
func PageDocumentParentPath(doc PageDocument) string
PageDocumentParentPath returns the parent path for a page when present.
func PageDocumentPublished ¶
func PageDocumentPublished(doc PageDocument) bool
PageDocumentPublished returns whether the page is published.
func PageDocumentTemplate ¶
func PageDocumentTemplate(doc PageDocument) string
PageDocumentTemplate returns the page template when present.
func PageDocumentTitle ¶
func PageDocumentTitle(doc PageDocument) string
PageDocumentTitle returns the page title when present.
func PageEditableFile ¶
PageEditableFile returns the file map from an editable, or nil if absent.
func PageShape ¶ added in v0.2.4
func PageShape(doc PageDocument) any
PageShape returns a skeleton of the page's editables: editable name -> type, and for canvases the list of repeatables with their slug and nested skeleton.
func ReplaceCustomerCustomizations ¶
func ReplaceCustomerCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
ReplaceCustomerCustomizations replaces the customer field schema.
func ReplaceProductCustomizations ¶
func ReplaceProductCustomizations(ctx context.Context, c *Client, fields any, opts ...RequestOption) error
ReplaceProductCustomizations replaces the product field schema.
func WalkPageEditables ¶
WalkPageEditables traverses all editables in a page document, including nested repeatables.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url,omitempty"`
Plan string `json:"plan,omitempty"`
SKUCount int `json:"sku_count,omitempty"`
SiteCount int `json:"site_count,omitempty"`
StorageCount int `json:"storage_count,omitempty"`
UsersCount int `json:"users_count,omitempty"`
Locale string `json:"locale,omitempty"`
Owner string `json:"owner,omitempty"`
Sites []string `json:"sites,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Account represents an account accessible for the current site context.
type ActionStatus ¶ added in v0.1.4
type ActionStatus struct {
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
State string `json:"state,omitempty"`
Paid bool `json:"paid,omitempty"`
Primary bool `json:"primary,omitempty"`
Domain string `json:"domain,omitempty"`
}
ActionStatus represents small state-changing action responses.
type App ¶
type App struct {
Name string `json:"name"`
URL string `json:"url,omitempty"`
Key string `json:"key,omitempty"`
Domain string `json:"domain,omitempty"`
CallbackURL string `json:"callback_url,omitempty"`
SDKVersion string `json:"sdk_version,omitempty"`
Internal bool `json:"internal,omitempty"`
InstallScopes []string `json:"install_scopes,omitempty"`
Functions []AppFunction `json:"functions,omitempty"`
Routes []AppRoute `json:"routes,omitempty"`
Callbacks []AppCallback `json:"callbacks,omitempty"`
Jobs []AppJob `json:"jobs,omitempty"`
Schedules []AppSchedule `json:"schedules,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
App represents an OAuth app.
type AppCallback ¶
type AppCallback struct {
Event string `json:"event,omitempty"`
Type string `json:"type,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
URL string `json:"url,omitempty"`
SHA string `json:"sha,omitempty"`
}
AppCallback represents a callback inside an app.
type AppCodeFile ¶
type AppCodeFile struct {
Name string `json:"name"`
URL string `json:"url,omitempty"`
Code string `json:"code,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
AppCodeFile represents an app cloud code file.
type AppFunction ¶
AppFunction represents a cloud function inside an app.
type AppJob ¶
type AppJob struct {
Name string `json:"name"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Every string `json:"every,omitempty"`
SHA string `json:"sha,omitempty"`
}
AppJob represents a job inside an app.
type AppLog ¶ added in v0.2.5
type AppLog struct {
ID string `json:"id"`
Time float64 `json:"time"`
Level string `json:"level"`
Data json.RawMessage `json:"data"`
CreatedAt time.Time `json:"created_at"`
Context json.RawMessage `json:"context,omitempty"`
}
AppLog represents one cloud-code log entry.
func ListAppLogs ¶ added in v0.2.5
func ListAppLogs(ctx context.Context, client *Client, appKey string, opts AppLogOptions) ([]AppLog, error)
ListAppLogs fetches cloud-code logs for an app.
type AppLogOptions ¶ added in v0.2.5
type AppLogOptions struct {
Since string
Before string
Level string
Query string
Job string
Limit int
}
AppLogOptions filters app cloud-code log requests.
type AppRoute ¶
type AppRoute struct {
Order int `json:"order,omitempty"`
Verb string `json:"verb,omitempty"`
Path string `json:"path,omitempty"`
Constraints map[string]any `json:"constraints,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
SHA string `json:"sha,omitempty"`
}
AppRoute represents a cloud route inside an app.
type AppSchedule ¶
type AppSchedule struct {
Name string `json:"name"`
Timing string `json:"timing,omitempty"`
Data map[string]any `json:"data,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Cron string `json:"cron,omitempty"`
SHA string `json:"sha,omitempty"`
}
AppSchedule represents a schedule inside an app.
func (*AppSchedule) UnmarshalJSON ¶
func (s *AppSchedule) UnmarshalJSON(data []byte) error
UnmarshalJSON normalizes app schedule timing for older CLI fields.
type AuthResponse ¶
AuthResponse is returned from login.
type Blog ¶
type Blog struct {
ID string `json:"id"`
Name string `json:"name"`
Handle string `json:"handle,omitempty"`
Slug string `json:"slug,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Blog represents a blog.
func (*Blog) UnmarshalJSON ¶
UnmarshalJSON maps blog slug to Handle fallback.
type BlogPost ¶
type BlogPost struct {
ID string `json:"id"`
Title string `json:"title"`
Slug string `json:"slug,omitempty"`
TextContent string `json:"text_content,omitempty"`
Status string `json:"status,omitempty"`
Author string `json:"author,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
BlogPost represents a blog post.
type Channel ¶
type Channel struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
EntryCount *int `json:"entry_count,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Channel represents a content channel summary.
func (*Channel) UnmarshalJSON ¶
UnmarshalJSON trims channel names and keeps missing entry_count as nil.
type ChannelDependencyGraph ¶
type ChannelDependencyGraph struct {
// contains filtered or unexported fields
}
ChannelDependencyGraph captures dependency and dependant relationships between channels.
func BuildChannelDependencyGraph ¶
func BuildChannelDependencyGraph(channels []ChannelDetail) ChannelDependencyGraph
BuildChannelDependencyGraph constructs dependency relationships from relational custom fields.
func (ChannelDependencyGraph) DirectDependants ¶
func (g ChannelDependencyGraph) DirectDependants(slug string) []string
DirectDependants returns the direct dependants for a channel.
func (ChannelDependencyGraph) DirectDependencies ¶
func (g ChannelDependencyGraph) DirectDependencies(slug string) []string
DirectDependencies returns the direct dependencies for a channel.
func (ChannelDependencyGraph) HasCircularDependencies ¶
func (g ChannelDependencyGraph) HasCircularDependencies(slug string) bool
HasCircularDependencies reports whether a channel participates in a cycle.
func (ChannelDependencyGraph) TransitiveDependants ¶
func (g ChannelDependencyGraph) TransitiveDependants(slug string) []string
TransitiveDependants returns all dependant descendants for a channel.
func (ChannelDependencyGraph) TransitiveDependencies ¶
func (g ChannelDependencyGraph) TransitiveDependencies(slug string) []string
TransitiveDependencies returns all dependency descendants for a channel.
type ChannelDetail ¶
type ChannelDetail struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
ACL map[string]any `json:"acl,omitempty"`
Customizations []CustomField `json:"customizations,omitempty"`
EntriesURL string `json:"entries_url,omitempty"`
LabelField string `json:"label_field,omitempty"`
TitleField string `json:"title_field,omitempty"`
OrderBy string `json:"order_by,omitempty"`
OrderDirection string `json:"order_direction,omitempty"`
RSSEnabled bool `json:"rss_enabled,omitempty"`
RSSTitle string `json:"rss_title,omitempty"`
RSSDescription string `json:"rss_description,omitempty"`
RSSTitleField string `json:"rss_title_field,omitempty"`
RSSDescriptionField string `json:"rss_description_field,omitempty"`
Submittable bool `json:"submittable,omitempty"`
SubmittableFieldIDs []string `json:"submittable_field_ids,omitempty"`
URL string `json:"url,omitempty"`
}
ChannelDetail is the canonical rich channel contract.
func CreateChannel ¶ added in v0.2.3
func CreateChannel(ctx context.Context, c *Client, payload any, opts ...RequestOption) (ChannelDetail, error)
CreateChannel creates a channel from a payload and returns the created detail. The payload may be a ChannelDetail or a raw map[string]any (e.g. from inline assignments or a --file body), and should carry name, slug, and optionally title_field/label_field/order_by/order_direction and a customizations array.
func GetChannelDetail ¶
func GetChannelDetail(ctx context.Context, c *Client, slug string, opts ...RequestOption) (ChannelDetail, error)
GetChannelDetail fetches the canonical channel detail contract.
func ListChannelDetails ¶
func ListChannelDetails(ctx context.Context, c *Client, opts ...RequestOption) ([]ChannelDetail, error)
ListChannelDetails fetches all channels with their richer schema fields.
func PatchChannelCustomizations ¶ added in v0.1.14
func PatchChannelCustomizations(ctx context.Context, c *Client, slug string, fields any, replace bool, opts ...RequestOption) (ChannelDetail, error)
PatchChannelCustomizations applies channel custom field changes.
type ChannelSummary ¶
type ChannelSummary = Channel
ChannelSummary is the lightweight list/get projection for channels.
type Client ¶
type Client struct {
BaseURL string
Token string
Site string
Version string
HTTPClient *http.Client
Debug bool
Readonly bool
}
Client is the Nimbu API client.
func (*Client) DownloadURL ¶
DownloadURL fetches a file from a URL (absolute or relative to BaseURL). It appends raw=true to bypass CDN image optimization, resolves relative URLs, and attaches auth headers when the URL targets the API host.
func (*Client) Patch ¶
func (c *Client) Patch(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
Patch performs a PATCH request.
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
Post performs a POST request.
func (*Client) Put ¶
func (c *Client) Put(ctx context.Context, path string, body any, result any, opts ...RequestOption) error
Put performs a PUT request.
func (*Client) RawRequest ¶
func (c *Client) RawRequest(ctx context.Context, method, path string, body any, opts ...RequestOption) (*http.Response, error)
RawRequest performs a request and returns the raw response.
func (*Client) Request ¶
func (c *Client) Request(ctx context.Context, method, path string, body any, result any, opts ...RequestOption) error
Request performs an HTTP request and decodes the JSON response.
func (*Client) SimulatorRender ¶
func (c *Client) SimulatorRender(ctx context.Context, payload SimulatorPayload) (*SimulatorResponse, error)
SimulatorRender calls the simulator rendering endpoint.
func (*Client) WithReadonly ¶ added in v0.2.1
WithReadonly returns a copy of the client that blocks mutating requests.
func (*Client) WithTimeout ¶
WithTimeout returns a copy of the client with custom timeout.
func (*Client) WithVersion ¶ added in v0.1.4
WithVersion returns a copy of the client with the version set.
type Collection ¶
type Collection struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Fullpath string `json:"fullpath,omitempty"`
Description string `json:"description,omitempty"`
ProductCount int `json:"product_count,omitempty"`
Status string `json:"status,omitempty"`
Type string `json:"type,omitempty"`
Priority int `json:"priority,omitempty"`
SEOTitle string `json:"seo_title,omitempty"`
SEODescription string `json:"seo_description,omitempty"`
SEOKeywords string `json:"seo_keywords,omitempty"`
Images []CollectionImage `json:"images,omitempty"`
FeaturedImage *CollectionImage `json:"featured_image,omitempty"`
Translations map[string]map[string]any `json:"translations,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Collection represents a product collection.
type CollectionImage ¶
type CollectionImage struct {
ID string `json:"id"`
Position int `json:"position,omitempty"`
ContentType string `json:"content_type,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Size int64 `json:"size,omitempty"`
URL string `json:"url,omitempty"`
}
CollectionImage represents an image attached to a collection.
type Coupon ¶
type Coupon struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Reason string `json:"reason,omitempty"`
State string `json:"state,omitempty"`
CouponType string `json:"coupon_type,omitempty"`
CouponPercentage float64 `json:"coupon_percentage,omitempty"`
CouponAmount float64 `json:"coupon_amount,omitempty"`
CustomerSpecific bool `json:"customer_specific,omitempty"`
Code string `json:"code,omitempty"`
Lifespan string `json:"lifespan,omitempty"`
LifespanAmount int `json:"lifespan_amount,omitempty"`
LifespanTime string `json:"lifespan_time,omitempty"`
Start string `json:"start,omitempty"`
StartType string `json:"start_type,omitempty"`
Constraints string `json:"constraints,omitempty"`
Requirements string `json:"requirements,omitempty"`
RequiredValue float64 `json:"required_value,omitempty"`
RequiredAmount int `json:"required_amount,omitempty"`
CollectionIDs []string `json:"collection_ids,omitempty"`
ProductTypeIDs []string `json:"product_type_ids,omitempty"`
Customers []map[string]any `json:"customers,omitempty"`
Redemptions []map[string]any `json:"redemptions,omitempty"`
Referral map[string]any `json:"referral,omitempty"`
Referrer map[string]any `json:"referrer,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Coupon represents a coupon.
type CustomField ¶
type CustomField struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Label string `json:"label,omitempty"`
Type string `json:"type,omitempty"`
Required bool `json:"required,omitempty"`
RequiredExpression string `json:"required_expression,omitempty"`
Unique bool `json:"unique,omitempty"`
Localized bool `json:"localized,omitempty"`
Encrypted bool `json:"encrypted,omitempty"`
Hint string `json:"hint,omitempty"`
Reference string `json:"reference,omitempty"`
SelectOptions []SelectOption `json:"select_options,omitempty"`
GeoType string `json:"geo_type,omitempty"`
CalculatedExpression string `json:"calculated_expression,omitempty"`
CalculationType string `json:"calculation_type,omitempty"`
PrivateStorage bool `json:"private_storage,omitempty"`
Extra map[string]any `json:"-"`
}
CustomField represents a channel customization field.
func GetChannelCustomizations ¶ added in v0.1.14
func GetChannelCustomizations(ctx context.Context, c *Client, slug string, opts ...RequestOption) ([]CustomField, error)
GetChannelCustomizations fetches the custom field schema for one channel.
func GetCustomerCustomizations ¶
func GetCustomerCustomizations(ctx context.Context, c *Client, opts ...RequestOption) ([]CustomField, error)
GetCustomerCustomizations fetches the customer field schema.
func GetProductCustomizations ¶
func GetProductCustomizations(ctx context.Context, c *Client, opts ...RequestOption) ([]CustomField, error)
GetProductCustomizations fetches the product field schema.
func (CustomField) IsRelational ¶
func (f CustomField) IsRelational() bool
IsRelational reports whether the field references another channel.
func (CustomField) MarshalJSON ¶
func (f CustomField) MarshalJSON() ([]byte, error)
MarshalJSON emits known fields plus any Extra attributes preserved during unmarshal.
func (*CustomField) UnmarshalJSON ¶
func (f *CustomField) UnmarshalJSON(data []byte) error
UnmarshalJSON preserves unknown field attributes while decoding the known customization fields.
type Customer ¶
type Customer struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Phone string `json:"phone,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Customer represents a customer.
func (*Customer) UnmarshalJSON ¶
UnmarshalJSON accepts both modern and legacy customer field names.
type Domain ¶ added in v0.1.4
type Domain struct {
ID string `json:"id"`
Domain string `json:"domain"`
DNSCheck bool `json:"dns_check,omitempty"`
Primary bool `json:"primary,omitempty"`
SSLEnabled bool `json:"ssl_enabled,omitempty"`
RedirectDomain string `json:"redirect_domain,omitempty"`
DefaultLocale string `json:"default_locale,omitempty"`
DefaultCountry string `json:"default_country,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Domain represents a custom site domain.
type Entry ¶
type Entry struct {
ID string `json:"id"`
Slug string `json:"slug,omitempty"`
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
Position int `json:"position,omitempty"`
Locale string `json:"locale,omitempty"`
Published bool `json:"published,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Extra map[string]any `json:"-"`
}
Entry represents a channel entry.
func (Entry) MarshalJSON ¶ added in v0.1.7
MarshalJSON emits known entry fields plus custom top-level fields preserved from the channel entry payload.
func (*Entry) UnmarshalJSON ¶ added in v0.1.7
UnmarshalJSON preserves custom top-level fields on channel entries.
type Error ¶
type Error struct {
StatusCode int `json:"status_code"`
Code string `json:"code,omitempty"`
Message string `json:"message"`
Details map[string]any `json:"details,omitempty"`
Errors []ValidationError `json:"errors,omitempty"`
Err error `json:"-"`
}
Error represents an API error.
func (*Error) IsForbidden ¶
IsForbidden returns true if this is a 403 error.
func (*Error) IsNotFound ¶
IsNotFound returns true if this is a 404 error.
func (*Error) IsRateLimit ¶
IsRateLimit returns true if this is a 429 error.
func (*Error) IsUnauthorized ¶
IsUnauthorized returns true if this is a 401 error.
func (*Error) IsValidation ¶
IsValidation returns true if this is a 422 validation error.
type JobRunResult ¶
type JobRunResult struct {
JID string `json:"jid"`
}
JobRunResult represents a scheduled job response.
type LoginRequest ¶
type LoginRequest struct {
Description string `json:"description"`
ExpiresIn int `json:"expires_in"`
}
LoginRequest is sent to /auth/login.
type Menu ¶
type Menu struct {
ID string `json:"id"`
Name string `json:"name"`
Handle string `json:"handle,omitempty"`
Slug string `json:"slug,omitempty"`
Items []MenuItem `json:"items,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Menu represents a navigation menu summary.
func (*Menu) UnmarshalJSON ¶
UnmarshalJSON maps menu slug to Handle fallback.
type MenuDocument ¶
MenuDocument is the canonical nested menu contract used for get/update flows.
func GetMenuDocument ¶
func GetMenuDocument(ctx context.Context, c *Client, identifier string, opts ...RequestOption) (MenuDocument, error)
GetMenuDocument fetches a menu document, falling back to the nested list contract when needed.
func PatchMenuDocument ¶
func PatchMenuDocument(ctx context.Context, c *Client, slug string, doc MenuDocument, opts ...RequestOption) (MenuDocument, error)
PatchMenuDocument updates a menu document with replace semantics.
func PostMenuDocument ¶ added in v0.2.4
func PostMenuDocument(ctx context.Context, c *Client, doc MenuDocument, opts ...RequestOption) (MenuDocument, error)
PostMenuDocument creates a menu document, preserving the nested items tree.
func SelectMenuDocument ¶
func SelectMenuDocument(menus []MenuDocument, identifier string) (MenuDocument, bool)
SelectMenuDocument matches a menu by slug or handle from a nested menu result set.
type MenuDocumentStats ¶
MenuDocumentStats summarizes a nested menu tree.
func MenuStats ¶
func MenuStats(doc MenuDocument) MenuDocumentStats
MenuStats counts items and depth in a nested menu tree.
type MenuItem ¶
type MenuItem struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Target string `json:"target,omitempty"`
Position int `json:"position,omitempty"`
Children []MenuItem `json:"children,omitempty"`
}
MenuItem represents a menu item.
type MenuSummary ¶
type MenuSummary = Menu
MenuSummary is the lightweight list projection for menus.
type Notification ¶
type Notification struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
Slug string `json:"slug,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Subject string `json:"subject,omitempty"`
Text string `json:"text,omitempty"`
HTML string `json:"html,omitempty"`
HTMLEnabled bool `json:"html_enabled,omitempty"`
Translations map[string]map[string]any `json:"translations,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Notification represents a notification template.
type OperationClass ¶
type OperationClass string
OperationClass classifies request side-effect semantics.
const ( OperationRead OperationClass = "read" OperationMutate OperationClass = "mutate" OperationDestructive OperationClass = "destructive" )
type Order ¶
type Order struct {
ID string `json:"id"`
Number string `json:"number,omitempty"`
Status string `json:"status,omitempty"`
Total float64 `json:"total,omitempty"`
Currency string `json:"currency,omitempty"`
CustomerID string `json:"customer_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Order represents an order.
func (*Order) UnmarshalJSON ¶
UnmarshalJSON normalizes order fields from API responses.
type Page ¶
type Page struct {
ID string `json:"id"`
Fullpath string `json:"fullpath,omitempty"`
Parent string `json:"parent,omitempty"`
ParentPath string `json:"parent_path,omitempty"`
Slug string `json:"slug,omitempty"`
Title string `json:"title,omitempty"`
Template string `json:"template,omitempty"`
Published bool `json:"published,omitempty"`
Locale string `json:"locale,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Page represents a page summary.
type PageAttachmentExpansionOptions ¶ added in v0.2.4
type PageAttachmentExpansionOptions struct {
AllowEmptyFile bool
DropEmptyFile bool
DropReadOnlyFileURL bool
}
PageAttachmentExpansionOptions configures file editable expansion for writes.
type PageDocument ¶
PageDocument is the canonical page contract used for get/update flows.
func GetPageDocument ¶
func GetPageDocument(ctx context.Context, c *Client, fullpath string, opts ...RequestOption) (PageDocument, error)
GetPageDocument fetches the full page document by fullpath.
func PatchPageDocument ¶
func PatchPageDocument(ctx context.Context, c *Client, fullpath string, doc PageDocument, opts ...RequestOption) (PageDocument, error)
PatchPageDocument updates a page document. The caller controls merge vs. replace semantics via opts (see WithReplace); by default the API merges.
type PageDocumentStats ¶
PageDocumentStats summarizes nested editables inside a page document.
func PageStats ¶
func PageStats(doc PageDocument) PageDocumentStats
PageStats traverses the page document and counts editables and attachment-bearing file objects.
type PageSummary ¶
type PageSummary = Page
PageSummary is the lightweight list projection for pages.
type PagedResponse ¶
type PagedResponse[T any] struct { Data []T Pagination Pagination Links Links }
PagedResponse wraps paginated API responses.
func ListPage ¶
func ListPage[T any](ctx context.Context, c *Client, path string, page, perPage int, opts ...RequestOption) (*PagedResponse[T], error)
ListPage fetches a single page from a paginated endpoint.
func (*PagedResponse[T]) HasMore ¶ added in v0.2.3
func (p *PagedResponse[T]) HasMore(perPage, collected int) bool
HasMore reports whether another page should be fetched after this one. It prefers the Link header, falls back to X-Total-Count when the header is absent (degraded responses from rate limiters or CDNs may drop it), and as a last resort treats a full page without any Link header as "probably more" so truncation requires an explicit short page rather than a missing header.
type Pagination ¶
type Pagination struct {
Page int `json:"page"`
PerPage int `json:"per_page"`
Total int `json:"total"`
TotalPages int `json:"total_pages"`
TotalKnown bool `json:"-"`
}
Pagination holds pagination information.
type Product ¶
type Product struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
Slug string `json:"slug,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
Price float64 `json:"price,omitempty"`
Currency string `json:"currency,omitempty"`
SKU string `json:"sku,omitempty"`
Inventory int `json:"inventory,omitempty"`
Published bool `json:"published,omitempty"`
CurrentStock int `json:"current_stock,omitempty"`
Digital bool `json:"digital,omitempty"`
RequiresShipping bool `json:"requires_shipping,omitempty"`
OnSale bool `json:"on_sale,omitempty"`
OnSalePrice float64 `json:"on_sale_price,omitempty"`
VariantsEnabled bool `json:"variants_enabled,omitempty"`
KeepStock bool `json:"keep_stock,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Product represents a product.
func (*Product) UnmarshalJSON ¶
UnmarshalJSON normalizes product fields from current and legacy API responses.
type ReadonlyError ¶ added in v0.2.1
ReadonlyError is returned before a mutating request is sent by a readonly client.
func (*ReadonlyError) Error ¶ added in v0.2.1
func (e *ReadonlyError) Error() string
type Redirect ¶
type Redirect struct {
ID string `json:"id"`
URL string `json:"url,omitempty"`
Source string `json:"source,omitempty"`
Target string `json:"target,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Redirect represents a redirect rule.
type RequestBody ¶
type RequestBody struct {
Reader io.Reader
GetBody func() (io.ReadCloser, error)
ContentType string
ContentLength int64
}
RequestBody supplies a custom request stream instead of JSON-marshaled data.
type RequestOption ¶
type RequestOption func(*requestOptions)
RequestOption configures a request.
func WithContentLocale ¶ added in v0.1.7
func WithContentLocale(locale string) RequestOption
WithContentLocale sets the content locale for localized channel-entry fields.
func WithFields ¶
func WithFields(fields string) RequestOption
WithFields sets the fields to include.
func WithHeader ¶
func WithHeader(key, value string) RequestOption
WithHeader adds a request header.
func WithIdempotent ¶
func WithIdempotent(idempotent bool) RequestOption
WithIdempotent marks whether the request is safe to retry.
func WithInclude ¶
func WithInclude(include string) RequestOption
WithInclude sets related resources to include.
func WithLocale ¶
func WithLocale(locale string) RequestOption
WithLocale sets the locale for the request.
func WithOperationClass ¶
func WithOperationClass(class OperationClass) RequestOption
WithOperationClass overrides request operation class.
func WithParam ¶
func WithParam(key, value string) RequestOption
WithParam adds a single query parameter.
func WithQuery ¶
func WithQuery(params map[string]string) RequestOption
WithQuery adds query parameters.
func WithReplace ¶ added in v0.2.4
func WithReplace(replace bool) RequestOption
WithReplace sets the replace query parameter for destructive rebuilds. It is a no-op when replace is false, leaving merge semantics in place.
type RetryTransport ¶
type RetryTransport struct {
Transport http.RoundTripper
MaxRetries int
BaseDelay time.Duration
}
RetryTransport wraps an http.RoundTripper with retry logic.
func NewRetryTransport ¶
func NewRetryTransport(transport http.RoundTripper) *RetryTransport
NewRetryTransport creates a new RetryTransport.
type Role ¶
type Role struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Customers []string `json:"customers,omitempty"`
Children []string `json:"children,omitempty"`
Parents []string `json:"parents,omitempty"`
ACL map[string]any `json:"_acl,omitempty"`
Owner string `json:"_owner,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Role represents a customer role.
type SelectOption ¶
type SelectOption struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Position int `json:"position,omitempty"`
Slug string `json:"slug,omitempty"`
}
SelectOption represents a select or multi-select option in a channel customization.
type SenderDNSRecord ¶ added in v0.1.4
type SenderDNSRecord struct {
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Host string `json:"host,omitempty"`
TTL int `json:"ttl,omitempty"`
Priority int `json:"priority,omitempty"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
}
SenderDNSRecord represents a DNS verification record for a sender domain.
type SenderDomain ¶ added in v0.1.4
type SenderDomain struct {
ID string `json:"id"`
Domain string `json:"domain"`
Provider string `json:"provider,omitempty"`
Status string `json:"status,omitempty"`
OwnershipVerified bool `json:"ownership_verified,omitempty"`
OwnershipVerifiedAt *time.Time `json:"ownership_verified_at,omitempty"`
VerifiedAt *time.Time `json:"verified_at,omitempty"`
LastCheckAt *time.Time `json:"last_check_at,omitempty"`
LastCheckError string `json:"last_check_error,omitempty"`
ExpectedTXTRecord string `json:"expected_txt_record,omitempty"`
DNSRecords []SenderDNSRecord `json:"dns_records,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
SenderDomain represents an email sender domain.
type SimulatorPayload ¶
type SimulatorPayload struct {
Simulator SimulatorRequest `json:"simulator"`
}
SimulatorPayload is sent to /simulator/render. Keep compatible with existing toolbelt format.
type SimulatorRequest ¶
type SimulatorRequest struct {
Code string `json:"code"`
Method string `json:"method"`
Path string `json:"path"`
Request SimulatorRequestContext `json:"request"`
Version string `json:"version"`
}
SimulatorRequest contains the full render request context.
type SimulatorRequestContext ¶
type SimulatorRequestContext struct {
Body *string `json:"body,omitempty"`
Headers string `json:"headers"`
Host string `json:"host"`
Method string `json:"method"`
Params map[string]any `json:"params"`
Port int `json:"port"`
Query string `json:"query"`
RawBody *string `json:"rawBody,omitempty"`
}
SimulatorRequestContext mirrors the Ruby-compatible request envelope.
type SimulatorResponse ¶
type SimulatorResponse struct {
Body string `json:"body"`
Encoding string `json:"encoding,omitempty"`
Headers map[string]string `json:"headers"`
Status int `json:"status"`
StatusCode int `json:"statusCode,omitempty"`
}
SimulatorResponse is the simulator API response payload.
func (*SimulatorResponse) EffectiveStatus ¶
func (r *SimulatorResponse) EffectiveStatus() int
EffectiveStatus resolves alternate status field names.
type Site ¶
type Site struct {
ID string `json:"id"`
Subdomain string `json:"subdomain"`
Name string `json:"name"`
Domain string `json:"domain,omitempty"`
Description string `json:"description,omitempty"`
Locales []string `json:"locales,omitempty"`
Timezone string `json:"timezone,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Site represents a Nimbu site.
type Theme ¶
type Theme struct {
ID string `json:"id"`
Name string `json:"name"`
Short string `json:"short,omitempty"`
CDNBasePath string `json:"cdn_base_path,omitempty"`
CDNHost string `json:"cdn_host,omitempty"`
CDNRoot string `json:"cdn_root,omitempty"`
SiteID string `json:"site_id,omitempty"`
SiteShortID string `json:"site_short_id,omitempty"`
ThemeShortID string `json:"theme_short_id,omitempty"`
Active bool `json:"active,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Theme represents a theme.
type ThemeFile ¶
type ThemeFile struct {
Path string `json:"path"`
Type string `json:"type,omitempty"`
Size int64 `json:"size,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
ThemeFile represents a theme file.
type ThemeResource ¶
type ThemeResource struct {
ID string `json:"id"`
URL string `json:"url"`
Permalink string `json:"permalink"`
Name string `json:"name"`
Path string `json:"path"`
Folder string `json:"folder"`
PublicURL string `json:"public_url"`
Code string `json:"code"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
ChangedLive bool `json:"changed_live,omitempty"`
}
ThemeResource represents a theme layout/template/snippet/asset entry.
type Token ¶
type Token struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Token string `json:"token,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
}
Token represents an API token.
type Translation ¶
type Translation struct {
Key string `json:"key"`
Value string `json:"value,omitempty"`
Locale string `json:"locale,omitempty"`
Values map[string]string `json:"values,omitempty"`
}
Translation represents a translation entry.
type Upload ¶
type Upload struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url,omitempty"`
Size int64 `json:"size,omitempty"`
MimeType string `json:"mime_type,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Upload represents an uploaded file.
func (*Upload) UnmarshalJSON ¶
UnmarshalJSON normalizes upload metadata from nested source payloads.
type User ¶
type User struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Admin bool `json:"admin,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
User represents the current user.
type ValidationError ¶
type ValidationError struct {
Field string `json:"field"`
Message string `json:"message"`
Code string `json:"code,omitempty"`
}
ValidationError represents a field-level validation error.
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
URL string `json:"url"`
TargetURL string `json:"target_url,omitempty"`
Events []string `json:"events,omitempty"`
Active bool `json:"active,omitempty"`
Secret string `json:"secret,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
Webhook represents a webhook.
func (*Webhook) UnmarshalJSON ¶
UnmarshalJSON normalizes webhook target_url to URL for CLI output.