androidpublisher
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 androidpublisher provides access to the Google Play Developer API.
For product documentation, see:https://developers.google.com/android-publisher
Creating a client¶
Usage example:
import "google.golang.org/api/androidpublisher/v2"...ctx := context.Background()androidpublisherService, err := androidpublisher.NewService(ctx)
In this example, Google Application Default Credentials are used for authentication.
For information on how to create and obtain Application Default Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options¶
To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
androidpublisherService, err := androidpublisher.NewService(ctx, option.WithAPIKey("AIza..."))To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)androidpublisherService, err := androidpublisher.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))Seehttps://godoc.org/google.golang.org/api/option/ for details on options.
Index¶
- Constants
- type PageInfo
- type ProductPurchase
- type PurchasesProductsGetCall
- func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall
- func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error)
- func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall
- func (c *PurchasesProductsGetCall) Header() http.Header
- func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall
- type PurchasesProductsService
- type PurchasesService
- type PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error)
- func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) Header() http.Header
- func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall
- func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall
- type PurchasesVoidedpurchasesService
- type Service
- type TokenPagination
- type VoidedPurchase
- type VoidedPurchasesListResponse
Constants¶
const (// View and manage your Google Play Developer accountAndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher")OAuth2 scopes used by this API.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typePageInfo¶
type PageInfo struct {ResultPerPageint64 `json:"resultPerPage,omitempty"`StartIndexint64 `json:"startIndex,omitempty"`TotalResultsint64 `json:"totalResults,omitempty"`// ForceSendFields is a list of field names (e.g. "ResultPerPage") to// unconditionally include in API requests. By default, fields with// empty values are omitted from API requests. However, any non-pointer,// non-interface field appearing in ForceSendFields will be sent to the// server regardless of whether the field is empty or not. This may be// used to include empty fields in Patch requests.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ResultPerPage") to include// in API requests with the JSON null value. By default, fields with// empty values are omitted from API requests. However, any field with// an empty value appearing in NullFields will be sent to the server as// null. It is an error if a field in this list has a non-empty value.// This may be used to include null fields in Patch requests.NullFields []string `json:"-"`}func (*PageInfo)MarshalJSON¶
typeProductPurchase¶
type ProductPurchase struct {// ConsumptionState: The consumption state of the inapp product.// Possible values are:// - Yet to be consumed// - ConsumedConsumptionStateint64 `json:"consumptionState,omitempty"`// DeveloperPayload: A developer-specified string that contains// supplemental information about an order.DeveloperPayloadstring `json:"developerPayload,omitempty"`// Kind: This kind represents an inappPurchase object in the// androidpublisher service.Kindstring `json:"kind,omitempty"`// OrderId: The order id associated with the purchase of the inapp// product.OrderIdstring `json:"orderId,omitempty"`// PurchaseState: The purchase state of the order. Possible values are://// - Purchased// - Canceled// - PendingPurchaseStateint64 `json:"purchaseState,omitempty"`// PurchaseTimeMillis: The time the product was purchased, in// milliseconds since the epoch (Jan 1, 1970).PurchaseTimeMillisint64 `json:"purchaseTimeMillis,omitempty,string"`// PurchaseType: The type of purchase of the inapp product. This field// is only set if this purchase was not made using the standard in-app// billing flow. Possible values are:// - Test (i.e. purchased from a license testing account)// - Promo (i.e. purchased using a promo code)// - Rewarded (i.e. from watching a video ad instead of paying)PurchaseType *int64 `json:"purchaseType,omitempty"`// ServerResponse contains the HTTP response code and headers from the// server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "ConsumptionState") to// unconditionally include in API requests. By default, fields with// empty values are omitted from API requests. However, any non-pointer,// non-interface field appearing in ForceSendFields will be sent to the// server regardless of whether the field is empty or not. This may be// used to include empty fields in Patch requests.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ConsumptionState") to// include in API requests with the JSON null value. By default, fields// with empty values are omitted from API requests. However, any field// with an empty value appearing in NullFields will be sent to the// server as null. It is an error if a field in this list has a// non-empty value. This may be used to include null fields in Patch// requests.NullFields []string `json:"-"`}ProductPurchase: A ProductPurchase resource indicates the status of auser's inapp product purchase.
func (*ProductPurchase)MarshalJSON¶
func (s *ProductPurchase) MarshalJSON() ([]byte,error)
typePurchasesProductsGetCall¶
type PurchasesProductsGetCall struct {// contains filtered or unexported fields}func (*PurchasesProductsGetCall)Context¶
func (c *PurchasesProductsGetCall) Context(ctxcontext.Context) *PurchasesProductsGetCall
Context sets the context to be used in this call's Do method. Anypending HTTP request will be aborted if the provided context iscanceled.
func (*PurchasesProductsGetCall)Do¶
func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase,error)
Do executes the "androidpublisher.purchases.products.get" call.Exactly one of *ProductPurchase or error will be non-nil. Any non-2xxstatus code is an error. Response headers are in either*ProductPurchase.ServerResponse.Header or (if a response was returnedat all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error wasbecause http.StatusNotModified was returned.
func (*PurchasesProductsGetCall)Fields¶
func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponsefor more information.
func (*PurchasesProductsGetCall)Header¶
func (c *PurchasesProductsGetCall) Header()http.Header
Header returns an http.Header that can be modified by the caller toadd HTTP headers to the request.
func (*PurchasesProductsGetCall)IfNoneMatch¶
func (c *PurchasesProductsGetCall) IfNoneMatch(entityTagstring) *PurchasesProductsGetCall
IfNoneMatch sets the optional parameter which makes the operationfail if the object's ETag matches the given value. This is useful forgetting updates only after the object has changed since the lastrequest. Use googleapi.IsNotModified to check whether the responseerror from Do is the result of In-None-Match.
typePurchasesProductsService¶
type PurchasesProductsService struct {// contains filtered or unexported fields}funcNewPurchasesProductsService¶
func NewPurchasesProductsService(s *Service) *PurchasesProductsService
func (*PurchasesProductsService)Get¶
func (r *PurchasesProductsService) Get(packageNamestring, productIdstring, tokenstring) *PurchasesProductsGetCall
Get: Checks the purchase and consumption status of an inapp item.
typePurchasesService¶
type PurchasesService struct {Products *PurchasesProductsServiceVoidedpurchases *PurchasesVoidedpurchasesService// contains filtered or unexported fields}funcNewPurchasesService¶
func NewPurchasesService(s *Service) *PurchasesService
typePurchasesVoidedpurchasesListCall¶
type PurchasesVoidedpurchasesListCall struct {// contains filtered or unexported fields}func (*PurchasesVoidedpurchasesListCall)Context¶
func (c *PurchasesVoidedpurchasesListCall) Context(ctxcontext.Context) *PurchasesVoidedpurchasesListCall
Context sets the context to be used in this call's Do method. Anypending HTTP request will be aborted if the provided context iscanceled.
func (*PurchasesVoidedpurchasesListCall)Do¶
func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse,error)
Do executes the "androidpublisher.purchases.voidedpurchases.list" call.Exactly one of *VoidedPurchasesListResponse or error will be non-nil.Any non-2xx status code is an error. Response headers are in either*VoidedPurchasesListResponse.ServerResponse.Header or (if a responsewas returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error wasbecause http.StatusNotModified was returned.
func (*PurchasesVoidedpurchasesListCall)EndTime¶
func (c *PurchasesVoidedpurchasesListCall) EndTime(endTimeint64) *PurchasesVoidedpurchasesListCall
EndTime sets the optional parameter "endTime": The time, inmilliseconds since the Epoch, of the newest voided purchase that youwant to see in the response. The value of this parameter cannot begreater than the current time and is ignored if a pagination token isset. Default value is current time. Note: This filter is applied onthe time at which the record is seen as voided by our systems and notthe actual voided time returned in the response.
func (*PurchasesVoidedpurchasesListCall)Fields¶
func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponsefor more information.
func (*PurchasesVoidedpurchasesListCall)Header¶
func (c *PurchasesVoidedpurchasesListCall) Header()http.Header
Header returns an http.Header that can be modified by the caller toadd HTTP headers to the request.
func (*PurchasesVoidedpurchasesListCall)IfNoneMatch¶
func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTagstring) *PurchasesVoidedpurchasesListCall
IfNoneMatch sets the optional parameter which makes the operationfail if the object's ETag matches the given value. This is useful forgetting updates only after the object has changed since the lastrequest. Use googleapi.IsNotModified to check whether the responseerror from Do is the result of In-None-Match.
func (*PurchasesVoidedpurchasesListCall)MaxResults¶
func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResultsint64) *PurchasesVoidedpurchasesListCall
MaxResults sets the optional parameter "maxResults":
func (*PurchasesVoidedpurchasesListCall)StartIndex¶
func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndexint64) *PurchasesVoidedpurchasesListCall
StartIndex sets the optional parameter "startIndex":
func (*PurchasesVoidedpurchasesListCall)StartTime¶
func (c *PurchasesVoidedpurchasesListCall) StartTime(startTimeint64) *PurchasesVoidedpurchasesListCall
StartTime sets the optional parameter "startTime": The time, inmilliseconds since the Epoch, of the oldest voided purchase that youwant to see in the response. The value of this parameter cannot beolder than 30 days and is ignored if a pagination token is set.Default value is current time minus 30 days. Note: This filter isapplied on the time at which the record is seen as voided by oursystems and not the actual voided time returned in the response.
func (*PurchasesVoidedpurchasesListCall)Token¶
func (c *PurchasesVoidedpurchasesListCall) Token(tokenstring) *PurchasesVoidedpurchasesListCall
Token sets the optional parameter "token":
typePurchasesVoidedpurchasesService¶
type PurchasesVoidedpurchasesService struct {// contains filtered or unexported fields}funcNewPurchasesVoidedpurchasesService¶
func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService
func (*PurchasesVoidedpurchasesService)List¶
func (r *PurchasesVoidedpurchasesService) List(packageNamestring) *PurchasesVoidedpurchasesListCall
List: Lists the purchases that were canceled, refunded orcharged-back.
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentPurchases *PurchasesService// 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¶added inv0.3.0
NewService creates a new Service.
typeTokenPagination¶
type TokenPagination struct {NextPageTokenstring `json:"nextPageToken,omitempty"`PreviousPageTokenstring `json:"previousPageToken,omitempty"`// ForceSendFields is a list of field names (e.g. "NextPageToken") to// unconditionally include in API requests. By default, fields with// empty values are omitted from API requests. However, any non-pointer,// non-interface field appearing in ForceSendFields will be sent to the// server regardless of whether the field is empty or not. This may be// used to include empty fields in Patch requests.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "NextPageToken") to include// in API requests with the JSON null value. By default, fields with// empty values are omitted from API requests. However, any field with// an empty value appearing in NullFields will be sent to the server as// null. It is an error if a field in this list has a non-empty value.// This may be used to include null fields in Patch requests.NullFields []string `json:"-"`}func (*TokenPagination)MarshalJSON¶
func (s *TokenPagination) MarshalJSON() ([]byte,error)
typeVoidedPurchase¶
type VoidedPurchase struct {// Kind: This kind represents a voided purchase object in the// androidpublisher service.Kindstring `json:"kind,omitempty"`// PurchaseTimeMillis: The time at which the purchase was made, in// milliseconds since the epoch (Jan 1, 1970).PurchaseTimeMillisint64 `json:"purchaseTimeMillis,omitempty,string"`// PurchaseToken: The token which uniquely identifies a one-time// purchase or subscription. To uniquely identify subscription renewals// use order_id (available starting from version 3 of the API).PurchaseTokenstring `json:"purchaseToken,omitempty"`// VoidedTimeMillis: The time at which the purchase was// canceled/refunded/charged-back, in milliseconds since the epoch (Jan// 1, 1970).VoidedTimeMillisint64 `json:"voidedTimeMillis,omitempty,string"`// ForceSendFields is a list of field names (e.g. "Kind") to// unconditionally include in API requests. By default, fields with// empty values are omitted from API requests. However, any non-pointer,// non-interface field appearing in ForceSendFields will be sent to the// server regardless of whether the field is empty or not. This may be// used to include empty fields in Patch requests.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Kind") to include in API// requests with the JSON null value. By default, fields with empty// values are omitted from API requests. However, any field with an// empty value appearing in NullFields will be sent to the server as// null. It is an error if a field in this list has a non-empty value.// This may be used to include null fields in Patch requests.NullFields []string `json:"-"`}VoidedPurchase: A VoidedPurchase resource indicates a purchase thatwas either canceled/refunded/charged-back.
func (*VoidedPurchase)MarshalJSON¶
func (s *VoidedPurchase) MarshalJSON() ([]byte,error)
typeVoidedPurchasesListResponse¶
type VoidedPurchasesListResponse struct {PageInfo *PageInfo `json:"pageInfo,omitempty"`TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"`// ServerResponse contains the HTTP response code and headers from the// server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "PageInfo") to// unconditionally include in API requests. By default, fields with// empty values are omitted from API requests. However, any non-pointer,// non-interface field appearing in ForceSendFields will be sent to the// server regardless of whether the field is empty or not. This may be// used to include empty fields in Patch requests.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "PageInfo") to include in// API requests with the JSON null value. By default, fields with empty// values are omitted from API requests. However, any field with an// empty value appearing in NullFields will be sent to the server as// null. It is an error if a field in this list has a non-empty value.// This may be used to include null fields in Patch requests.NullFields []string `json:"-"`}func (*VoidedPurchasesListResponse)MarshalJSON¶
func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte,error)