Documentation
¶
Index ¶
- type Client
- func (c *Client) CreateContentType(g *schema.ContentType) (*schema.ContentType, error)
- func (c *Client) CreateGlobalField(g *schema.GlobalField) (*schema.GlobalField, error)
- func (c *Client) DeleteContentType(uid string) error
- func (c *Client) DeleteGlobalField(uid string) error
- func (c *Client) GetAllContentTypes(includeCount int64, includeGlobalFieldSchema bool) ([]schema.ContentType, error)
- func (c *Client) GetAllGlobalFields() ([]schema.GlobalField, error)
- func (c *Client) GetOneContentType(uid string) (*schema.ContentType, error)
- func (c *Client) GetOneGlobalField(uid string) (*schema.GlobalField, error)
- func (c *Client) GetUser() (*schema.User, error)
- func (c *Client) UpdateContentType(g *schema.ContentType) (*schema.ContentType, error)
- func (c *Client) UpdateGlobalField(g *schema.GlobalField) (*schema.GlobalField, error)
- type Configuration
- type GetContentTypesResponse
- type GetGlobalFieldsResponse
- type GetOneContentTypeResponse
- type GetOneGlobalFieldResponse
- type UpsertContentTypeRequestBody
- type UpsertContentTypeResponse
- type UpsertGlobalFieldRequestBody
- type UpsertGlobalFieldResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Configuration
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg *Configuration) (*Client, error)
func (*Client) CreateContentType ¶
func (c *Client) CreateContentType(g *schema.ContentType) (*schema.ContentType, error)
func (*Client) CreateGlobalField ¶
func (c *Client) CreateGlobalField(g *schema.GlobalField) (*schema.GlobalField, error)
func (*Client) DeleteContentType ¶
func (*Client) DeleteGlobalField ¶
func (*Client) GetAllContentTypes ¶
func (*Client) GetAllGlobalFields ¶
func (c *Client) GetAllGlobalFields() ([]schema.GlobalField, error)
func (*Client) GetOneContentType ¶
func (c *Client) GetOneContentType(uid string) (*schema.ContentType, error)
func (*Client) GetOneGlobalField ¶
func (c *Client) GetOneGlobalField(uid string) (*schema.GlobalField, error)
func (*Client) UpdateContentType ¶
func (c *Client) UpdateContentType(g *schema.ContentType) (*schema.ContentType, error)
func (*Client) UpdateGlobalField ¶
func (c *Client) UpdateGlobalField(g *schema.GlobalField) (*schema.GlobalField, error)
type Configuration ¶
type Configuration struct {
Host string `yaml:"host" env:"CS_MANAGEMENT_API_HOST" env-default:"https://api.contentstack.io"`
Key string `yaml:"key" env:"CS_MANAGEMENT_API_KEY" env-default:""`
Token string `yaml:"token" env:"CS_MANAGEMENT_API_TOKEN" env-default:""`
Debug bool `yaml:"debug" env:"CS_MANAGEMENT_API_DEBUG" env-default:"false"`
UserAgent string `yaml:"user_agent" env:"CS_MANAGEMENT_API_USER_AGENT" env-default:"go-contentstack API client"`
}
type GetContentTypesResponse ¶
type GetContentTypesResponse struct {
ContentTypes []schema.ContentType `json:"content_types"`
}
type GetGlobalFieldsResponse ¶
type GetGlobalFieldsResponse struct {
GlobalFields []schema.GlobalField `json:"global_fields"`
}
type GetOneContentTypeResponse ¶
type GetOneContentTypeResponse struct {
ContentType *schema.ContentType `json:"content_type"`
}
type GetOneGlobalFieldResponse ¶
type GetOneGlobalFieldResponse struct {
GlobalField *schema.GlobalField `json:"global_field"`
}
type UpsertContentTypeRequestBody ¶
type UpsertContentTypeRequestBody struct {
ContentType *schema.ContentType `json:"content_type"`
}
type UpsertContentTypeResponse ¶
type UpsertContentTypeResponse struct {
Notice string `json:"notice"`
ContentType *schema.ContentType `json:"content_type"`
}
type UpsertGlobalFieldRequestBody ¶
type UpsertGlobalFieldRequestBody struct {
GlobalField *schema.GlobalField `json:"global_field"`
}
type UpsertGlobalFieldResponse ¶
type UpsertGlobalFieldResponse struct {
Notice string `json:"notice"`
GlobalField *schema.GlobalField `json:"global_field"`
}
Click to show internal directories.
Click to hide internal directories.