cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Article

type Article struct {
	ID               int      `json:"id" yaml:"id"`
	URL              string   `json:"url" yaml:"url"`
	HTMLURL          string   `json:"html_url" yaml:"html_url"`
	Title            string   `json:"title" yaml:"title"`
	Body             string   `json:"body" yaml:"body"`
	Locale           string   `json:"locale" yaml:"locale"`
	SourceLocale     string   `json:"source_locale" yaml:"source_locale"`
	AuthorID         int      `json:"author_id" yaml:"author_id"`
	CommentsDisabled bool     `json:"comments_disabled" yaml:"comments_disabled"`
	OutdatedLocales  []string `json:"outdated_locales" yaml:"outdated_locales"`
	Outdated         bool     `json:"outdated" yaml:"outdated"`
	LabelNames       string   `json:"lable_names" yaml:"lable_names"`
	Draft            bool     `json:"draft" yaml:"draft"`
	Promoted         bool     `json:"promoted" yaml:"promoted"`
	Position         int      `json:"position" yaml:"position"`
	VoteSum          int      `json:"vote_sum" yaml:"vote_sum"`
	VoteCount        int      `json:"vote_count" yaml:"vote_count"`
	SectionID        int      `json:"section_id" yaml:"section_id"`
	CreatedAt        string   `json:"created_at" yaml:"created_at"`
	EditedAt         string   `json:"edited_at" yaml:"edited_at"`
	UpdatedAt        string   `json:"updated_at" yaml:"updated_at"`
}

Article https://developer.zendesk.com/rest_api/docs/help_center/articles#show-article

type ArticleGetRequest

type ArticleGetRequest struct {
	ID int `json:"id"`
}

ArticleGetRequest returns showArticle request

type ArticleGetResponse

type ArticleGetResponse struct {
	Article Article `json:"article"`
}

ArticleGetResponse returns showArticle response

type ArticleListRequest

type ArticleListRequest struct {
	Page       int    `json:"page"`
	PerPage    int    `json:"per_page"`
	SortBy     string `json:"sort_by"`
	SortOrder  string `json:"sort_order"`
	CategoryID int    `json:"category_id"`
	SectionID  int    `json:"section_id"`
}

ArticleListRequest https://developer.zendesk.com/rest_api/docs/help_center/articles#list-articles

type ArticleListResponse

type ArticleListResponse struct {
	Articles     []Article  `json:"articles"`
	Sections     []Section  `json:"sections"`
	Categories   []Category `json:"categories"`
	Count        int        `json:"count"`
	NextPage     string     `json:"next_page"`
	Page         int        `json:"page"`
	PageCount    int        `json:"page_count"`
	PerPage      int        `json:"per_page"`
	PreviousPage string     `json:"previous_page"`
	SortBy       string     `json:"sort_by"`
	SortOrder    string     `json:"sort_order"`
}

ArticleListResponse https://developer.zendesk.com/rest_api/docs/help_center/articles#list-articles

type Category

type Category struct {
	ID           int    `json:"id" yaml:"id"`
	Name         string `json:"name" yaml:"name"`
	Description  string `json:"description" yaml:"description"`
	Locale       string `json:"locale" yaml:"locale"`
	SourceLocale string `json:"source_locale" yaml:"source_locale"`
	URL          string `json:"url" yaml:"url"`
	HTMLURL      string `json:"html_url" yaml:"html_url"`
	Outdated     bool   `json:"outdated" yaml:"outdated"`
	Position     int    `json:"position" yaml:"position"`
	CreatedAt    string `json:"created_at" yaml:"created_at"`
	UpdatedAt    string `json:"updated_at" yaml:"updated_at"`
}

Category https://developer.zendesk.com/rest_api/docs/help_center/categories#show-category

type CategoryListRequest

type CategoryListRequest struct {
	SortBy    string `json:"sort_by"`
	SortOrder string `json:"sort_order"`
	Page      int    `json:"page"`
	PerPage   int    `json:"per_page"`
}

CategoryListRequest

type CategoryListResponse

type CategoryListResponse struct {
	Categories   []Category `json:"categories"`
	SortBy       string     `json:"sort_by"`
	SortOrder    string     `json:"sort_order"`
	Count        int        `json:"count"`
	NextPage     string     `json:"next_page"`
	Page         int        `json:"page"`
	PageCount    int        `json:"page_count"`
	PerPage      int        `json:"per_page"`
	PreviousPage string     `json:"previous_page"`
}

CategoryListResponse

type Client

type Client struct {
	EndpointURL *url.URL
	HTTPClient  *http.Client
	UserAgent   string
	SubDomain   string
	Email       string
	Password    string
	Locale      string
	APIKEY      string
}

Client is a object for Zendesk Auth

func (*Client) ArticleGet

func (client *Client) ArticleGet(ctx context.Context, apiRequest ArticleGetRequest) (*ArticleGetResponse, error)

ArticleGet is TBD

func (*Client) ArticleList

func (client *Client) ArticleList(ctx context.Context, apiRequest ArticleListRequest) (*ArticleListResponse, error)

ArticleList is TBD

func (*Client) CategoryList

func (client *Client) CategoryList(ctx context.Context, apiRequest CategoryListRequest) (*CategoryListResponse, error)

CategoryList is TBD

func (*Client) SectionGet

func (client *Client) SectionGet(ctx context.Context, apiRequest SectionGetRequest) (*SectionGetResponse, error)

SectionGet

func (*Client) SectionList

func (client *Client) SectionList(ctx context.Context, apiRequest SectionListRequest) (*SectionListResponse, error)

SectionList

type Configuration

type Configuration struct {
	// contains filtered or unexported fields
}

Configuration options

type Options

type Options struct {
	Page, Limit, SectionID, CategoryID int
	SortBy, SortOrder                  string
}

List options

type Section

type Section struct {
	ID            int    `json:"id" yaml:"id"`
	Name          string `json:"name" yaml:"name"`
	Description   string `json:"description" yaml:"description"`
	Locale        string `json:"locale" yaml:"locale"`
	SourceLocale  string `json:"source_locale" yaml:"source_locale"`
	URL           string `json:"url" yaml:"url"`
	HTMLURL       string `json:"html_url" yaml:"html_url"`
	CategoryID    int    `json:"category_id" yaml:"category_id"`
	Outdated      bool   `json:"outdated" yaml:"outdated"`
	Position      int    `json:"position" yaml:"position"`
	ManageableBy  string `json:"manageable_by" yaml:"manageable_by"`
	UserSegmentID int    `json:"user_segment_id" yaml:"user_segment_id"`
	CreatedAt     string `json:"created_at" yaml:"created_at"`
	UpdatedAt     string `json:"updated_at" yaml:"updated_at"`
}

Section https://developer.zendesk.com/rest_api/docs/help_center/categories#show-category

type SectionGetRequest

type SectionGetRequest struct {
	ID int `json:"id"`
}

SectionGetRequest

type SectionGetResponse

type SectionGetResponse struct {
	Articles     []Article  `json:"articles"`
	Sections     []Section  `json:"sections"`
	Categories   []Category `json:"categories"`
	Count        int        `json:"count"`
	NextPage     string     `json:"next_page"`
	Page         int        `json:"page"`
	PageCount    int        `json:"page_count"`
	PerPage      int        `json:"per_page"`
	PreviousPage string     `json:"previous_page"`
	SortBy       string     `json:"sort_by"`
	SortOrder    string     `json:"sort_order"`
}

SectionGetResponse

type SectionListRequest

type SectionListRequest struct {
	SortBy     string `json:"sort_by"`
	SortOrder  string `json:"sort_order"`
	Page       int    `json:"page"`
	PerPage    int    `json:"per_page"`
	CategoryID int    `json:"category_id"`
	SectionID  int    `json:"section_id"`
}

SectionListRequest

type SectionListResponse

type SectionListResponse struct {
	Sections     []Section  `json:"sections"`
	Categories   []Category `json:"categories"`
	SortBy       string     `json:"sort_by"`
	SortOrder    string     `json:"sort_order"`
	Count        int        `json:"count"`
	NextPage     string     `json:"next_page"`
	Page         int        `json:"page"`
	PageCount    int        `json:"page_count"`
	PerPage      int        `json:"per_page"`
	PreviousPage string     `json:"previous_page"`
}

SectionListResponse

Jump to

Keyboard shortcuts

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