Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppPriceActiveOn ¶
AppPriceActiveOn reports whether an app price with startDate and endDate applies on now's App Store Connect pricing date (the US Pacific date, see shared.PricingDate). Start dates are inclusive and end dates are exclusive, so a price stops applying on its end date. An empty date is unbounded. known is false when a date is not a YYYY-MM-DD date.
Types ¶
type AppBasePriceStatus ¶
type AppBasePriceStatus struct {
// Configured is false when App Store Connect reports that the app's price
// schedule was never created.
Configured bool
// BaseTerritory is the schedule's base territory ID, such as USA.
BaseTerritory string
// HasPrice is true when the base territory has a manual price that is
// active now or scheduled to start later. A free price counts.
HasPrice bool
}
AppBasePriceStatus reports whether an app price schedule has a price for its base territory, using the same schedule reads as `asc pricing current`.
func FetchAppBasePriceStatus ¶
func FetchAppBasePriceStatus(ctx context.Context, client *asc.Client, scheduleID string, run AppPriceRequestRunner, now func() time.Time) (AppBasePriceStatus, error)
FetchAppBasePriceStatus reads the base territory and manual prices of the price schedule scheduleID, running each request through run. A nil run bounds each request with shared.ContextWithTimeout. A schedule that App Store Connect reports as never configured returns Configured=false without an error; every other request or decoding failure is returned so callers can treat the price as unverified. now decides today's pricing date.
type AppPriceRequestRunner ¶
AppPriceRequestRunner runs one App Store Connect request. Callers that share a request limit across concurrent reads pass a runner that applies it; the runner must bound request with a timeout derived from ctx.