Documentation ¶
Index ¶
- Variables
- func BoolRef(value bool) *bool
- func IntRef(value int) *int
- func StringRef(value string) *string
- type Auth
- type Client
- type ClientConfig
- type ContentType
- type ContentTypeInput
- type ContentTypeOptions
- type ContentTypeRequest
- type ContentTypeResponse
- type Entry
- type EntryContextInput
- type EntryInput
- type EntryRequest
- type EntryResponse
- type ErrorMessage
- type GlobalField
- type GlobalFieldInput
- type GlobalFieldRequest
- type GlobalFieldResponse
- type Locale
- type LocaleInput
- type LocaleRequest
- type LocaleResponse
- type LogTransport
- type OrganizationClient
- type Stack
- type StackAuth
- type StackInstance
- func (si *StackInstance) ContentTypeCreate(ctx context.Context, input ContentTypeInput) (*ContentType, error)
- func (si *StackInstance) ContentTypeDelete(ctx context.Context, uid string) error
- func (si *StackInstance) ContentTypeFetch(ctx context.Context, uid string) (*ContentType, error)
- func (si *StackInstance) ContentTypeFetchAll(ctx context.Context) ([]ContentType, error)
- func (si *StackInstance) ContentTypeUpdate(ctx context.Context, uid string, input ContentTypeInput) (*ContentType, error)
- func (si *StackInstance) EntryCreate(ctx context.Context, input *EntryInput) (*Entry, error)
- func (si *StackInstance) EntryDelete(ctx context.Context, input *EntryContextInput) error
- func (si *StackInstance) EntryFetch(ctx context.Context, input *EntryContextInput) (*Entry, error)
- func (si *StackInstance) EntryFetchAll(ctx context.Context, contentTypeUID string) ([]Entry, error)
- func (si *StackInstance) EntryUpdate(ctx context.Context, uid string, input *EntryInput) (*Entry, error)
- func (si *StackInstance) GlobalFieldCreate(ctx context.Context, input GlobalFieldInput) (*GlobalField, error)
- func (si *StackInstance) GlobalFieldDelete(ctx context.Context, uid string) error
- func (si *StackInstance) GlobalFieldFetch(ctx context.Context, uid string) (*GlobalField, error)
- func (si *StackInstance) GlobalFieldFetchAll(ctx context.Context) ([]GlobalField, error)
- func (si *StackInstance) GlobalFieldUpdate(ctx context.Context, uid string, input GlobalFieldInput) (*GlobalField, error)
- func (si *StackInstance) LocaleCreate(ctx context.Context, input LocaleInput) (*Locale, error)
- func (si *StackInstance) LocaleDelete(ctx context.Context, code string) error
- func (si *StackInstance) LocaleFetch(ctx context.Context, code string) (*Locale, error)
- func (si *StackInstance) LocaleFetchAll(ctx context.Context) ([]Locale, error)
- func (si *StackInstance) LocaleUpdate(ctx context.Context, code string, input LocaleInput) (*Locale, error)
- func (si *StackInstance) Settings(ctx context.Context) (*StackSettings, error)
- func (si *StackInstance) WebHookCreate(ctx context.Context, input WebHookInput) (*WebHook, error)
- func (si *StackInstance) WebHookDelete(ctx context.Context, uid string) error
- func (si *StackInstance) WebHookFetch(ctx context.Context, uid string) (*WebHook, error)
- func (si *StackInstance) WebHookFetchAll(ctx context.Context) ([]WebHook, error)
- func (si *StackInstance) WebHookUpdate(ctx context.Context, uid string, input WebHookInput) (*WebHook, error)
- type StackSettings
- type StacksInput
- type UserCredentials
- type WebHook
- type WebHookInput
- type WebHookRequest
- type WebHookResponse
- type WebhookDestination
- type WebhookHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugTransport = &LogTransport{ transport: http.DefaultTransport, }
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
func NewClientWithToken ¶
func (*Client) Organization ¶
func (c *Client) Organization(ouid string) *OrganizationClient
type ClientConfig ¶
type ContentType ¶
type ContentType struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Title string `json:"title,omitempty"` UID string `json:"uid,omitempty"` Schema json.RawMessage `json:"schema"` Options *ContentTypeOptions `json:"options"` MaintainRevisions bool `json:"maintain_revisions"` Description string `json:"description"` }
ContentType represents the content type in contentstack.
type ContentTypeInput ¶
type ContentTypeInput struct { Title *string `json:"title,omitempty"` UID *string `json:"uid,omitempty"` Description *string `json:"description,omitempty"` Schema json.RawMessage `json:"schema,omitempty"` }
ContentTypeInput is used to create or update a content type
type ContentTypeOptions ¶
type ContentTypeRequest ¶
type ContentTypeRequest struct {
ContentType ContentTypeInput `json:"content_type"`
}
type ContentTypeResponse ¶
type ContentTypeResponse struct {
ContentType ContentType `json:"content_type"`
}
type Entry ¶
type Entry struct { UID string `json:"uid"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` CreatedBy string `json:"created_by"` UpdatedBy string `json:"updated_by"` Locale string `json:"locale"` Version int `json:"_version"` Fields map[string]interface{} `json:"-"` }
Entry represents the content type in contentstack.
type EntryContextInput ¶
EntryDeleteInput is used to delete an entry
type EntryInput ¶
type EntryInput struct { ContentTypeUID string `json:"-"` Locale string `json:"-"` Fields map[string]interface{} }
EntryInput is used to create or update a entry
type EntryRequest ¶
type EntryRequest struct {
Entry json.RawMessage `json:"entry"`
}
type EntryResponse ¶
type EntryResponse struct {
Entry json.RawMessage `json:"entry"`
}
type ErrorMessage ¶
type ErrorMessage struct { ErrorMessage string `json:"error_message"` ErrorCode int `json:"error_code"` Errors map[string][]string `json:"errors"` }
func (*ErrorMessage) Error ¶
func (e *ErrorMessage) Error() string
type GlobalField ¶
type GlobalField struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Title string `json:"title,omitempty"` UID string `json:"uid,omitempty"` Schema json.RawMessage `json:"schema"` MaintainRevisions bool `json:"maintain_revisions"` Description string `json:"description"` }
GlobalField represents the global field in contentstack.
type GlobalFieldInput ¶
type GlobalFieldInput struct { Title *string `json:"title,omitempty"` UID *string `json:"uid,omitempty"` Description *string `json:"description,omitempty"` MaintainRevisions bool `json:"maintain_revisions"` Schema json.RawMessage `json:"schema,omitempty"` }
GlobalFieldInput is used to create or update a content type
type GlobalFieldRequest ¶
type GlobalFieldRequest struct {
GlobalField GlobalFieldInput `json:"global_field"`
}
type GlobalFieldResponse ¶
type GlobalFieldResponse struct {
GlobalField GlobalField `json:"global_field"`
}
type Locale ¶
type Locale struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name,omitempty"` UID string `json:"uid,omitempty"` Code string `json:"code"` FallbackLocale string `json:"fallback_locale"` }
Locale represents the global field in contentstack.
type LocaleInput ¶
type LocaleInput struct { Name string `json:"name,omitempty"` Code string `json:"code"` FallbackLocale string `json:"fallback_locale"` }
LocaleInput is used to create or update a content type
type LocaleRequest ¶
type LocaleRequest struct {
Locale LocaleInput `json:"locale"`
}
type LocaleResponse ¶
type LocaleResponse struct {
Locale Locale `json:"locale"`
}
type LogTransport ¶
type LogTransport struct {
// contains filtered or unexported fields
}
type OrganizationClient ¶
type OrganizationClient struct {
// contains filtered or unexported fields
}
type StackInstance ¶
type StackInstance struct {
// contains filtered or unexported fields
}
func (*StackInstance) ContentTypeCreate ¶
func (si *StackInstance) ContentTypeCreate(ctx context.Context, input ContentTypeInput) (*ContentType, error)
func (*StackInstance) ContentTypeDelete ¶
func (si *StackInstance) ContentTypeDelete(ctx context.Context, uid string) error
func (*StackInstance) ContentTypeFetch ¶
func (si *StackInstance) ContentTypeFetch(ctx context.Context, uid string) (*ContentType, error)
func (*StackInstance) ContentTypeFetchAll ¶
func (si *StackInstance) ContentTypeFetchAll(ctx context.Context) ([]ContentType, error)
func (*StackInstance) ContentTypeUpdate ¶
func (si *StackInstance) ContentTypeUpdate(ctx context.Context, uid string, input ContentTypeInput) (*ContentType, error)
func (*StackInstance) EntryCreate ¶
func (si *StackInstance) EntryCreate(ctx context.Context, input *EntryInput) (*Entry, error)
func (*StackInstance) EntryDelete ¶
func (si *StackInstance) EntryDelete(ctx context.Context, input *EntryContextInput) error
func (*StackInstance) EntryFetch ¶
func (si *StackInstance) EntryFetch(ctx context.Context, input *EntryContextInput) (*Entry, error)
func (*StackInstance) EntryFetchAll ¶
func (*StackInstance) EntryUpdate ¶
func (si *StackInstance) EntryUpdate(ctx context.Context, uid string, input *EntryInput) (*Entry, error)
func (*StackInstance) GlobalFieldCreate ¶
func (si *StackInstance) GlobalFieldCreate(ctx context.Context, input GlobalFieldInput) (*GlobalField, error)
func (*StackInstance) GlobalFieldDelete ¶
func (si *StackInstance) GlobalFieldDelete(ctx context.Context, uid string) error
func (*StackInstance) GlobalFieldFetch ¶
func (si *StackInstance) GlobalFieldFetch(ctx context.Context, uid string) (*GlobalField, error)
func (*StackInstance) GlobalFieldFetchAll ¶
func (si *StackInstance) GlobalFieldFetchAll(ctx context.Context) ([]GlobalField, error)
func (*StackInstance) GlobalFieldUpdate ¶
func (si *StackInstance) GlobalFieldUpdate(ctx context.Context, uid string, input GlobalFieldInput) (*GlobalField, error)
func (*StackInstance) LocaleCreate ¶
func (si *StackInstance) LocaleCreate(ctx context.Context, input LocaleInput) (*Locale, error)
func (*StackInstance) LocaleDelete ¶
func (si *StackInstance) LocaleDelete(ctx context.Context, code string) error
func (*StackInstance) LocaleFetch ¶
func (*StackInstance) LocaleFetchAll ¶
func (si *StackInstance) LocaleFetchAll(ctx context.Context) ([]Locale, error)
func (*StackInstance) LocaleUpdate ¶
func (si *StackInstance) LocaleUpdate(ctx context.Context, code string, input LocaleInput) (*Locale, error)
func (*StackInstance) Settings ¶
func (si *StackInstance) Settings(ctx context.Context) (*StackSettings, error)
func (*StackInstance) WebHookCreate ¶
func (si *StackInstance) WebHookCreate(ctx context.Context, input WebHookInput) (*WebHook, error)
func (*StackInstance) WebHookDelete ¶
func (si *StackInstance) WebHookDelete(ctx context.Context, uid string) error
func (*StackInstance) WebHookFetch ¶
func (*StackInstance) WebHookFetchAll ¶
func (si *StackInstance) WebHookFetchAll(ctx context.Context) ([]WebHook, error)
func (*StackInstance) WebHookUpdate ¶
func (si *StackInstance) WebHookUpdate(ctx context.Context, uid string, input WebHookInput) (*WebHook, error)
type StackSettings ¶
type StackSettings struct { }
type StacksInput ¶
type UserCredentials ¶
type WebHook ¶
type WebHook struct { UID string `json:"uid,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` CreatedBy string `json:"created_by"` UpdatedBy string `json:"updated_by"` Name string `json:"name"` OrganizationUID string `json:"org_uid,omitempty"` Channels []string `json:"channels"` Branches []string `json:"branches"` Destinations []WebhookDestination `json:"destinations"` RetryPolicy string `json:"retry_policy"` Disabled bool `json:"disabled"` ConcisePayload bool `json:"concise_payload"` }
WebHook represents the content type in contentstack.
type WebHookInput ¶
type WebHookInput struct { Name string `json:"name"` Branches []string `json:"branches"` Channels []string `json:"channels"` Destinations []WebhookDestination `json:"destinations"` RetryPolicy string `json:"retry_policy"` Disabled bool `json:"disabled"` ConcisePayload bool `json:"concise_payload"` }
WebHookInput is used to create or update a content type
type WebHookRequest ¶
type WebHookRequest struct {
WebHook WebHookInput `json:"webhook"`
}
type WebHookResponse ¶
type WebHookResponse struct {
WebHook WebHook `json:"webhook"`
}
type WebhookDestination ¶
type WebhookDestination struct { TargetURL string `json:"target_url"` HttpBasicAuth string `json:"http_basic_auth"` HttpBasicPassword string `json:"http_basic_password"` CustomHeaders []WebhookHeader `json:"custom_header"` }
type WebhookHeader ¶
Click to show internal directories.
Click to hide internal directories.