chromewebstore
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package chromewebstore provides access to the Chrome Web Store API.
For product documentation, see:https://developer.chrome.com/docs/webstore/api
Library status¶
These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.
When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.
Creating a client¶
Usage example:
import "google.golang.org/api/chromewebstore/v1.1"...ctx := context.Background()chromewebstoreService, err := chromewebstore.NewService(ctx)
In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options¶
By default, all available scopes (see "Constants") are used to authenticate.To restrict scopes, usegoogle.golang.org/api/option.WithScopes:
chromewebstoreService, err := chromewebstore.NewService(ctx, option.WithScopes(chromewebstore.ChromewebstoreReadonlyScope))
To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/option.WithAPIKey:
chromewebstoreService, err := chromewebstore.NewService(ctx, option.WithAPIKey("AIza..."))To use an OAuth token (e.g., a user token obtained via a three-legged OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)chromewebstoreService, err := chromewebstore.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))Seegoogle.golang.org/api/option.ClientOption for details on options.
Index¶
- Constants
- type Item
- type Item2
- type ItemError
- type ItemsGetCall
- func (c *ItemsGetCall) Context(ctx context.Context) *ItemsGetCall
- func (c *ItemsGetCall) Do(opts ...googleapi.CallOption) (*Item, error)
- func (c *ItemsGetCall) Fields(s ...googleapi.Field) *ItemsGetCall
- func (c *ItemsGetCall) Header() http.Header
- func (c *ItemsGetCall) IfNoneMatch(entityTag string) *ItemsGetCall
- func (c *ItemsGetCall) Projection(projection string) *ItemsGetCall
- type ItemsInsertCall
- func (c *ItemsInsertCall) Context(ctx context.Context) *ItemsInsertCall
- func (c *ItemsInsertCall) Do(opts ...googleapi.CallOption) (*Item, error)
- func (c *ItemsInsertCall) Fields(s ...googleapi.Field) *ItemsInsertCall
- func (c *ItemsInsertCall) Header() http.Header
- func (c *ItemsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ItemsInsertCall
- func (c *ItemsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ItemsInsertCall
- func (c *ItemsInsertCall) PublisherEmail(publisherEmail string) *ItemsInsertCall
- func (c *ItemsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ItemsInsertCalldeprecated
- type ItemsPublishCall
- func (c *ItemsPublishCall) Context(ctx context.Context) *ItemsPublishCall
- func (c *ItemsPublishCall) DeployPercentage(deployPercentage int64) *ItemsPublishCall
- func (c *ItemsPublishCall) Do(opts ...googleapi.CallOption) (*Item2, error)
- func (c *ItemsPublishCall) Fields(s ...googleapi.Field) *ItemsPublishCall
- func (c *ItemsPublishCall) Header() http.Header
- func (c *ItemsPublishCall) PublishTarget(publishTarget string) *ItemsPublishCall
- func (c *ItemsPublishCall) ReviewExemption(reviewExemption bool) *ItemsPublishCall
- type ItemsService
- type ItemsUpdateCall
- func (c *ItemsUpdateCall) Context(ctx context.Context) *ItemsUpdateCall
- func (c *ItemsUpdateCall) Do(opts ...googleapi.CallOption) (*Item, error)
- func (c *ItemsUpdateCall) Fields(s ...googleapi.Field) *ItemsUpdateCall
- func (c *ItemsUpdateCall) Header() http.Header
- func (c *ItemsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *ItemsUpdateCall
- func (c *ItemsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ItemsUpdateCall
- func (c *ItemsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ItemsUpdateCalldeprecated
- type PublishRequest
- type Service
Constants¶
const (// See, edit, update, or publish your Chrome Web Store extensions, themes,// apps, and licences you have access toChromewebstoreScope = "https://www.googleapis.com/auth/chromewebstore"// See and download your Chrome Web Store extensions and apps, and see licenses// you have access toChromewebstoreReadonlyScope = "https://www.googleapis.com/auth/chromewebstore.readonly")
OAuth2 scopes used by this API.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeItem¶
type Item struct {// CrxVersion: The CRX version of the item. If the projection is draft, then it// is the draft's CRX version.CrxVersionstring `json:"crxVersion,omitempty"`// Id: Unique ID of the item.Idstring `json:"id,omitempty"`// ItemError: Detail human-readable status of the operation, in English only.// Same error messages are displayed when you upload your app to the Chrome Web// Store.ItemError []*ItemError `json:"itemError,omitempty"`// Kind: Identifies this resource as an Item. Value: the fixed string// "chromewebstore#item".Kindstring `json:"kind,omitempty"`// PublicKey: Public key of this item.PublicKeystring `json:"publicKey,omitempty"`// UploadState: Status of the operation. Possible values are: - \"FAILURE\" -// \"IN_PROGRESS\" - \"NOT_FOUND\" - \"SUCCESS\"UploadStatestring `json:"uploadState,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "CrxVersion") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "CrxVersion") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}func (Item)MarshalJSON¶
typeItem2¶
type Item2 struct {// ItemId: The ID of this item.ItemIdstring `json:"item_id,omitempty"`// Kind: Static string value is always "chromewebstore#item".Kindstring `json:"kind,omitempty"`// Status: The status code of this publish operation. It may contain multiple// elements from the following list: NOT_AUTHORIZED, INVALID_DEVELOPER,// DEVELOPER_NO_OWNERSHIP, DEVELOPER_SUSPENDED, ITEM_NOT_FOUND,// ITEM_PENDING_REVIEW, ITEM_TAKEN_DOWN, PUBLISHER_SUSPENDED.Status []string `json:"status,omitempty"`// StatusDetail: Detailed human-comprehensible explanation of the status code// above.StatusDetail []string `json:"statusDetail,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "ItemId") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ItemId") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}func (Item2)MarshalJSON¶
typeItemError¶
type ItemError struct {// ErrorCode: The error code.ErrorCodestring `json:"error_code,omitempty"`// ErrorDetail: The human-readable detail message of the error.ErrorDetailstring `json:"error_detail,omitempty"`// ForceSendFields is a list of field names (e.g. "ErrorCode") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ErrorCode") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ItemError: Error of the item
func (ItemError)MarshalJSON¶
typeItemsGetCall¶
type ItemsGetCall struct {// contains filtered or unexported fields}func (*ItemsGetCall)Context¶
func (c *ItemsGetCall) Context(ctxcontext.Context) *ItemsGetCall
Context sets the context to be used in this call's Do method.
func (*ItemsGetCall)Do¶
func (c *ItemsGetCall) Do(opts ...googleapi.CallOption) (*Item,error)
Do executes the "chromewebstore.items.get" call.Any non-2xx status code is an error. Response headers are in either*Item.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*ItemsGetCall)Fields¶
func (c *ItemsGetCall) Fields(s ...googleapi.Field) *ItemsGetCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ItemsGetCall)Header¶
func (c *ItemsGetCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*ItemsGetCall)IfNoneMatch¶
func (c *ItemsGetCall) IfNoneMatch(entityTagstring) *ItemsGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
func (*ItemsGetCall)Projection¶
func (c *ItemsGetCall) Projection(projectionstring) *ItemsGetCall
Projection sets the optional parameter "projection": Determines which subsetof the item information to return.
Possible values:
"DRAFT" - Return information extracted from the current draft."PUBLISHED" - Return information extracted from the published item draft.
typeItemsInsertCall¶
type ItemsInsertCall struct {// contains filtered or unexported fields}func (*ItemsInsertCall)Context¶
func (c *ItemsInsertCall) Context(ctxcontext.Context) *ItemsInsertCall
Context sets the context to be used in this call's Do method.This context will supersede any context previously provided to theResumableMedia method.
func (*ItemsInsertCall)Do¶
func (c *ItemsInsertCall) Do(opts ...googleapi.CallOption) (*Item,error)
Do executes the "chromewebstore.items.insert" call.Any non-2xx status code is an error. Response headers are in either*Item.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*ItemsInsertCall)Fields¶
func (c *ItemsInsertCall) Fields(s ...googleapi.Field) *ItemsInsertCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ItemsInsertCall)Header¶
func (c *ItemsInsertCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*ItemsInsertCall)Media¶
func (c *ItemsInsertCall) Media(rio.Reader, options ...googleapi.MediaOption) *ItemsInsertCall
Media specifies the media to upload in one or more chunks. The chunk sizemay be controlled by supplying a MediaOption generated bygoogleapi.ChunkSize. The chunk size defaults togoogleapi.DefaultUploadChunkSize.The Content-Type header used in the uploadrequest will be determined by sniffing the contents of r, unless aMediaOption generated by googleapi.ContentType is supplied.At most one of Media and ResumableMedia may be set.
func (*ItemsInsertCall)ProgressUpdater¶
func (c *ItemsInsertCall) ProgressUpdater(pugoogleapi.ProgressUpdater) *ItemsInsertCall
ProgressUpdater provides a callback function that will be called after everychunk. It should be a low-latency function in order to not slow down theupload operation. This should only be called when using ResumableMedia (asopposed to Media).
func (*ItemsInsertCall)PublisherEmail¶
func (c *ItemsInsertCall) PublisherEmail(publisherEmailstring) *ItemsInsertCall
PublisherEmail sets the optional parameter "publisherEmail": The email ofthe publisher who owns the items. Defaults to the caller's email address.
func (*ItemsInsertCall)ResumableMediadeprecated
func (c *ItemsInsertCall) ResumableMedia(ctxcontext.Context, rio.ReaderAt, sizeint64, mediaTypestring) *ItemsInsertCall
ResumableMedia specifies the media to upload in chunks and can be canceledwith ctx.
Deprecated: use Media instead.
At most one of Media and ResumableMedia may be set. mediaType identifies theMIME media type of the upload, such as "image/png". If mediaType is "", itwill be auto-detected. The provided ctx will supersede any contextpreviously provided to the Context method.
typeItemsPublishCall¶
type ItemsPublishCall struct {// contains filtered or unexported fields}func (*ItemsPublishCall)Context¶
func (c *ItemsPublishCall) Context(ctxcontext.Context) *ItemsPublishCall
Context sets the context to be used in this call's Do method.
func (*ItemsPublishCall)DeployPercentage¶
func (c *ItemsPublishCall) DeployPercentage(deployPercentageint64) *ItemsPublishCall
DeployPercentage sets the optional parameter "deployPercentage": The deploypercentage you want to set for your item. Valid values are [0, 100]. If setto any number less than 100, only that many percentage of users will beallowed to get the update.
func (*ItemsPublishCall)Do¶
func (c *ItemsPublishCall) Do(opts ...googleapi.CallOption) (*Item2,error)
Do executes the "chromewebstore.items.publish" call.Any non-2xx status code is an error. Response headers are in either*Item2.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*ItemsPublishCall)Fields¶
func (c *ItemsPublishCall) Fields(s ...googleapi.Field) *ItemsPublishCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ItemsPublishCall)Header¶
func (c *ItemsPublishCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*ItemsPublishCall)PublishTarget¶
func (c *ItemsPublishCall) PublishTarget(publishTargetstring) *ItemsPublishCall
PublishTarget sets the optional parameter "publishTarget": Provide definedpublishTarget in URL (case sensitive): publishTarget="trustedTesters" orpublishTarget="default". Defaults to publishTarget="default".
func (*ItemsPublishCall)ReviewExemption¶
func (c *ItemsPublishCall) ReviewExemption(reviewExemptionbool) *ItemsPublishCall
ReviewExemption sets the optional parameter "reviewExemption": The callerrequest to exempt the review and directly publish because the update iswithin the list that we can automatically validate. The API will check ifthe exemption can be granted using real time data.
typeItemsService¶
type ItemsService struct {// contains filtered or unexported fields}funcNewItemsService¶
func NewItemsService(s *Service) *ItemsService
func (*ItemsService)Get¶
func (r *ItemsService) Get(itemIdstring) *ItemsGetCall
Get: Gets your own Chrome Web Store item.
- itemId: Unique identifier representing the Chrome App, Chrome Extension,or the Chrome Theme.
func (*ItemsService)Insert¶
func (r *ItemsService) Insert() *ItemsInsertCall
Insert: Inserts a new item.
func (*ItemsService)Publish¶
func (r *ItemsService) Publish(itemIdstring, publishrequest *PublishRequest) *ItemsPublishCall
Publish: Publishes an item.
- itemId: The ID of the item to publish.
func (*ItemsService)Update¶
func (r *ItemsService) Update(itemIdstring, item *Item) *ItemsUpdateCall
Update: Updates an existing item.
- itemId: The ID of the item to upload.
typeItemsUpdateCall¶
type ItemsUpdateCall struct {// contains filtered or unexported fields}func (*ItemsUpdateCall)Context¶
func (c *ItemsUpdateCall) Context(ctxcontext.Context) *ItemsUpdateCall
Context sets the context to be used in this call's Do method.This context will supersede any context previously provided to theResumableMedia method.
func (*ItemsUpdateCall)Do¶
func (c *ItemsUpdateCall) Do(opts ...googleapi.CallOption) (*Item,error)
Do executes the "chromewebstore.items.update" call.Any non-2xx status code is an error. Response headers are in either*Item.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*ItemsUpdateCall)Fields¶
func (c *ItemsUpdateCall) Fields(s ...googleapi.Field) *ItemsUpdateCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ItemsUpdateCall)Header¶
func (c *ItemsUpdateCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*ItemsUpdateCall)Media¶
func (c *ItemsUpdateCall) Media(rio.Reader, options ...googleapi.MediaOption) *ItemsUpdateCall
Media specifies the media to upload in one or more chunks. The chunk sizemay be controlled by supplying a MediaOption generated bygoogleapi.ChunkSize. The chunk size defaults togoogleapi.DefaultUploadChunkSize.The Content-Type header used in the uploadrequest will be determined by sniffing the contents of r, unless aMediaOption generated by googleapi.ContentType is supplied.At most one of Media and ResumableMedia may be set.
func (*ItemsUpdateCall)ProgressUpdater¶
func (c *ItemsUpdateCall) ProgressUpdater(pugoogleapi.ProgressUpdater) *ItemsUpdateCall
ProgressUpdater provides a callback function that will be called after everychunk. It should be a low-latency function in order to not slow down theupload operation. This should only be called when using ResumableMedia (asopposed to Media).
func (*ItemsUpdateCall)ResumableMediadeprecated
func (c *ItemsUpdateCall) ResumableMedia(ctxcontext.Context, rio.ReaderAt, sizeint64, mediaTypestring) *ItemsUpdateCall
ResumableMedia specifies the media to upload in chunks and can be canceledwith ctx.
Deprecated: use Media instead.
At most one of Media and ResumableMedia may be set. mediaType identifies theMIME media type of the upload, such as "image/png". If mediaType is "", itwill be auto-detected. The provided ctx will supersede any contextpreviously provided to the Context method.
typePublishRequest¶
type PublishRequest struct {// DeployPercentage: The target deploy percentage of the item. It's only useful// for items with big user base.DeployPercentageint64 `json:"deployPercentage,omitempty"`// ReviewExemption: Optional. The caller request to exempt the review and// directly publish because the update is within the list that we can// automatically validate. The API will check if the exemption can be granted// using real time data.ReviewExemptionbool `json:"reviewExemption,omitempty"`// Target: The publish target of this publish operation. This is the same as// using publishTarget as a URL query parameter. The string value can either be// target="trustedTesters" or target="default". The default value, if none is// supplied, is target="default". Recommended usage is to use the URL query// parameter to specificy the value.Targetstring `json:"target,omitempty"`// ForceSendFields is a list of field names (e.g. "DeployPercentage") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "DeployPercentage") to include in// API requests with the JSON null value. By default, fields with empty values// are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}func (PublishRequest)MarshalJSON¶
func (sPublishRequest) MarshalJSON() ([]byte,error)
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentItems *ItemsService// contains filtered or unexported fields} funcNewdeprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead.To provide a custom HTTP client, use option.WithHTTPClient.If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
funcNewService¶
NewService creates a new Service.