Versions in this module Expand all Collapse all v0 v0.1.0 Nov 23, 2026 Changes in this version + const ButtonBookNow + const ButtonClaimOffer + const ButtonCustom + const ButtonGetDirections + const ButtonInstallApp + const ButtonVisitWebsite + const DefaultBaseURL + const DefaultMaxRetries + const DefaultTimeout + const DefaultTolerance + const EventTypeAll + const EventTypeBalanceLow + const EventTypeBalanceToppedUp + const EventTypeEventCancelled + const EventTypeEventDeleted + const EventTypeEventEnded + const EventTypeEventPublished + const EventTypeEventRescheduled + const EventTypeEventUpdated + const EventTypeInvoiceCreated + const EventTypeOfferCreated + const EventTypeOfferDeleted + const EventTypeOfferDisabled + const EventTypeOfferEnabled + const EventTypeOfferEnded + const EventTypeOfferPaused + const EventTypeOfferPaymentFailed + const EventTypeOfferPaymentSucceeded + const EventTypeOfferResumed + const EventTypeOfferStarted + const EventTypeTermsVersionIssued + const GenderAll + const GenderFemale + const GenderMale + const GenderNonBinary + const Interval24Hours + const Interval30Days + const Interval60Days + const Interval7Days + const Interval90Days + const IntervalAll + const PaymentMethodBalance + const PaymentMethodLink + const SignatureHeader + const Version + var ErrNoAPIKey = errors.New("agilisads: no API key: pass one to NewClient or set AGILIS_API_KEY") + func Bool(v bool) *bool + func Float64(v float64) *float64 + func Int(v int) *int + func Int64(v int64) *int64 + func String(v string) *string + func VerifySignature(payload []byte, header, secret string, opts ...WebhookOption) error + type APIError struct + func (e *APIError) Unwrap() error + type ActionResult struct + DryRun bool + Message string + ReturnCode string + type AgilisError struct + Body []byte + Data map[string]any + Header http.Header + Message string + ReturnCode string + StatusCode int + func (e *AgilisError) Error() string + type AnalyticsParams struct + Interval string + type AuthenticationError struct + func (e *AuthenticationError) Unwrap() error + type Band string + func (b *Band) UnmarshalJSON(data []byte) error + type CancelledEvent struct + DryRun bool + EventID int64 + Message string + ReturnCode string + Status string + type CategoriesService struct + func (s *CategoriesService) List(ctx context.Context) (*CategoryList, error) + type Category struct + CategoryID int64 + CategoryName string + type CategoryList struct + Categories []Category + type Client struct + Categories *CategoriesService + EventCategories *EventCategoriesService + EventConfig *EventConfigService + EventCurrencies *EventCurrenciesService + Events *EventsService + Interests *InterestsService + Offers *OffersService + WebhookEndpoints *WebhookEndpointsService + WebhookEvents *WebhookEventsService + func NewClient(apiKey string, opts ...Option) *Client + func (c *Client) BaseURL() string + func (c *Client) Mode() Mode + func (c *Client) String() string + type ConflictError struct + func (e *ConflictError) Unwrap() error + type ConnectionError struct + Err error + func (e *ConnectionError) Unwrap() []error + type CreateOfferParams struct + AdvertisedName *string + ButtonPreset string + ButtonText *string + CategoryID int64 + Description string + DryRun bool + Environment Environment + ExpiryDatetime string + Gender []string + IdempotencyKey string + Image *File + Interests []int64 + Location LatLng + PaymentMethod string + PushNotificationMessage string + PushNotificationTitle string + Radius int + StartDatetime string + TermsAndConditions *string + Title string + URL string + type CreateWebhookEndpointParams struct + Description *string + EnabledEvents []string + URL string + type CreatedOffer struct + Currency string + DryRun bool + IdempotencyKey string + OfferID int64 + PaymentURL *string + ReturnCode string + Status string + type Crop struct + W int + X int + Y int + type CropArea struct + H int + W int + X int + Y int + type DeleteParams struct + DryRun bool + type DeletedWebhookEndpoint struct + Deleted bool + ID string + ReturnCode string + type EditEventParams struct + Address *string + AdvertisedName *string + City *string + ClearPrice bool + CountryCode *string + Crop *Crop + Currency *string + Description *string + Image *File + Location *LatLng + PreviewToken *string + PriceMax *float64 + PriceMin *float64 + SourceEventID *int64 + Title *string + URL *string + VenueName *string + type EditedEvent struct + Category EventCategoryRef + ChangedFields []string + EventID int64 + Image string + ImageLarge string + Message string + ReturnCode string + Status string + VenueChanged bool + type Environment string + const EnvironmentLive + const EnvironmentTest + type EstimateOfferPriceParams struct + EndDatetime string + Environment Environment + Gender []string + Interests []int64 + Location LatLng + Radius int + StartDatetime string + type Event struct + Address string + AdvertisedName *string + Attendees Band + Category EventCategoryRef + City string + ClonedFromEventID *int64 + CountryCode string + CreationDatetime string + Currency *string + Description string + EndsAt string + Environment string + EventID int64 + EventStatus string + Image string + ImageLarge string + ImageThumb string + LastEditedAt *string + Latitude float64 + Longitude float64 + Owner *EventOwner + PriceMax *float64 + PriceMin *float64 + RescheduleCount int + StartsAt string + Title string + URL string + VenueName string + type EventAnalytics struct + AsOf *string + EndsAt string + EventID int64 + Interval string + Metrics EventMetrics + StartsAt string + Status string + type EventCategoriesService struct + func (s *EventCategoriesService) List(ctx context.Context) (*EventCategoryList, error) + type EventCategory struct + CategoryID int64 + CategoryName string + Code string + type EventCategoryList struct + Categories []EventCategory + type EventCategoryRef struct + CategoryID int64 + CategoryName string + type EventConfig struct + Balance float64 + Currencies []string + Currency *string + Environment string + ExchangeRateDate *string + ExchangeRatePerGBP *float64 + Image EventImageLimits + ListingFee *float64 + LivePublishingOpen bool + MaxYearsAhead int + OrganisationBalance float64 + type EventConfigService struct + func (s *EventConfigService) Get(ctx context.Context) (*EventConfig, error) + type EventCurrenciesService struct + func (s *EventCurrenciesService) List(ctx context.Context) (*EventCurrencyList, error) + type EventCurrencyList struct + Currencies []string + type EventDetails struct + AppSyncedAt *string + BillingCurrency *string + CanDelete bool + CanManage bool + HasMemberInteraction bool + History []EventHistoryEntry + ImageMaster *EventImageMaster + InvoiceID *string + ListingPrice *float64 + type EventHistoryEntry struct + Acknowledged bool + ActedBy *string + ActedByUserID *int64 + Action string + At string + Channel string + Details json.RawMessage + type EventImageLimits struct + MaxMB float64 + MinHeight int + MinWidth int + type EventImageMaster struct + Crop CropArea + Height int + URL *string + Width int + type EventList struct + Data []Event + Pagination Pagination + type EventMetrics struct + Attendees Band + Clicks int64 + InvitesAccepted Band + InvitesSent Band + type EventOwner struct + Name string + UserID int64 + type EventPreview struct + Balance float64 + BalanceAfter float64 + BalanceSufficient bool + Category EventCategoryRef + Currency string + Image *EventPreviewImage + ListingFee *float64 + LivePublishingOpen bool + PriceGBP *float64 + ReturnCode string + type EventPreviewImage struct + Crop CropArea + ExpiresAt string + Height int + MasterHeight int + MasterWidth int + PreviewToken string + PreviewURL string + Width int + type EventsService struct + func (s *EventsService) Analytics(ctx context.Context, eventID int64, params *AnalyticsParams) (*EventAnalytics, error) + func (s *EventsService) Cancel(ctx context.Context, eventID int64, params *DeleteParams) (*CancelledEvent, error) + func (s *EventsService) Delete(ctx context.Context, eventID int64, params *DeleteParams) (*ActionResult, error) + func (s *EventsService) Edit(ctx context.Context, eventID int64, params *EditEventParams) (*EditedEvent, error) + func (s *EventsService) Get(ctx context.Context, eventID int64) (*EventDetails, error) + func (s *EventsService) List(ctx context.Context, params *ListEventsParams) (*EventList, error) + func (s *EventsService) ListAutoPaging(ctx context.Context, params *ListEventsParams) *Iter[Event] + func (s *EventsService) Preview(ctx context.Context, params *PreviewEventParams) (*EventPreview, error) + func (s *EventsService) Publish(ctx context.Context, params *PublishEventParams) (*PublishedEvent, error) + func (s *EventsService) Reschedule(ctx context.Context, eventID int64, params *RescheduleEventParams) (*RescheduledEvent, error) + type File struct + func FileFromBytes(name string, data []byte) *File + func FileFromPath(path string) *File + func FileFromReader(name string, r io.Reader) *File + func (f *File) ContentType() string + func (f *File) Name() string + func (f *File) WithContentType(contentType string) *File + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type Interest struct + InterestID int64 + InterestName string + type InterestList struct + Interests []Interest + type InterestsService struct + func (s *InterestsService) List(ctx context.Context) (*InterestList, error) + type InvalidRequestError struct + func (e *InvalidRequestError) Unwrap() error + type Iter struct + func (it *Iter[T]) Current() T + func (it *Iter[T]) Err() error + func (it *Iter[T]) Next() bool + func (it *Iter[T]) Pages() int + type LatLng struct + Latitude float64 + Longitude float64 + func (l LatLng) MarshalJSON() ([]byte, error) + type ListEventsParams struct + CreatedAfter string + CreatedBefore string + Cursor string + Environment Environment + EventStatus string + Limit int + OwnerUserID int64 + type ListOffersParams struct + CreatedAfter string + CreatedBefore string + Cursor string + Environment Environment + Limit int + OfferStatus string + type ListWebhookEventsParams struct + Cursor string + DeliverySuccess *bool + Limit int + Type string + type Mode string + const ModeLive + const ModeTest + const ModeUnknown + func ModeFromKey(apiKey string) Mode + func (m Mode) Environment() Environment + type NotFoundError struct + func (e *NotFoundError) Unwrap() error + type Offer struct + AdvertisedName *string + ButtonPreset string + ButtonText *string + Category string + CreationDatetime string + Description string + ExpiryDatetime string + Gender []string + Image string + Interests []Interest + Latitude float64 + Longitude float64 + OfferID int64 + OfferStatus string + PushNotificationMessage *string + PushNotificationTitle *string + Radius float64 + StartDatetime string + Status string + TermsAndConditions *string + Title string + URL string + type OfferAnalytics struct + EndDatetime string + Interval string + Metrics OfferMetrics + OfferID int64 + StartDatetime string + Status string + type OfferList struct + Data []Offer + Pagination Pagination + type OfferMetrics struct + Clicks int64 + Views int64 + type OfferPriceEstimate struct + AdUnitPrice float64 + AdUnits int64 + Currency string + EstimatedCost float64 + ExchangeRateDate *string + ExchangeRatePerGBP *float64 + MatchingUsers int64 + PriceEstimate float64 + ReturnCode string + type OffersService struct + func (s *OffersService) Analytics(ctx context.Context, offerID int64, params *AnalyticsParams) (*OfferAnalytics, error) + func (s *OffersService) Create(ctx context.Context, params *CreateOfferParams) (*CreatedOffer, error) + func (s *OffersService) Delete(ctx context.Context, offerID int64, params *DeleteParams) (*ActionResult, error) + func (s *OffersService) EstimatePrice(ctx context.Context, params *EstimateOfferPriceParams) (*OfferPriceEstimate, error) + func (s *OffersService) List(ctx context.Context, params *ListOffersParams) (*OfferList, error) + func (s *OffersService) ListAutoPaging(ctx context.Context, params *ListOffersParams) *Iter[Offer] + func (s *OffersService) Pause(ctx context.Context, offerID int64) (*ActionResult, error) + func (s *OffersService) Resume(ctx context.Context, offerID int64) (*ActionResult, error) + type Option func(*Client) + func WithBaseURL(baseURL string) Option + func WithHTTPClient(hc HTTPDoer) Option + func WithMaxRetries(n int) Option + func WithTimeout(d time.Duration) Option + type Pagination struct + Count int + HasMore bool + Limit int + NextCursor *string + type PermissionError struct + func (e *PermissionError) Unwrap() error + type PreviewEventParams struct + Address string + AdvertisedName *string + City string + CountryCode string + Crop *Crop + Currency string + Description string + EndsAt string + Environment Environment + Image *File + Location *LatLng + PaymentMethod string + PriceMax *float64 + PriceMin *float64 + StartsAt string + Title string + URL string + VenueName string + type PublishEventParams struct + Address string + AdvertisedName *string + City string + CountryCode string + Crop *Crop + Currency string + Description string + DryRun bool + EndsAt string + Environment Environment + IdempotencyKey string + Image *File + Location LatLng + PaymentMethod string + PreviewToken string + PriceMax *float64 + PriceMin *float64 + SourceEventID *int64 + StartsAt string + Title string + URL string + VenueName string + type PublishedEvent struct + AmountCharged float64 + Category EventCategoryRef + Currency string + DryRun bool + EventID int64 + IdempotencyKey string + PaymentURL *string + ReturnCode string + Status string + type RateLimitError struct + RetryAfter time.Duration + func (e *RateLimitError) Unwrap() error + type RescheduleEventParams struct + EndsAt string + StartsAt string + type RescheduledEvent struct + EndsAt string + EventID int64 + Message string + ReturnCode string + StartsAt string + Status string + type ResendWebhookEventParams struct + EndpointID string + type ResentWebhookEvent struct + Deliveries []WebhookDelivery + ReturnCode string + WebhookEventID string + type Response struct + Header http.Header + RawJSON json.RawMessage + StatusCode int + func (r *Response) Field(name string) json.RawMessage + func (r *Response) RateLimitRemaining() int + type RollWebhookSecretParams struct + ExpiresIn string + type SendTestWebhookParams struct + Type string + type SignatureVerificationError struct + Reason string + func (e *SignatureVerificationError) Unwrap() error + type TestWebhookResult struct + Delivery *WebhookDelivery + ReturnCode string + Test bool + Type string + WebhookEventID string + type UpdateWebhookEndpointParams struct + Description *string + EnabledEvents []string + Status *string + URL *string + type WebhookDelivery struct + Attempts int + DeliveredAt *string + EndpointID string + LastError *string + LastHTTPStatus *int + NextAttemptAt *string + Status string + type WebhookEndpoint struct + Created string + Description *string + DisabledBy *string + DisabledReason *string + EnabledEvents []string + FailingSince *string + ID string + LastSuccessAt *string + Livemode bool + PreviousSecretExpiresAt *string + ReturnCode string + Secret string + Status string + URL string + type WebhookEndpointList struct + Data []WebhookEndpoint + ReturnCode string + type WebhookEndpointsService struct + func (s *WebhookEndpointsService) Create(ctx context.Context, params *CreateWebhookEndpointParams) (*WebhookEndpoint, error) + func (s *WebhookEndpointsService) Delete(ctx context.Context, endpointID string) (*DeletedWebhookEndpoint, error) + func (s *WebhookEndpointsService) Get(ctx context.Context, endpointID string) (*WebhookEndpoint, error) + func (s *WebhookEndpointsService) List(ctx context.Context) (*WebhookEndpointList, error) + func (s *WebhookEndpointsService) RollSecret(ctx context.Context, endpointID string, params *RollWebhookSecretParams) (*WebhookEndpoint, error) + func (s *WebhookEndpointsService) SendTest(ctx context.Context, endpointID string, params *SendTestWebhookParams) (*TestWebhookResult, error) + func (s *WebhookEndpointsService) Update(ctx context.Context, endpointID string, params *UpdateWebhookEndpointParams) (*WebhookEndpoint, error) + type WebhookEvent struct + Created int64 + Data WebhookEventData + Deliveries []WebhookDelivery + ID string + Livemode bool + Object string + Request WebhookEventRequest + ReturnCode string + Test bool + Type string + Version int + func ConstructEvent(payload []byte, header, secret string, opts ...WebhookOption) (*WebhookEvent, error) + type WebhookEventData struct + Fields map[string]json.RawMessage + Object json.RawMessage + func (d *WebhookEventData) DecodeObject(v any) error + func (d *WebhookEventData) Event() (*Event, error) + func (d *WebhookEventData) Offer() (*Offer, error) + func (d *WebhookEventData) UnmarshalJSON(b []byte) error + func (d WebhookEventData) MarshalJSON() ([]byte, error) + type WebhookEventList struct + Data []WebhookEvent + Pagination Pagination + ReturnCode string + type WebhookEventRequest struct + IdempotencyKey *string + Source string + type WebhookEventsService struct + func (s *WebhookEventsService) Get(ctx context.Context, webhookEventID string) (*WebhookEvent, error) + func (s *WebhookEventsService) List(ctx context.Context, params *ListWebhookEventsParams) (*WebhookEventList, error) + func (s *WebhookEventsService) ListAutoPaging(ctx context.Context, params *ListWebhookEventsParams) *Iter[WebhookEvent] + func (s *WebhookEventsService) Resend(ctx context.Context, webhookEventID string, params *ResendWebhookEventParams) (*ResentWebhookEvent, error) + type WebhookOption func(*webhookConfig) + func WithNow(now func() time.Time) WebhookOption + func WithTolerance(d time.Duration) WebhookOption