api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiredAPIs = map[string]string{
	"androidpublisher.googleapis.com":       "Google Play Android Developer API",
	"playdeveloperreporting.googleapis.com": "Google Play Developer Reporting API",
}

RequiredAPIs lists all APIs that might be needed by the CLI

Functions

func CheckAndEnableAPI

func CheckAndEnableAPI(operation func() error) error

CheckAndEnableAPI wraps an API call and handles enablement if needed

func HandleAPIEnablement

func HandleAPIEnablement(apiErr *APIEnablementError) error

HandleAPIEnablement provides an interactive flow to enable a required API

Types

type APIEnablementError

type APIEnablementError struct {
	APIName       string
	APITitle      string
	ProjectID     string
	ActivationURL string
	OriginalError error
}

APIEnablementError represents an error when an API needs to be enabled

func ParseAPIEnablementError

func ParseAPIEnablementError(err error) *APIEnablementError

ParseAPIEnablementError checks if an error is due to a disabled API and extracts the relevant information

func (*APIEnablementError) Error

func (e *APIEnablementError) Error() string

type Client

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

Client wraps the Android Publisher API client

func NewClient

func NewClient(packageName string, timeout time.Duration) (*Client, error)

NewClient creates a new API client

func (*Client) AppRecovery added in v0.4.0

func (c *Client) AppRecovery() *androidpublisher.ApprecoveryService

AppRecovery returns the app recovery service

func (*Client) Apps

Apps returns the applications service

func (*Client) Context

func (c *Client) Context() (context.Context, context.CancelFunc)

Context returns a context with timeout

func (*Client) CreateEdit

func (c *Client) CreateEdit() (*Edit, error)

CreateEdit creates a new edit session

func (*Client) Edits

func (c *Client) Edits() *androidpublisher.EditsService

Edits returns the edits service

func (*Client) ExternalTransactions added in v0.4.0

func (c *Client) ExternalTransactions() *androidpublisher.ExternaltransactionsService

ExternalTransactions returns the external transactions service

func (*Client) GeneratedAPKs added in v0.4.0

func (c *Client) GeneratedAPKs() *androidpublisher.GeneratedapksService

GeneratedAPKs returns the generated APKs service

func (*Client) GetEdit

func (c *Client) GetEdit(editID string) (*Edit, error)

GetEdit returns an existing edit by ID

func (*Client) GetPackageName

func (c *Client) GetPackageName() string

GetPackageName returns the package name

func (*Client) GetService

func (c *Client) GetService() *androidpublisher.Service

GetService returns the underlying Android Publisher service

func (*Client) Grants

func (c *Client) Grants() *androidpublisher.GrantsService

Grants returns the grants service

func (*Client) InAppProducts

func (c *Client) InAppProducts() *androidpublisher.InappproductsService

InAppProducts returns the in-app products service

func (*Client) Monetization

func (c *Client) Monetization() *androidpublisher.MonetizationService

Monetization returns the monetization service

func (*Client) Orders added in v0.4.0

func (c *Client) Orders() *androidpublisher.OrdersService

Orders returns the orders service

func (*Client) Purchases

func (c *Client) Purchases() *androidpublisher.PurchasesService

Purchases returns the purchases service

func (*Client) Reviews

func (c *Client) Reviews() *androidpublisher.ReviewsService

Reviews returns the reviews service

func (*Client) SystemAPKs added in v0.4.0

func (c *Client) SystemAPKs() *androidpublisher.SystemapksService

SystemAPKs returns the system APKs service

func (*Client) Users

func (c *Client) Users() *androidpublisher.UsersService

Users returns the users service

type Edit

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

Edit represents an active edit session

func (*Edit) APKs

APKs returns the APKs service for this edit

func (*Edit) Bundles

Bundles returns the bundles service for this edit

func (*Edit) Close

func (e *Edit) Close()

Close releases resources

func (*Edit) Commit

func (e *Edit) Commit() error

Commit commits the edit

func (*Edit) Context

func (e *Edit) Context() context.Context

Context returns the edit context

func (*Edit) Delete

func (e *Edit) Delete() error

Delete deletes the edit without committing

func (*Edit) DeobfuscationFiles

func (e *Edit) DeobfuscationFiles() *androidpublisher.EditsDeobfuscationfilesService

DeobfuscationFiles returns the deobfuscation files service for this edit

func (*Edit) Details

Details returns the details service for this edit

func (*Edit) ExpansionFiles

func (e *Edit) ExpansionFiles() *androidpublisher.EditsExpansionfilesService

ExpansionFiles returns the expansion files service for this edit

func (*Edit) ID

func (e *Edit) ID() string

ID returns the edit ID

func (*Edit) Images

Images returns the images service for this edit

func (*Edit) Listings

Listings returns the listings service for this edit

func (*Edit) Testers

Testers returns the testers service for this edit

func (*Edit) Tracks

Tracks returns the tracks service for this edit

func (*Edit) Validate

func (e *Edit) Validate() error

Validate validates the edit

type GitHubAsset added in v0.4.0

type GitHubAsset struct {
	Name          string `json:"name"`
	DownloadCount int64  `json:"download_count"`
	DownloadURL   string `json:"browser_download_url"`
}

GitHubAsset represents a release asset

type GitHubClient added in v0.4.0

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

GitHubClient handles GitHub API requests

func NewGitHubClient added in v0.4.0

func NewGitHubClient() *GitHubClient

NewGitHubClient creates a new GitHub API client

func (*GitHubClient) GetDownloadsByPlatform added in v0.4.0

func (c *GitHubClient) GetDownloadsByPlatform() ([]PlatformDownloads, int64, error)

GetDownloadsByPlatform returns download counts grouped by platform

func (*GitHubClient) GetDownloadsByRelease added in v0.4.0

func (c *GitHubClient) GetDownloadsByRelease() ([]ReleaseDownloads, error)

GetDownloadsByRelease returns download counts grouped by release

func (*GitHubClient) GetReleases added in v0.4.0

func (c *GitHubClient) GetReleases() ([]GitHubRelease, error)

GetReleases fetches all releases from GitHub

func (*GitHubClient) GetTotalDownloads added in v0.4.0

func (c *GitHubClient) GetTotalDownloads() (int64, error)

GetTotalDownloads returns the total download count across all releases

type GitHubRelease added in v0.4.0

type GitHubRelease struct {
	TagName     string        `json:"tag_name"`
	PublishedAt string        `json:"published_at"`
	Assets      []GitHubAsset `json:"assets"`
}

GitHubRelease represents a GitHub release

type PlatformDownloads added in v0.4.0

type PlatformDownloads struct {
	Platform  string `json:"platform"`
	Downloads int64  `json:"downloads"`
	Percent   string `json:"percent"`
}

PlatformDownloads represents download stats for a platform

type ReleaseDownloads added in v0.4.0

type ReleaseDownloads struct {
	Tag       string `json:"tag"`
	Date      string `json:"date"`
	Downloads int64  `json:"downloads"`
}

ReleaseDownloads represents download stats for a release

type ReportingClient added in v0.3.0

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

ReportingClient wraps the Play Developer Reporting API client

func NewReportingClient added in v0.3.0

func NewReportingClient(packageName string, timeout time.Duration) (*ReportingClient, error)

NewReportingClient creates a new Reporting API client

func (*ReportingClient) Anomalies added in v0.3.0

func (c *ReportingClient) Anomalies() *playdeveloperreporting.AnomaliesService

Anomalies returns the anomalies service

func (*ReportingClient) AppName added in v0.3.0

func (c *ReportingClient) AppName() string

AppName returns the formatted app name for API calls

func (*ReportingClient) Context added in v0.3.0

Context returns a context with timeout

func (*ReportingClient) GetPackageName added in v0.3.0

func (c *ReportingClient) GetPackageName() string

GetPackageName returns the package name

func (*ReportingClient) Vitals added in v0.3.0

func (c *ReportingClient) Vitals() *playdeveloperreporting.VitalsService

Vitals returns the vitals service

Jump to

Keyboard shortcuts

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