Documentation
¶
Index ¶
- Constants
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func Pointer[T any](v T) *T
- func String(s string) *string
- type Advertisements
- type BenefitGrants
- func (s *BenefitGrants) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalBenefitGrantsGetResponse, error)
- func (s *BenefitGrants) List(ctx context.Context, request operations.CustomerPortalBenefitGrantsListRequest, ...) (*operations.CustomerPortalBenefitGrantsListResponse, error)
- func (s *BenefitGrants) Update(ctx context.Context, id string, ...) (*operations.CustomerPortalBenefitGrantsUpdateResponse, error)
- type Benefits
- func (s *Benefits) Create(ctx context.Context, request components.BenefitCreate, ...) (*operations.BenefitsCreateResponse, error)
- func (s *Benefits) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.BenefitsDeleteResponse, error)
- func (s *Benefits) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.BenefitsGetResponse, error)
- func (s *Benefits) Grants(ctx context.Context, request operations.BenefitsGrantsRequest, ...) (*operations.BenefitsGrantsResponse, error)
- func (s *Benefits) List(ctx context.Context, ...) (*operations.BenefitsListResponse, error)
- func (s *Benefits) Update(ctx context.Context, id string, ...) (*operations.BenefitsUpdateResponse, error)
- type CheckoutLinks
- func (s *CheckoutLinks) Create(ctx context.Context, request components.CheckoutLinkCreate, ...) (*operations.CheckoutLinksCreateResponse, error)
- func (s *CheckoutLinks) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutLinksDeleteResponse, error)
- func (s *CheckoutLinks) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutLinksGetResponse, error)
- func (s *CheckoutLinks) List(ctx context.Context, request operations.CheckoutLinksListRequest, ...) (*operations.CheckoutLinksListResponse, error)
- func (s *CheckoutLinks) Update(ctx context.Context, id string, ...) (*operations.CheckoutLinksUpdateResponse, error)
- type Checkouts
- type Clients
- func (s *Clients) Create(ctx context.Context, request components.OAuth2ClientConfiguration, ...) (*operations.Oauth2ClientsOauth2CreateClientResponse, error)
- func (s *Clients) Delete(ctx context.Context, clientID string, opts ...operations.Option) (*operations.Oauth2ClientsOauth2DeleteClientResponse, error)
- func (s *Clients) Get(ctx context.Context, clientID string, opts ...operations.Option) (*operations.Oauth2ClientsOauth2GetClientResponse, error)
- func (s *Clients) List(ctx context.Context, page *int64, limit *int64, opts ...operations.Option) (*operations.Oauth2ClientsListResponse, error)
- func (s *Clients) Update(ctx context.Context, clientID string, ...) (*operations.Oauth2ClientsOauth2UpdateClientResponse, error)
- type Custom
- func (s *Custom) ClientConfirm(ctx context.Context, clientSecret string, ...) (*operations.CheckoutsCustomClientConfirmResponse, error)
- func (s *Custom) ClientGet(ctx context.Context, clientSecret string, opts ...operations.Option) (*operations.CheckoutsCustomClientGetResponse, error)
- func (s *Custom) ClientUpdate(ctx context.Context, clientSecret string, ...) (*operations.CheckoutsCustomClientUpdateResponse, error)
- func (s *Custom) Create(ctx context.Context, request components.CheckoutCreate, ...) (*operations.CheckoutsCustomCreateResponse, error)
- func (s *Custom) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutsCustomGetResponse, error)
- func (s *Custom) List(ctx context.Context, request operations.CheckoutsCustomListRequest, ...) (*operations.CheckoutsCustomListResponse, error)
- func (s *Custom) Update(ctx context.Context, id string, checkoutUpdate components.CheckoutUpdate, ...) (*operations.CheckoutsCustomUpdateResponse, error)
- type CustomFields
- func (s *CustomFields) Create(ctx context.Context, request components.CustomFieldCreate, ...) (*operations.CustomFieldsCreateResponse, error)
- func (s *CustomFields) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomFieldsDeleteResponse, error)
- func (s *CustomFields) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomFieldsGetResponse, error)
- func (s *CustomFields) List(ctx context.Context, request operations.CustomFieldsListRequest, ...) (*operations.CustomFieldsListResponse, error)
- func (s *CustomFields) Update(ctx context.Context, id string, customFieldUpdate components.CustomFieldUpdate, ...) (*operations.CustomFieldsUpdateResponse, error)
- type CustomerPortal
- type CustomerSessions
- type Customers
- func (s *Customers) Create(ctx context.Context, request components.CustomerCreate, ...) (*operations.CustomersCreateResponse, error)
- func (s *Customers) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomersDeleteResponse, error)
- func (s *Customers) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomersGetResponse, error)
- func (s *Customers) List(ctx context.Context, request operations.CustomersListRequest, ...) (*operations.CustomersListResponse, error)
- func (s *Customers) Update(ctx context.Context, id string, customerUpdate components.CustomerUpdate, ...) (*operations.CustomersUpdateResponse, error)
- type Discounts
- func (s *Discounts) Create(ctx context.Context, request components.DiscountCreate, ...) (*operations.DiscountsCreateResponse, error)
- func (s *Discounts) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.DiscountsDeleteResponse, error)
- func (s *Discounts) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.DiscountsGetResponse, error)
- func (s *Discounts) List(ctx context.Context, request operations.DiscountsListRequest, ...) (*operations.DiscountsListResponse, error)
- func (s *Discounts) Update(ctx context.Context, id string, discountUpdate components.DiscountUpdate, ...) (*operations.DiscountsUpdateResponse, error)
- type Downloadables
- type ExternalOrganizations
- type Files
- func (s *Files) Create(ctx context.Context, request components.FileCreate, opts ...operations.Option) (*operations.FilesCreateResponse, error)
- func (s *Files) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.FilesDeleteResponse, error)
- func (s *Files) List(ctx context.Context, organizationID *string, ids []string, page *int64, ...) (*operations.FilesListResponse, error)
- func (s *Files) Update(ctx context.Context, id string, filePatch components.FilePatch, ...) (*operations.FilesUpdateResponse, error)
- func (s *Files) Uploaded(ctx context.Context, id string, ...) (*operations.FilesUploadedResponse, error)
- type HTTPClient
- type LicenseKeys
- func (s *LicenseKeys) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.LicenseKeysGetResponse, error)
- func (s *LicenseKeys) GetActivation(ctx context.Context, id string, activationID string, opts ...operations.Option) (*operations.LicenseKeysGetActivationResponse, error)
- func (s *LicenseKeys) List(ctx context.Context, ...) (*operations.LicenseKeysListResponse, error)
- func (s *LicenseKeys) Update(ctx context.Context, id string, licenseKeyUpdate components.LicenseKeyUpdate, ...) (*operations.LicenseKeysUpdateResponse, error)
- type Metrics
- type Oauth2
- func (s *Oauth2) Authorize(ctx context.Context, opts ...operations.Option) (*operations.Oauth2AuthorizeResponse, error)
- func (s *Oauth2) Introspect(ctx context.Context, ...) (*operations.Oauth2IntrospectTokenResponse, error)
- func (s *Oauth2) Revoke(ctx context.Context, request operations.Oauth2RevokeTokenRevokeTokenRequest, ...) (*operations.Oauth2RevokeTokenResponse, error)
- func (s *Oauth2) Token(ctx context.Context, request operations.Oauth2RequestTokenRequestBody, ...) (*operations.Oauth2RequestTokenResponse, error)
- func (s *Oauth2) Userinfo(ctx context.Context, opts ...operations.Option) (*operations.Oauth2UserinfoResponse, error)
- type Orders
- func (s *Orders) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.OrdersGetResponse, error)
- func (s *Orders) Invoice(ctx context.Context, id string, opts ...operations.Option) (*operations.OrdersInvoiceResponse, error)
- func (s *Orders) List(ctx context.Context, request operations.OrdersListRequest, ...) (*operations.OrdersListResponse, error)
- type Organizations
- func (s *Organizations) Create(ctx context.Context, request components.OrganizationCreate, ...) (*operations.OrganizationsCreateResponse, error)
- func (s *Organizations) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.OrganizationsGetResponse, error)
- func (s *Organizations) List(ctx context.Context, slug *string, page *int64, limit *int64, ...) (*operations.OrganizationsListResponse, error)
- func (s *Organizations) Update(ctx context.Context, id string, ...) (*operations.OrganizationsUpdateResponse, error)
- type Polar
- type PolarCustomers
- type PolarLicenseKeys
- func (s *PolarLicenseKeys) Activate(ctx context.Context, request components.LicenseKeyActivate, ...) (*operations.CustomerPortalLicenseKeysActivateResponse, error)
- func (s *PolarLicenseKeys) Deactivate(ctx context.Context, request components.LicenseKeyDeactivate, ...) (*operations.CustomerPortalLicenseKeysDeactivateResponse, error)
- func (s *PolarLicenseKeys) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysGetResponse, error)
- func (s *PolarLicenseKeys) List(ctx context.Context, ...) (*operations.CustomerPortalLicenseKeysListResponse, error)
- func (s *PolarLicenseKeys) Validate(ctx context.Context, request components.LicenseKeyValidate, ...) (*operations.CustomerPortalLicenseKeysValidateResponse, error)
- type PolarOrders
- func (s *PolarOrders) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalOrdersGetResponse, error)
- func (s *PolarOrders) Invoice(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalOrdersInvoiceResponse, error)
- func (s *PolarOrders) List(ctx context.Context, request operations.CustomerPortalOrdersListRequest, ...) (*operations.CustomerPortalOrdersListResponse, error)
- type PolarOrganizations
- type PolarSubscriptions
- func (s *PolarSubscriptions) Cancel(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsCancelResponse, error)
- func (s *PolarSubscriptions) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsGetResponse, error)
- func (s *PolarSubscriptions) List(ctx context.Context, request operations.CustomerPortalSubscriptionsListRequest, ...) (*operations.CustomerPortalSubscriptionsListResponse, error)
- func (s *PolarSubscriptions) Update(ctx context.Context, id string, ...) (*operations.CustomerPortalSubscriptionsUpdateResponse, error)
- type Products
- func (s *Products) Create(ctx context.Context, request components.ProductCreate, ...) (*operations.ProductsCreateResponse, error)
- func (s *Products) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.ProductsGetResponse, error)
- func (s *Products) List(ctx context.Context, request operations.ProductsListRequest, ...) (*operations.ProductsListResponse, error)
- func (s *Products) Update(ctx context.Context, id string, productUpdate components.ProductUpdate, ...) (*operations.ProductsUpdateResponse, error)
- func (s *Products) UpdateBenefits(ctx context.Context, id string, ...) (*operations.ProductsUpdateBenefitsResponse, error)
- type Repositories
- func (s *Repositories) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.RepositoriesGetResponse, error)
- func (s *Repositories) List(ctx context.Context, request operations.RepositoriesListRequest, ...) (*operations.RepositoriesListResponse, error)
- func (s *Repositories) Update(ctx context.Context, id string, repositoryUpdate components.RepositoryUpdate, ...) (*operations.RepositoriesUpdateResponse, error)
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithRetryConfig(retryConfig retry.Config) SDKOption
- func WithSecurity(accessToken string) SDKOption
- func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption
- func WithServer(server string) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- func WithTimeout(timeout time.Duration) SDKOption
- type Subscriptions
- func (s *Subscriptions) Export(ctx context.Context, organizationID *operations.OrganizationID, ...) (*operations.SubscriptionsExportResponse, error)
- func (s *Subscriptions) List(ctx context.Context, request operations.SubscriptionsListRequest, ...) (*operations.SubscriptionsListResponse, error)
- func (s *Subscriptions) Revoke(ctx context.Context, id string, opts ...operations.Option) (*operations.SubscriptionsRevokeResponse, error)
- func (s *Subscriptions) Update(ctx context.Context, id string, ...) (*operations.SubscriptionsUpdateResponse, error)
Constants ¶
const ( // Production environment ServerProduction string = "production" // Sandbox environment ServerSandbox string = "sandbox" )
Variables ¶
var ServerList = map[string]string{ ServerProduction: "https://api.polar.sh", ServerSandbox: "https://sandbox-api.polar.sh", }
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Advertisements ¶
type Advertisements struct {
// contains filtered or unexported fields
}
func (*Advertisements) Get ¶
func (s *Advertisements) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.AdvertisementsGetResponse, error)
Get Campaign Get an advertisement campaign by ID.
func (*Advertisements) List ¶
func (s *Advertisements) List(ctx context.Context, benefitID string, page *int64, limit *int64, sorting []components.AdvertisementSortProperty, opts ...operations.Option) (*operations.AdvertisementsListResponse, error)
List Campaigns List active advertisement campaigns for a benefit.
type BenefitGrants ¶
type BenefitGrants struct {
// contains filtered or unexported fields
}
func (*BenefitGrants) Get ¶
func (s *BenefitGrants) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalBenefitGrantsGetResponse, error)
Get Benefit Grant Get a benefit grant by ID for the authenticated customer or user.
func (*BenefitGrants) List ¶
func (s *BenefitGrants) List(ctx context.Context, request operations.CustomerPortalBenefitGrantsListRequest, opts ...operations.Option) (*operations.CustomerPortalBenefitGrantsListResponse, error)
List Benefit Grants List benefits grants of the authenticated customer or user.
func (*BenefitGrants) Update ¶
func (s *BenefitGrants) Update(ctx context.Context, id string, customerBenefitGrantUpdate components.CustomerBenefitGrantUpdate, opts ...operations.Option) (*operations.CustomerPortalBenefitGrantsUpdateResponse, error)
Update Benefit Grant Update a benefit grant for the authenticated customer or user.
type Benefits ¶
type Benefits struct {
// contains filtered or unexported fields
}
func (*Benefits) Create ¶
func (s *Benefits) Create(ctx context.Context, request components.BenefitCreate, opts ...operations.Option) (*operations.BenefitsCreateResponse, error)
Create Benefit Create a benefit.
func (*Benefits) Delete ¶
func (s *Benefits) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.BenefitsDeleteResponse, error)
Delete Benefit Delete a benefit.
> [!WARNING] > Every grants associated with the benefit will be revoked. > Users will lose access to the benefit.
func (*Benefits) Get ¶
func (s *Benefits) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.BenefitsGetResponse, error)
Get Benefit Get a benefit by ID.
func (*Benefits) Grants ¶
func (s *Benefits) Grants(ctx context.Context, request operations.BenefitsGrantsRequest, opts ...operations.Option) (*operations.BenefitsGrantsResponse, error)
Grants - List Benefit Grants List the individual grants for a benefit.
It's especially useful to check if a user has been granted a benefit.
func (*Benefits) List ¶
func (s *Benefits) List(ctx context.Context, organizationID *operations.BenefitsListQueryParamOrganizationIDFilter, typeFilter *operations.BenefitTypeFilter, page *int64, limit *int64, opts ...operations.Option) (*operations.BenefitsListResponse, error)
List Benefits List benefits.
func (*Benefits) Update ¶
func (s *Benefits) Update(ctx context.Context, id string, requestBody operations.BenefitsUpdateBenefitUpdate, opts ...operations.Option) (*operations.BenefitsUpdateResponse, error)
Update Benefit Update a benefit.
type CheckoutLinks ¶
type CheckoutLinks struct {
// contains filtered or unexported fields
}
func (*CheckoutLinks) Create ¶
func (s *CheckoutLinks) Create(ctx context.Context, request components.CheckoutLinkCreate, opts ...operations.Option) (*operations.CheckoutLinksCreateResponse, error)
Create Checkout Link Create a checkout link.
func (*CheckoutLinks) Delete ¶
func (s *CheckoutLinks) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutLinksDeleteResponse, error)
Delete Checkout Link Delete a checkout link.
func (*CheckoutLinks) Get ¶
func (s *CheckoutLinks) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutLinksGetResponse, error)
Get Checkout Link Get a checkout link by ID.
func (*CheckoutLinks) List ¶
func (s *CheckoutLinks) List(ctx context.Context, request operations.CheckoutLinksListRequest, opts ...operations.Option) (*operations.CheckoutLinksListResponse, error)
List Checkout Links List checkout links.
func (*CheckoutLinks) Update ¶
func (s *CheckoutLinks) Update(ctx context.Context, id string, checkoutLinkUpdate components.CheckoutLinkUpdate, opts ...operations.Option) (*operations.CheckoutLinksUpdateResponse, error)
Update Checkout Link Update a checkout link.
type Checkouts ¶
type Checkouts struct {
Custom *Custom
// contains filtered or unexported fields
}
func (*Checkouts) Create ¶
func (s *Checkouts) Create(ctx context.Context, request components.CheckoutLegacyCreate, opts ...operations.Option) (*operations.CheckoutsCreateResponse, error)
Create Checkout Create a checkout session.
Deprecated method: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information.. Use Create instead.
func (*Checkouts) Get ¶
func (s *Checkouts) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutsGetResponse, error)
Get Checkout Get an active checkout session by ID.
Deprecated method: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information..
type Clients ¶
type Clients struct {
// contains filtered or unexported fields
}
func (*Clients) Create ¶
func (s *Clients) Create(ctx context.Context, request components.OAuth2ClientConfiguration, opts ...operations.Option) (*operations.Oauth2ClientsOauth2CreateClientResponse, error)
Create Client Create an OAuth2 client.
func (*Clients) Delete ¶
func (s *Clients) Delete(ctx context.Context, clientID string, opts ...operations.Option) (*operations.Oauth2ClientsOauth2DeleteClientResponse, error)
Delete Client Delete an OAuth2 client.
func (*Clients) Get ¶
func (s *Clients) Get(ctx context.Context, clientID string, opts ...operations.Option) (*operations.Oauth2ClientsOauth2GetClientResponse, error)
Get Client Get an OAuth2 client by Client ID.
func (*Clients) List ¶
func (s *Clients) List(ctx context.Context, page *int64, limit *int64, opts ...operations.Option) (*operations.Oauth2ClientsListResponse, error)
List Clients List OAuth2 clients.
func (*Clients) Update ¶
func (s *Clients) Update(ctx context.Context, clientID string, oAuth2ClientConfigurationUpdate components.OAuth2ClientConfigurationUpdate, opts ...operations.Option) (*operations.Oauth2ClientsOauth2UpdateClientResponse, error)
Update Client Update an OAuth2 client.
type Custom ¶
type Custom struct {
// contains filtered or unexported fields
}
func (*Custom) ClientConfirm ¶
func (s *Custom) ClientConfirm(ctx context.Context, clientSecret string, checkoutConfirmStripe components.CheckoutConfirmStripe, opts ...operations.Option) (*operations.CheckoutsCustomClientConfirmResponse, error)
ClientConfirm - Confirm Checkout Session from Client Confirm a checkout session by client secret.
Orders and subscriptions will be processed.
func (*Custom) ClientGet ¶
func (s *Custom) ClientGet(ctx context.Context, clientSecret string, opts ...operations.Option) (*operations.CheckoutsCustomClientGetResponse, error)
ClientGet - Get Checkout Session from Client Get a checkout session by client secret.
func (*Custom) ClientUpdate ¶
func (s *Custom) ClientUpdate(ctx context.Context, clientSecret string, checkoutUpdatePublic components.CheckoutUpdatePublic, opts ...operations.Option) (*operations.CheckoutsCustomClientUpdateResponse, error)
ClientUpdate - Update Checkout Session from Client Update a checkout session by client secret.
func (*Custom) Create ¶
func (s *Custom) Create(ctx context.Context, request components.CheckoutCreate, opts ...operations.Option) (*operations.CheckoutsCustomCreateResponse, error)
Create Checkout Session Create a checkout session.
func (*Custom) Get ¶
func (s *Custom) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CheckoutsCustomGetResponse, error)
Get Checkout Session Get a checkout session by ID.
func (*Custom) List ¶
func (s *Custom) List(ctx context.Context, request operations.CheckoutsCustomListRequest, opts ...operations.Option) (*operations.CheckoutsCustomListResponse, error)
List Checkout Sessions List checkout sessions.
func (*Custom) Update ¶
func (s *Custom) Update(ctx context.Context, id string, checkoutUpdate components.CheckoutUpdate, opts ...operations.Option) (*operations.CheckoutsCustomUpdateResponse, error)
Update Checkout Session Update a checkout session.
type CustomFields ¶
type CustomFields struct {
// contains filtered or unexported fields
}
func (*CustomFields) Create ¶
func (s *CustomFields) Create(ctx context.Context, request components.CustomFieldCreate, opts ...operations.Option) (*operations.CustomFieldsCreateResponse, error)
Create Custom Field Create a custom field.
func (*CustomFields) Delete ¶
func (s *CustomFields) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomFieldsDeleteResponse, error)
Delete Custom Field Delete a custom field.
func (*CustomFields) Get ¶
func (s *CustomFields) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomFieldsGetResponse, error)
Get Custom Field Get a custom field by ID.
func (*CustomFields) List ¶
func (s *CustomFields) List(ctx context.Context, request operations.CustomFieldsListRequest, opts ...operations.Option) (*operations.CustomFieldsListResponse, error)
List Custom Fields List custom fields.
func (*CustomFields) Update ¶
func (s *CustomFields) Update(ctx context.Context, id string, customFieldUpdate components.CustomFieldUpdate, opts ...operations.Option) (*operations.CustomFieldsUpdateResponse, error)
Update Custom Field Update a custom field.
type CustomerPortal ¶
type CustomerPortal struct {
BenefitGrants *BenefitGrants
Customers *PolarCustomers
Downloadables *Downloadables
LicenseKeys *PolarLicenseKeys
Orders *PolarOrders
Organizations *PolarOrganizations
Subscriptions *PolarSubscriptions
// contains filtered or unexported fields
}
type CustomerSessions ¶
type CustomerSessions struct {
// contains filtered or unexported fields
}
func (*CustomerSessions) Create ¶
func (s *CustomerSessions) Create(ctx context.Context, request components.CustomerSessionCreate, opts ...operations.Option) (*operations.CustomerSessionsCreateResponse, error)
Create Customer Session Create a customer session.
type Customers ¶
type Customers struct {
// contains filtered or unexported fields
}
func (*Customers) Create ¶
func (s *Customers) Create(ctx context.Context, request components.CustomerCreate, opts ...operations.Option) (*operations.CustomersCreateResponse, error)
Create Customer Create a customer.
func (*Customers) Delete ¶
func (s *Customers) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomersDeleteResponse, error)
Delete Customer Delete a customer.
Immediately cancels any active subscriptions and revokes any active benefits.
func (*Customers) Get ¶
func (s *Customers) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomersGetResponse, error)
Get Customer Get a customer by ID.
func (*Customers) List ¶
func (s *Customers) List(ctx context.Context, request operations.CustomersListRequest, opts ...operations.Option) (*operations.CustomersListResponse, error)
List Customers List customers.
func (*Customers) Update ¶
func (s *Customers) Update(ctx context.Context, id string, customerUpdate components.CustomerUpdate, opts ...operations.Option) (*operations.CustomersUpdateResponse, error)
Update Customer Update a customer.
type Discounts ¶
type Discounts struct {
// contains filtered or unexported fields
}
func (*Discounts) Create ¶
func (s *Discounts) Create(ctx context.Context, request components.DiscountCreate, opts ...operations.Option) (*operations.DiscountsCreateResponse, error)
Create Discount Create a discount.
func (*Discounts) Delete ¶
func (s *Discounts) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.DiscountsDeleteResponse, error)
Delete Discount Delete a discount.
func (*Discounts) Get ¶
func (s *Discounts) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.DiscountsGetResponse, error)
Get Discount Get a discount by ID.
func (*Discounts) List ¶
func (s *Discounts) List(ctx context.Context, request operations.DiscountsListRequest, opts ...operations.Option) (*operations.DiscountsListResponse, error)
List Discounts List discounts.
func (*Discounts) Update ¶
func (s *Discounts) Update(ctx context.Context, id string, discountUpdate components.DiscountUpdate, opts ...operations.Option) (*operations.DiscountsUpdateResponse, error)
Update Discount Update a discount.
type Downloadables ¶
type Downloadables struct {
// contains filtered or unexported fields
}
func (*Downloadables) Get ¶
func (s *Downloadables) Get(ctx context.Context, token string, opts ...operations.Option) (*operations.CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse, error)
Get Downloadable
func (*Downloadables) List ¶
func (s *Downloadables) List(ctx context.Context, organizationID *operations.CustomerPortalDownloadablesListQueryParamOrganizationIDFilter, benefitID *operations.CustomerPortalDownloadablesListQueryParamBenefitIDFilter, page *int64, limit *int64, opts ...operations.Option) (*operations.CustomerPortalDownloadablesListResponse, error)
List Downloadables
type ExternalOrganizations ¶
type ExternalOrganizations struct {
// contains filtered or unexported fields
}
func (*ExternalOrganizations) List ¶
func (s *ExternalOrganizations) List(ctx context.Context, request operations.ExternalOrganizationsListRequest, opts ...operations.Option) (*operations.ExternalOrganizationsListResponse, error)
List External Organizations List external organizations.
type Files ¶
type Files struct {
// contains filtered or unexported fields
}
func (*Files) Create ¶
func (s *Files) Create(ctx context.Context, request components.FileCreate, opts ...operations.Option) (*operations.FilesCreateResponse, error)
Create File Create a file.
func (*Files) Delete ¶
func (s *Files) Delete(ctx context.Context, id string, opts ...operations.Option) (*operations.FilesDeleteResponse, error)
Delete File Delete a file.
func (*Files) List ¶
func (s *Files) List(ctx context.Context, organizationID *string, ids []string, page *int64, limit *int64, opts ...operations.Option) (*operations.FilesListResponse, error)
List Files List files.
func (*Files) Update ¶
func (s *Files) Update(ctx context.Context, id string, filePatch components.FilePatch, opts ...operations.Option) (*operations.FilesUpdateResponse, error)
Update File Update a file.
func (*Files) Uploaded ¶
func (s *Files) Uploaded(ctx context.Context, id string, fileUploadCompleted components.FileUploadCompleted, opts ...operations.Option) (*operations.FilesUploadedResponse, error)
Uploaded - Complete File Upload Complete a file upload.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type LicenseKeys ¶
type LicenseKeys struct {
// contains filtered or unexported fields
}
func (*LicenseKeys) Get ¶
func (s *LicenseKeys) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.LicenseKeysGetResponse, error)
Get License Key Get a license key.
func (*LicenseKeys) GetActivation ¶
func (s *LicenseKeys) GetActivation(ctx context.Context, id string, activationID string, opts ...operations.Option) (*operations.LicenseKeysGetActivationResponse, error)
GetActivation - Get Activation Get a license key activation.
func (*LicenseKeys) List ¶
func (s *LicenseKeys) List(ctx context.Context, organizationID *operations.LicenseKeysListQueryParamOrganizationIDFilter, benefitID *operations.QueryParamBenefitIDFilter, page *int64, limit *int64, opts ...operations.Option) (*operations.LicenseKeysListResponse, error)
List License Keys Get license keys connected to the given organization & filters.
func (*LicenseKeys) Update ¶
func (s *LicenseKeys) Update(ctx context.Context, id string, licenseKeyUpdate components.LicenseKeyUpdate, opts ...operations.Option) (*operations.LicenseKeysUpdateResponse, error)
Update License Key Update a license key.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) Get ¶
func (s *Metrics) Get(ctx context.Context, request operations.MetricsGetRequest, opts ...operations.Option) (*operations.MetricsGetResponse, error)
Get Metrics Get metrics about your orders and subscriptions.
func (*Metrics) Limits ¶
func (s *Metrics) Limits(ctx context.Context, opts ...operations.Option) (*operations.MetricsLimitsResponse, error)
Limits - Get Metrics Limits Get the interval limits for the metrics endpoint.
type Oauth2 ¶
type Oauth2 struct {
Clients *Clients
// contains filtered or unexported fields
}
func (*Oauth2) Authorize ¶
func (s *Oauth2) Authorize(ctx context.Context, opts ...operations.Option) (*operations.Oauth2AuthorizeResponse, error)
Authorize
func (*Oauth2) Introspect ¶
func (s *Oauth2) Introspect(ctx context.Context, request operations.Oauth2IntrospectTokenIntrospectTokenRequest, opts ...operations.Option) (*operations.Oauth2IntrospectTokenResponse, error)
Introspect Token Get information about an access token.
func (*Oauth2) Revoke ¶
func (s *Oauth2) Revoke(ctx context.Context, request operations.Oauth2RevokeTokenRevokeTokenRequest, opts ...operations.Option) (*operations.Oauth2RevokeTokenResponse, error)
Revoke Token Revoke an access token or a refresh token.
func (*Oauth2) Token ¶
func (s *Oauth2) Token(ctx context.Context, request operations.Oauth2RequestTokenRequestBody, opts ...operations.Option) (*operations.Oauth2RequestTokenResponse, error)
Request Token Request an access token using a valid grant.
func (*Oauth2) Userinfo ¶
func (s *Oauth2) Userinfo(ctx context.Context, opts ...operations.Option) (*operations.Oauth2UserinfoResponse, error)
Userinfo - Get User Info Get information about the authenticated user.
type Orders ¶
type Orders struct {
// contains filtered or unexported fields
}
func (*Orders) Get ¶
func (s *Orders) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.OrdersGetResponse, error)
Get Order Get an order by ID.
func (*Orders) Invoice ¶
func (s *Orders) Invoice(ctx context.Context, id string, opts ...operations.Option) (*operations.OrdersInvoiceResponse, error)
Invoice - Get Order Invoice Get an order's invoice data.
func (*Orders) List ¶
func (s *Orders) List(ctx context.Context, request operations.OrdersListRequest, opts ...operations.Option) (*operations.OrdersListResponse, error)
List Orders List orders.
type Organizations ¶
type Organizations struct {
// contains filtered or unexported fields
}
func (*Organizations) Create ¶
func (s *Organizations) Create(ctx context.Context, request components.OrganizationCreate, opts ...operations.Option) (*operations.OrganizationsCreateResponse, error)
Create Organization Create an organization.
func (*Organizations) Get ¶
func (s *Organizations) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.OrganizationsGetResponse, error)
Get Organization Get an organization by ID.
func (*Organizations) List ¶
func (s *Organizations) List(ctx context.Context, slug *string, page *int64, limit *int64, sorting []components.OrganizationSortProperty, opts ...operations.Option) (*operations.OrganizationsListResponse, error)
List Organizations List organizations.
func (*Organizations) Update ¶
func (s *Organizations) Update(ctx context.Context, id string, organizationUpdate components.OrganizationUpdate, opts ...operations.Option) (*operations.OrganizationsUpdateResponse, error)
Update Organization Update an organization.
type Polar ¶
type Polar struct {
ExternalOrganizations *ExternalOrganizations
Repositories *Repositories
Organizations *Organizations
Subscriptions *Subscriptions
Advertisements *Advertisements
Oauth2 *Oauth2
Benefits *Benefits
Products *Products
Orders *Orders
Checkouts *Checkouts
Files *Files
Metrics *Metrics
LicenseKeys *LicenseKeys
CheckoutLinks *CheckoutLinks
CustomFields *CustomFields
Discounts *Discounts
Customers *Customers
CustomerPortal *CustomerPortal
CustomerSessions *CustomerSessions
// contains filtered or unexported fields
}
Polar API: Polar HTTP and Webhooks API Read the docs at https://docs.polar.sh/api
type PolarCustomers ¶
type PolarCustomers struct {
// contains filtered or unexported fields
}
func (*PolarCustomers) Get ¶
func (s *PolarCustomers) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalCustomersGetResponse, error)
Get Customer Get a customer by ID for the authenticated customer or user.
type PolarLicenseKeys ¶
type PolarLicenseKeys struct {
// contains filtered or unexported fields
}
func (*PolarLicenseKeys) Activate ¶
func (s *PolarLicenseKeys) Activate(ctx context.Context, request components.LicenseKeyActivate, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysActivateResponse, error)
Activate License Key Activate a license key instance.
func (*PolarLicenseKeys) Deactivate ¶
func (s *PolarLicenseKeys) Deactivate(ctx context.Context, request components.LicenseKeyDeactivate, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysDeactivateResponse, error)
Deactivate License Key Deactivate a license key instance.
func (*PolarLicenseKeys) Get ¶
func (s *PolarLicenseKeys) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysGetResponse, error)
Get License Key Get a license key.
func (*PolarLicenseKeys) List ¶
func (s *PolarLicenseKeys) List(ctx context.Context, organizationID *operations.CustomerPortalLicenseKeysListQueryParamOrganizationIDFilter, benefitID *string, page *int64, limit *int64, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysListResponse, error)
List License Keys
func (*PolarLicenseKeys) Validate ¶
func (s *PolarLicenseKeys) Validate(ctx context.Context, request components.LicenseKeyValidate, opts ...operations.Option) (*operations.CustomerPortalLicenseKeysValidateResponse, error)
Validate License Key Validate a license key.
type PolarOrders ¶
type PolarOrders struct {
// contains filtered or unexported fields
}
func (*PolarOrders) Get ¶
func (s *PolarOrders) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalOrdersGetResponse, error)
Get Order Get an order by ID for the authenticated customer or user.
func (*PolarOrders) Invoice ¶
func (s *PolarOrders) Invoice(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalOrdersInvoiceResponse, error)
Invoice - Get Order Invoice Get an order's invoice data.
func (*PolarOrders) List ¶
func (s *PolarOrders) List(ctx context.Context, request operations.CustomerPortalOrdersListRequest, opts ...operations.Option) (*operations.CustomerPortalOrdersListResponse, error)
List Orders List orders of the authenticated customer or user.
type PolarOrganizations ¶
type PolarOrganizations struct {
// contains filtered or unexported fields
}
func (*PolarOrganizations) Get ¶
func (s *PolarOrganizations) Get(ctx context.Context, slug string, opts ...operations.Option) (*operations.CustomerPortalOrganizationsGetResponse, error)
Get Organization Get a customer portal's organization by slug.
type PolarSubscriptions ¶
type PolarSubscriptions struct {
// contains filtered or unexported fields
}
func (*PolarSubscriptions) Cancel ¶
func (s *PolarSubscriptions) Cancel(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsCancelResponse, error)
Cancel Subscription Cancel a subscription of the authenticated customer or user.
func (*PolarSubscriptions) Get ¶
func (s *PolarSubscriptions) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsGetResponse, error)
Get Subscription Get a subscription for the authenticated customer or user.
func (*PolarSubscriptions) List ¶
func (s *PolarSubscriptions) List(ctx context.Context, request operations.CustomerPortalSubscriptionsListRequest, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsListResponse, error)
List Subscriptions List subscriptions of the authenticated customer or user.
func (*PolarSubscriptions) Update ¶
func (s *PolarSubscriptions) Update(ctx context.Context, id string, customerSubscriptionUpdate components.CustomerSubscriptionUpdate, opts ...operations.Option) (*operations.CustomerPortalSubscriptionsUpdateResponse, error)
Update Subscription Update a subscription of the authenticated customer or user.
type Products ¶
type Products struct {
// contains filtered or unexported fields
}
func (*Products) Create ¶
func (s *Products) Create(ctx context.Context, request components.ProductCreate, opts ...operations.Option) (*operations.ProductsCreateResponse, error)
Create Product Create a product.
func (*Products) Get ¶
func (s *Products) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.ProductsGetResponse, error)
Get Product Get a product by ID.
func (*Products) List ¶
func (s *Products) List(ctx context.Context, request operations.ProductsListRequest, opts ...operations.Option) (*operations.ProductsListResponse, error)
List Products List products.
func (*Products) Update ¶
func (s *Products) Update(ctx context.Context, id string, productUpdate components.ProductUpdate, opts ...operations.Option) (*operations.ProductsUpdateResponse, error)
Update Product Update a product.
func (*Products) UpdateBenefits ¶
func (s *Products) UpdateBenefits(ctx context.Context, id string, productBenefitsUpdate components.ProductBenefitsUpdate, opts ...operations.Option) (*operations.ProductsUpdateBenefitsResponse, error)
UpdateBenefits - Update Product Benefits Update benefits granted by a product.
type Repositories ¶
type Repositories struct {
// contains filtered or unexported fields
}
func (*Repositories) Get ¶
func (s *Repositories) Get(ctx context.Context, id string, opts ...operations.Option) (*operations.RepositoriesGetResponse, error)
Get Repository Get a repository by ID.
func (*Repositories) List ¶
func (s *Repositories) List(ctx context.Context, request operations.RepositoriesListRequest, opts ...operations.Option) (*operations.RepositoriesListResponse, error)
List Repositories List repositories.
func (*Repositories) Update ¶
func (s *Repositories) Update(ctx context.Context, id string, repositoryUpdate components.RepositoryUpdate, opts ...operations.Option) (*operations.RepositoriesUpdateResponse, error)
Update Repository Update a repository.
type SDKOption ¶
type SDKOption func(*Polar)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithRetryConfig ¶
func WithSecurity ¶
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServer ¶
WithServer allows the overriding of the default server by name
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
func WithTemplatedServerURL ¶
WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTimeout ¶
WithTimeout Optional request timeout applied to each operation
type Subscriptions ¶
type Subscriptions struct {
// contains filtered or unexported fields
}
func (*Subscriptions) Export ¶
func (s *Subscriptions) Export(ctx context.Context, organizationID *operations.OrganizationID, opts ...operations.Option) (*operations.SubscriptionsExportResponse, error)
Export Subscriptions Export subscriptions as a CSV file.
func (*Subscriptions) List ¶
func (s *Subscriptions) List(ctx context.Context, request operations.SubscriptionsListRequest, opts ...operations.Option) (*operations.SubscriptionsListResponse, error)
List Subscriptions List subscriptions.
func (*Subscriptions) Revoke ¶ added in v0.1.1
func (s *Subscriptions) Revoke(ctx context.Context, id string, opts ...operations.Option) (*operations.SubscriptionsRevokeResponse, error)
Revoke Subscription Revoke a subscription, i.e cancel immediately.
func (*Subscriptions) Update ¶ added in v0.1.1
func (s *Subscriptions) Update(ctx context.Context, id string, subscriptionUpdate components.SubscriptionUpdate, opts ...operations.Option) (*operations.SubscriptionsUpdateResponse, error)
Update Subscription Update a subscription.
Source Files
¶
- advertisements.go
- benefitgrants.go
- benefits.go
- checkoutlinks.go
- checkouts.go
- clients.go
- custom.go
- customerportal.go
- customers.go
- customersessions.go
- customfields.go
- discounts.go
- downloadables.go
- externalorganizations.go
- files.go
- licensekeys.go
- metrics.go
- oauth2.go
- orders.go
- organizations.go
- polar.go
- polarcustomers.go
- polarlicensekeys.go
- polarorders.go
- polarorganizations.go
- polarsubscriptions.go
- products.go
- repositories.go
- subscriptions.go