management

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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) CreateLocale added in v0.4.0

func (c *Client) CreateLocale(code, name, fallbackCode string) (*schema.Locale, error)

func (*Client) CreatePublishingEnvironment added in v0.3.0

func (c *Client) CreatePublishingEnvironment(g *schema.SingleEnvironmentWrapper) (*schema.SingleEnvironmentWrapper, error)

func (*Client) DeleteContentType

func (c *Client) DeleteContentType(uid string) error

func (*Client) DeleteGlobalField

func (c *Client) DeleteGlobalField(uid string) error

func (*Client) DeleteLocale added in v0.4.0

func (c *Client) DeleteLocale(code string) error

func (*Client) DeletePublishingEnvironment added in v0.3.0

func (c *Client) DeletePublishingEnvironment(name string) error

func (*Client) GetAllContentTypes

func (c *Client) GetAllContentTypes(includeCount int64, includeGlobalFieldSchema bool) ([]schema.ContentType, error)

func (*Client) GetAllGlobalFields

func (c *Client) GetAllGlobalFields() ([]schema.GlobalField, error)

func (*Client) GetAllLocales added in v0.4.0

func (c *Client) GetAllLocales() ([]schema.Locale, error)

func (*Client) GetAllPublishingEnvironments added in v0.3.0

func (c *Client) GetAllPublishingEnvironments() ([]schema.Environment, 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) GetOneLocale added in v0.4.0

func (c *Client) GetOneLocale(name string) (*schema.Locale, error)

func (*Client) GetOnePublishingEnvironment added in v0.3.0

func (c *Client) GetOnePublishingEnvironment(name string) (*schema.Environment, error)

func (*Client) GetUser

func (c *Client) GetUser() (*schema.User, 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)

func (*Client) UpdateLocale added in v0.4.0

func (c *Client) UpdateLocale(e *schema.Locale) (*schema.Locale, error)

func (*Client) UpdatePublishingEnvironment added in v0.3.0

func (c *Client) UpdatePublishingEnvironment(e *schema.Environment) (*schema.Environment, 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 GetOneLocaleResult added in v0.4.0

type GetOneLocaleResult struct {
	Locale schema.Locale `json:"locale"`
}

type LocaleCreateRequest added in v0.4.0

type LocaleCreateRequest struct {
	Locale struct {
		Name           string `json:"name"`
		Code           string `json:"code"`
		FallbackLocale string `json:"fallback_locale"`
	} `json:"locale"`
}

type LocaleListWrapper added in v0.4.0

type LocaleListWrapper struct {
	Locales []schema.Locale `json:"locales"`
}

type LocaleUpdateRequest added in v0.4.0

type LocaleUpdateRequest struct {
	Locale struct {
		Name           string `json:"name"`
		FallbackLocale string `json:"fallback_locale"`
	} `json:"locale"`
}

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"`
}

type UpsertLocaleResult added in v0.4.0

type UpsertLocaleResult struct {
	Notice string        `json:"notice"`
	Locale schema.Locale `json:"locale"`
}

Jump to

Keyboard shortcuts

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