Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type AppInfo
- type AppInfoList
- type BasicAuth
- type Configuration
- type Country
- type CountryInfo
- type CountryList
- type GenericSwaggerError
- type InformationAPIBrowseAppsOpts
- type InformationAPISearchAppsOpts
- type InformationAPIService
- func (a *InformationAPIService) BrowseApps(ctx context.Context, localVarOptionals *InformationAPIBrowseAppsOpts) (AppInfoList, *http.Response, error)
- func (a *InformationAPIService) GetApp(ctx context.Context, pkg string) (AppInfo, *http.Response, error)
- func (a *InformationAPIService) GetCountries(ctx context.Context) (CountryList, *http.Response, error)
- func (a *InformationAPIService) GetLibraries(ctx context.Context) (LibraryList, *http.Response, error)
- func (a *InformationAPIService) SearchApps(ctx context.Context, localVarOptionals *InformationAPISearchAppsOpts) (AppInfoList, *http.Response, error)
- type Library
- type LibraryList
- type PromotionCampaign
- type PromotionCampaignList
- type PromotionCampaignUpdates
- type PromotionCampaignsAPIService
- func (a *PromotionCampaignsAPIService) Get(ctx context.Context, campaign string) (PromotionCampaign, *http.Response, error)
- func (a *PromotionCampaignsAPIService) List(ctx context.Context) (PromotionCampaignList, *http.Response, error)
- func (a *PromotionCampaignsAPIService) Update(ctx context.Context, body PromotionCampaignUpdates, ...) (string, *http.Response, error)
- type PromotionCampaignsAPIUpdateOpts
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { InformationAPI *InformationAPIService PromotionCampaignsAPI *PromotionCampaignsAPIService // contains filtered or unexported fields }
APIClient manages communication with the AppBrain API API v2.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
ChangeBasePath allows switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
APIResponse defines the structure of a generic response from the AppBrain API
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse is a generator method returning a new instance of *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError is a generator method returning a new instance of *APIResponse for failed API requests not including a regular response
type AppInfo ¶
type AppInfo struct { // package Pkg string `json:"package,omitempty"` // most recent version VersionString string `json:"versionString,omitempty"` // most recent version code VersionCode int32 `json:"versionCode,omitempty"` // name of the app Name string `json:"name,omitempty"` // short one-line description of the app ShortDescription string `json:"shortDescription,omitempty"` // description of the app Description string `json:"description,omitempty"` // market category of the app MarketCategory string `json:"marketCategory,omitempty"` // price of the app Price string `json:"price,omitempty"` // size of the APK ApkSize int64 `json:"apkSize,omitempty"` // maturity level of the app MaturityLevel string `json:"maturityLevel,omitempty"` // minimum supported SDK version MinSdkVersion int32 `json:"minSdkVersion,omitempty"` // maximum supported SDK version MaxSdkVersion int32 `json:"maxSdkVersion,omitempty"` // whether the app can be installed on external storage SupportsApp2SD string `json:"supportsApp2SD,omitempty"` // timestamp of the app's launch in seconds since epoch LaunchTime int32 `json:"launchTime,omitempty"` // timestamp of the app's latest update in seconds since epoch LastAppUpdateTime int32 `json:"lastAppUpdateTime,omitempty"` // timestamp of the last refresh of the app information in seconds since epoch InfoRefreshTime int32 `json:"infoRefreshTime,omitempty"` // Google play category of the number of downloads DownloadsCategory string `json:"downloadsCategory,omitempty"` // estimated number of downloads EstimatedDownloads int64 `json:"estimatedDownloads,omitempty"` // estimated number of downloads in the last 30 days EstimatedRecentDownloads int64 `json:"estimatedRecentDownloads,omitempty"` // average rating Rating float64 `json:"rating,omitempty"` // average rating in the last 30 days RecentRating float64 `json:"recentRating,omitempty"` // number of ratings RatingCount int32 `json:"ratingCount,omitempty"` // number of 1-star ratings Rating1StarCount int32 `json:"rating1StarCount,omitempty"` // number of 2-star ratings Rating2StarCount int32 `json:"rating2StarCount,omitempty"` // number of 3-star ratings Rating3StarCount int32 `json:"rating3StarCount,omitempty"` // number of 4-star ratings Rating4StarCount int32 `json:"rating4StarCount,omitempty"` // number of 5-star ratings Rating5StarCount int32 `json:"rating5StarCount,omitempty"` // number of +1s PlusOneCount int32 `json:"plusOneCount,omitempty"` // number of comments CommentCount int32 `json:"commentCount,omitempty"` // URL of the app's icon IconURL string `json:"iconUrl,omitempty"` // URL of the app's feature graphic FeatureGraphicURL string `json:"featureGraphicUrl,omitempty"` // YouTube URL of the app's promo video YouTubeURL string `json:"youtubeUrl,omitempty"` // name of the developer of the app DeveloperName string `json:"developerName,omitempty"` // email address of the developer DeveloperEmail string `json:"developerEmail,omitempty"` // address of the developer DeveloperAddress string `json:"developerAddress,omitempty"` // official website of the app Website string `json:"website,omitempty"` // URLs of the app's screenshots ScreenshotUrls []string `json:"screenshotUrls,omitempty"` // requested permissions Permissions []string `json:"permissions,omitempty"` // libraries used in the app Libraries []string `json:"libraries,omitempty"` }
AppInfo describes details of an app from the AppBrain API
type AppInfoList ¶
type AppInfoList struct { // List of apps Apps []AppInfo `json:"apps,omitempty"` }
AppInfoList describes a list of apps from the AppBrain API
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
Configuration defines parameters to configure the behaviour of the AppBrain API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration is a generator method returning a new *Configuration instance with the default parameters
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds specified header values as defaults to the AppBrain API client *Configuration struct
type Country ¶
type Country struct { // the two-letter ISO country code Code string `json:"code,omitempty"` // the maximum cost-per-install for a country in dollars Cpi float64 `json:"cpi,omitempty"` }
Country defines the settings for a country in a promotion campaign
type CountryInfo ¶
type CountryInfo struct { // country code Code string `json:"code,omitempty"` // name of the country Name string `json:"name,omitempty"` // minimum cost-per-install bid for app promotions in this country MinCpiBid float64 `json:"minCpiBid,omitempty"` }
CountryInfo describes a country used in a promotion campaign
type CountryList ¶
type CountryList struct { // country information Countries []CountryInfo `json:"countries,omitempty"` }
CountryList describes a list of countries for a promotion campaign
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type InformationAPIBrowseAppsOpts ¶
type InformationAPIBrowseAppsOpts struct { Sort optional.String Filter optional.String Category optional.String Offset optional.Int32 Limit optional.Int32 }
InformationAPIBrowseAppsOpts defines the parameters for the BrowseApps() API call
type InformationAPISearchAppsOpts ¶
type InformationAPISearchAppsOpts struct { Query optional.String Sort optional.String Filter optional.String Category optional.String Offset optional.Int32 Limit optional.Int32 }
InformationAPISearchAppsOpts defines the parameters for the SearchApps call of the InformationAPI
type InformationAPIService ¶
type InformationAPIService service
InformationAPIService groups methods for the AppBrain Information API
func (*InformationAPIService) BrowseApps ¶
func (a *InformationAPIService) BrowseApps(ctx context.Context, localVarOptionals *InformationAPIBrowseAppsOpts) (AppInfoList, *http.Response, error)
BrowseApps returns a list of apps matching the given criteria, including detailed information about each match
func (*InformationAPIService) GetApp ¶
func (a *InformationAPIService) GetApp(ctx context.Context, pkg string) (AppInfo, *http.Response, error)
GetApp returns detailed information about a specified app
func (*InformationAPIService) GetCountries ¶
func (a *InformationAPIService) GetCountries(ctx context.Context) (CountryList, *http.Response, error)
GetCountries returns a list of countries from the *InformationAPI Service
func (*InformationAPIService) GetLibraries ¶
func (a *InformationAPIService) GetLibraries(ctx context.Context) (LibraryList, *http.Response, error)
GetLibraries returns a list of known libraries used in apps from the *InformationAPIService
func (*InformationAPIService) SearchApps ¶
func (a *InformationAPIService) SearchApps(ctx context.Context, localVarOptionals *InformationAPISearchAppsOpts) (AppInfoList, *http.Response, error)
SearchApps returns a list of apps fromthe InformationAPIService matching the given parameters
type Library ¶
type Library struct { // identifier for the library ID string `json:"id,omitempty"` // name of the library Name string `json:"name,omitempty"` // description of the library Description string `json:"description,omitempty"` // types of the library Types []string `json:"types,omitempty"` // tags associated with the library Tags []string `json:"tags,omitempty"` // official URL of the library OfficialURL string `json:"officialUrl,omitempty"` // AppBrain URL of the library AppBrainURL string `json:"appBrainUrl,omitempty"` }
Library describes a library known to be used in apps
type LibraryList ¶
type LibraryList struct { // library information Libraries []Library `json:"libraries,omitempty"` }
LibraryList describes a list of known libraries used in apps
type PromotionCampaign ¶
type PromotionCampaign struct { // identifier of the promotion campaign Campaign string `json:"campaign,omitempty"` // state of the promotion campaign State string `json:"state,omitempty"` // name/description of the promotion campaign Name string `json:"name,omitempty"` // promotion title of the promotion campaign Title string `json:"title,omitempty"` // promotion subtitle of the promotion campaign Subtitle string `json:"subtitle,omitempty"` // daily budget of the promotion campaign in dollars DailyBudget float64 `json:"dailyBudget,omitempty"` // total remaining budget the promotion campaign in dollars RemainingBudget float64 `json:"remainingBudget,omitempty"` // attribution partner that is used for install tracking InstallTracking string `json:"installTracking,omitempty"` // clickthrough URL of the promotion campaign ClickThroughURL string `json:"clickthroughUrl,omitempty"` // list of settings for each country where the campaign is running Countries []Country `json:"countries,omitempty"` // list of publisher subIDs to allow for this campaign AllowedSubIds []string `json:"allowedSubIds,omitempty"` // list of publisher subIDs to block for this campaign BlockedSubIds []string `json:"blockedSubIds,omitempty"` }
PromotionCampaign describes a promotion campaign on the AppBrain platform
type PromotionCampaignList ¶
type PromotionCampaignList struct { // identifiers of existing promotion campaigns Campaigns []string `json:"campaigns,omitempty"` }
PromotionCampaignList describes a list of promotion campaigns
type PromotionCampaignUpdates ¶
type PromotionCampaignUpdates struct { // identifier of the promotion campaign (i.e. the package of the promoted app, eventually followed by a dash and an index for multiple campaigns per app.) Campaign string `json:"campaign"` // state of the promotion campaign State string `json:"state,omitempty"` // name/description of the promotion campaign Name string `json:"name,omitempty"` // promotion title of the promotion campaign Title string `json:"title,omitempty"` // promotion subtitle of the promotion campaign Subtitle string `json:"subtitle,omitempty"` // daily budget of the promotion campaign in dollars (a negative value indicates no budget limit) DailyBudget float64 `json:"dailyBudget,omitempty"` // total remaining budget the promotion campaign in dollars (a negative value indicates no budget limit) RemainingBudget float64 `json:"remainingBudget,omitempty"` // attribution partner that is used for install tracking InstallTracking string `json:"installTracking,omitempty"` // clickthrough URL of the promotion campaign ClickThroughURL string `json:"clickthroughUrl,omitempty"` // list of settings for each country where the campaign is running; setting this list overwrites all country settings for the promotion campaign (can't be used simultaneously with updateCountries or removeCountries) Countries []Country `json:"countries,omitempty"` // updates the provided settings for the countries (can't be used simultaneously with countries) UpdateCountries []Country `json:"updateCountries,omitempty"` // removes the provided countries from the promotion campaign (can't be used simultaneously with countries) RemoveCountries []string `json:"removeCountries,omitempty"` // list of publisher subIDs to allow for this campaign; setting this list overwrites all existing allowed subIDs (can't be used simultaneously with addAllowedSubIds) AllowedSubIds []string `json:"allowedSubIds,omitempty"` // adds publisher subIDs to the list of allowed subIDs (can't be used simultaneously with allowedSubIds) AddAllowedSubIds []string `json:"addAllowedSubIds,omitempty"` // list of publisher subIDs to block for this campaign; setting this list overwrites all existing blocked subIDs (can't be used simultaneously with addBlockedSubIds) BlockedSubIds []string `json:"blockedSubIds,omitempty"` // adds publisher subIDs to the list of blocked subIDs (can't be used simultaneously with blockedSubIds) AddBlockedSubIds []string `json:"addBlockedSubIds,omitempty"` }
PromotionCampaignUpdates describes proposed updates for a promotion campaign
type PromotionCampaignsAPIService ¶
type PromotionCampaignsAPIService service
PromotionCampaignsAPIService groups methods relating to the PromotionCampaigns AppBrain API
func (*PromotionCampaignsAPIService) Get ¶
func (a *PromotionCampaignsAPIService) Get(ctx context.Context, campaign string) (PromotionCampaign, *http.Response, error)
Get returns the details of a promotion campaign
func (*PromotionCampaignsAPIService) List ¶
func (a *PromotionCampaignsAPIService) List(ctx context.Context) (PromotionCampaignList, *http.Response, error)
List returns a list of identifiers for all promotion campaigns
func (*PromotionCampaignsAPIService) Update ¶
func (a *PromotionCampaignsAPIService) Update(ctx context.Context, body PromotionCampaignUpdates, localVarOptionals *PromotionCampaignsAPIUpdateOpts) (string, *http.Response, error)
Update creates a new promotion campaign or updates an existing one
type PromotionCampaignsAPIUpdateOpts ¶
PromotionCampaignsAPIUpdateOpts defines the parameters for the Update() call to the PromotionCampaigns API
Source Files ¶
- api_information.go
- api_promotion_campaigns.go
- client.go
- configuration.go
- model_app_info.go
- model_app_info_list.go
- model_country.go
- model_country_info.go
- model_country_list.go
- model_library.go
- model_library_list.go
- model_promotion_campaign.go
- model_promotion_campaign_list.go
- model_promotion_campaign_updates.go
- response.go