rubago

package module
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 14 Imported by: 0

README

Ruba for Go

Use typed clients to connect Go services to Ruba payments, billing, customers, subscriptions, orders, and webhooks.

Add it to your project

go get github.com/Rubadot/ruba-go

Make a request

package main

import (
	"context"
	"log"
	"os"

	rubago "github.com/Rubadot/ruba-go"
)

func main() {
	client := rubago.New(
		rubago.WithSecurity(os.Getenv("RUBA_ACCESS_TOKEN")),
	)

	result, err := client.Organizations.List(
		context.Background(),
		nil,
		rubago.Pointer[int64](1),
		rubago.Pointer[int64](10),
		nil,
	)
	if err != nil {
		log.Fatal(err)
	}

	log.Println(result.ListResourceOrganization)
}

Set a custom server when you need the sandbox. Authentication uses a Ruba access token sent as an HTTP bearer token.

Learn more

Start with the Ruba documentation, then use the API reference for endpoint details. Go SDK problems belong in this repository's issue tracker.

License

MIT

Documentation

Index

Constants

View Source
const (
	// Production environment
	ServerProduction string = "production"
	// Sandbox environment
	ServerSandbox string = "sandbox"
)

Variables

View Source
var ServerList = map[string]string{
	ServerProduction: "https://api.getruba.com",
	ServerSandbox:    "https://sandbox-api.getruba.com",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type BenefitGrants

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

func (*BenefitGrants) List

List Benefit Grants List benefit grants across all benefits for the authenticated organization.

**Scopes**: `benefits:read` `benefits:write`

type Benefits

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

func (*Benefits) Create

Create Benefit Create a benefit.

**Scopes**: `benefits:write`

func (*Benefits) Delete

Delete Benefit Delete a benefit.

> [!WARNING] > Every grants associated with the benefit will be revoked. > Users will lose access to the benefit.

**Scopes**: `benefits:write`

func (*Benefits) Get

Get Benefit Get a benefit by ID.

**Scopes**: `benefits:read` `benefits:write`

func (*Benefits) Grants

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.

**Scopes**: `benefits:read` `benefits:write`

func (*Benefits) List

List Benefits List benefits.

**Scopes**: `benefits:read` `benefits:write`

func (*Benefits) Update

Update Benefit Update a benefit.

**Scopes**: `benefits:write`

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

func (*CheckoutLinks) Create

Create Checkout Link Create a checkout link.

**Scopes**: `checkout_links:write`

func (*CheckoutLinks) Delete

Delete Checkout Link Delete a checkout link.

**Scopes**: `checkout_links:write`

func (*CheckoutLinks) Get

Get Checkout Link Get a checkout link by ID.

**Scopes**: `checkout_links:read` `checkout_links:write`

func (*CheckoutLinks) List

List Checkout Links List checkout links.

**Scopes**: `checkout_links:read` `checkout_links:write`

func (*CheckoutLinks) Update

Update Checkout Link Update a checkout link.

**Scopes**: `checkout_links:write`

type Checkouts

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

func (*Checkouts) ClientConfirm

func (s *Checkouts) ClientConfirm(ctx context.Context, clientSecret string, checkoutConfirmStripe components.CheckoutConfirmStripe, opts ...operations.Option) (*operations.CheckoutsClientConfirmResponse, error)

ClientConfirm - Confirm Checkout Session from Client Confirm a checkout session by client secret.

Orders and subscriptions will be processed.

func (*Checkouts) ClientGet

func (s *Checkouts) ClientGet(ctx context.Context, clientSecret string, opts ...operations.Option) (*operations.CheckoutsClientGetResponse, error)

ClientGet - Get Checkout Session from Client Get a checkout session by client secret.

func (*Checkouts) ClientUpdate

func (s *Checkouts) ClientUpdate(ctx context.Context, clientSecret string, checkoutUpdatePublic components.CheckoutUpdatePublic, opts ...operations.Option) (*operations.CheckoutsClientUpdateResponse, error)

ClientUpdate - Update Checkout Session from Client Update a checkout session by client secret.

func (*Checkouts) Create

Create Checkout Session Create a checkout session.

**Scopes**: `checkouts:write`

func (*Checkouts) Get

Get Checkout Session Get a checkout session by ID.

**Scopes**: `checkouts:read` `checkouts:write`

func (*Checkouts) List

List Checkout Sessions List checkout sessions.

**Scopes**: `checkouts:read` `checkouts:write`

func (*Checkouts) Update

Update Checkout Session Update a checkout session.

**Scopes**: `checkouts:write`

type Clients

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

func (*Clients) Create

Create Client Create an OAuth2 client.

func (*Clients) Delete

Delete Client Delete an OAuth2 client.

func (*Clients) Get

Get Client Get an OAuth2 client by Client ID.

func (*Clients) Update

Update Client Update an OAuth2 client.

type CustomFields

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

func (*CustomFields) Create

Create Custom Field Create a custom field.

**Scopes**: `custom_fields:write`

func (*CustomFields) Delete

Delete Custom Field Delete a custom field.

**Scopes**: `custom_fields:write`

func (*CustomFields) Get

Get Custom Field Get a custom field by ID.

**Scopes**: `custom_fields:read` `custom_fields:write`

func (*CustomFields) List

List Custom Fields List custom fields.

**Scopes**: `custom_fields:read` `custom_fields:write`

func (*CustomFields) Update

Update Custom Field Update a custom field.

**Scopes**: `custom_fields:write`

type CustomerMeters

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

func (*CustomerMeters) Get

Get Customer Meter Get a customer meter by ID.

**Scopes**: `customer_meters:read`

func (*CustomerMeters) List

List Customer Meters List customer meters.

**Scopes**: `customer_meters:read`

type CustomerPortal

type CustomerPortal struct {
	BenefitGrants   *RubaBenefitGrants
	Customers       *RubaCustomers
	CustomerMeters  *RubaCustomerMeters
	Seats           *Seats
	CustomerSession *CustomerSession
	Downloadables   *Downloadables
	LicenseKeys     *RubaLicenseKeys
	Members         *RubaMembers
	Orders          *RubaOrders
	Organizations   *RubaOrganizations
	Subscriptions   *RubaSubscriptions
	Wallets         *Wallets
	// contains filtered or unexported fields
}

type CustomerSeats

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

func (*CustomerSeats) AssignSeat

AssignSeat - Assign Seat **Scopes**: `customer_seats:write`

func (*CustomerSeats) ClaimSeat

ClaimSeat - Claim Seat

func (*CustomerSeats) GetClaimInfo

func (s *CustomerSeats) GetClaimInfo(ctx context.Context, invitationToken string, opts ...operations.Option) (*operations.CustomerSeatsGetClaimInfoResponse, error)

GetClaimInfo - Get Claim Info

func (*CustomerSeats) ListSeats

func (s *CustomerSeats) ListSeats(ctx context.Context, subscriptionID *string, orderID *string, opts ...operations.Option) (*operations.CustomerSeatsListSeatsResponse, error)

ListSeats - List Seats **Scopes**: `customer_seats:write`

func (*CustomerSeats) ResendInvitation

ResendInvitation - Resend Invitation **Scopes**: `customer_seats:write`

func (*CustomerSeats) RevokeSeat

RevokeSeat - Revoke Seat **Scopes**: `customer_seats:write`

type CustomerSession

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

func (*CustomerSession) GetAuthenticatedUser

GetAuthenticatedUser - Get Authenticated Portal User Get information about the currently authenticated portal user.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*CustomerSession) Introspect

Introspect Customer Session Introspect the current session and return its information.

**Scopes**: `customer_portal:read` `customer_portal:write`

type CustomerSessions

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

func (*CustomerSessions) Create

Create Customer Session Create a customer session.

For organizations with `member_model_enabled`, this will automatically create a member session for the owner member of the customer.

**Scopes**: `customer_sessions:write`

type Customers

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

func (*Customers) Create

Create Customer Create a customer.

**Scopes**: `customers:write`

func (*Customers) Delete

func (s *Customers) Delete(ctx context.Context, id string, anonymize *bool, opts ...operations.Option) (*operations.CustomersDeleteResponse, error)

Delete Customer Delete a customer.

This action cannot be undone and will immediately: - Cancel any active subscriptions for the customer - Revoke all their benefits - Clear any `external_id`

Use it only in the context of deleting a user within your own service. Otherwise, use more granular API endpoints to cancel a specific subscription or revoke certain benefits.

Note: The customers information will nonetheless be retained for historic orders and subscriptions.

Set `anonymize=true` to also anonymize PII for GDPR compliance.

**Scopes**: `customers:write`

func (*Customers) DeleteExternal

func (s *Customers) DeleteExternal(ctx context.Context, externalID string, anonymize *bool, opts ...operations.Option) (*operations.CustomersDeleteExternalResponse, error)

DeleteExternal - Delete Customer by External ID Delete a customer by external ID.

Immediately cancels any active subscriptions and revokes any active benefits.

Set `anonymize=true` to also anonymize PII for GDPR compliance.

**Scopes**: `customers:write`

func (*Customers) Export

Export Customers Export customers as a CSV file.

**Scopes**: `customers:read` `customers:write`

func (*Customers) Get

Get Customer Get a customer by ID.

**Scopes**: `customers:read` `customers:write`

func (*Customers) GetExternal

func (s *Customers) GetExternal(ctx context.Context, externalID string, opts ...operations.Option) (*operations.CustomersGetExternalResponse, error)

GetExternal - Get Customer by External ID Get a customer by external ID.

**Scopes**: `customers:read` `customers:write`

func (*Customers) GetState

GetState - Get Customer State Get a customer state by ID.

The customer state includes information about the customer's active subscriptions and benefits.

It's the ideal endpoint to use when you need to get a full overview of a customer's status.

**Scopes**: `customers:read` `customers:write`

func (*Customers) GetStateExternal

func (s *Customers) GetStateExternal(ctx context.Context, externalID string, opts ...operations.Option) (*operations.CustomersGetStateExternalResponse, error)

GetStateExternal - Get Customer State by External ID Get a customer state by external ID.

The customer state includes information about the customer's active subscriptions and benefits.

It's the ideal endpoint to use when you need to get a full overview of a customer's status.

**Scopes**: `customers:read` `customers:write`

func (*Customers) List

List Customers List customers.

**Scopes**: `customers:read` `customers:write`

func (*Customers) Update

Update Customer Update a customer.

**Scopes**: `customers:write`

func (*Customers) UpdateExternal

func (s *Customers) UpdateExternal(ctx context.Context, externalID string, customerUpdateExternalID components.CustomerUpdateExternalID, opts ...operations.Option) (*operations.CustomersUpdateExternalResponse, error)

UpdateExternal - Update Customer by External ID Update a customer by external ID.

**Scopes**: `customers:write`

type Discounts

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

func (*Discounts) Create

Create Discount Create a discount.

**Scopes**: `discounts:write`

func (*Discounts) Delete

Delete Discount Delete a discount.

**Scopes**: `discounts:write`

func (*Discounts) Get

Get Discount Get a discount by ID.

**Scopes**: `discounts:read` `discounts:write`

func (*Discounts) List

List Discounts List discounts.

**Scopes**: `discounts:read` `discounts:write`

func (*Discounts) Update

Update Discount Update a discount.

**Scopes**: `discounts:write`

type Disputes

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

func (*Disputes) Get

Get Dispute Get a dispute by ID.

**Scopes**: `disputes:read`

func (*Disputes) List

List Disputes List disputes.

**Scopes**: `disputes:read`

type Downloadables

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

func (*Downloadables) List

List Downloadables **Scopes**: `customer_portal:read` `customer_portal:write`

type EventTypes

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

func (*EventTypes) List

List Event Types List event types with aggregated statistics.

**Scopes**: `events:read` `events:write`

func (*EventTypes) Update

Update Event Type Update an event type's label.

type Events

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

func (*Events) Get

Get Event Get an event by ID.

**Scopes**: `events:read` `events:write`

func (*Events) Ingest

Ingest Events Ingest batch of events.

**Scopes**: `events:write`

func (*Events) List

List Events List events.

**Scopes**: `events:read` `events:write`

func (*Events) ListNames

ListNames - List Event Names List event names.

**Scopes**: `events:read` `events:write`

type Files

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

func (*Files) Create

Create File Create a file.

**Scopes**: `files:write`

func (*Files) Delete

Delete File Delete a file.

**Scopes**: `files:write`

func (*Files) List

List Files List files.

**Scopes**: `files:read` `files:write`

func (*Files) Update

Update File Update a file.

**Scopes**: `files:write`

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.

**Scopes**: `files:write`

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type LicenseKeys

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

func (*LicenseKeys) Activate

Activate License Key Activate a license key instance.

**Scopes**: `license_keys:write`

func (*LicenseKeys) Deactivate

Deactivate License Key Deactivate a license key instance.

**Scopes**: `license_keys:write`

func (*LicenseKeys) Get

Get License Key Get a license key.

**Scopes**: `license_keys:read` `license_keys:write`

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.

**Scopes**: `license_keys:read` `license_keys:write`

func (*LicenseKeys) List

List License Keys Get license keys connected to the given organization & filters.

**Scopes**: `license_keys:read` `license_keys:write`

func (*LicenseKeys) Update

Update License Key Update a license key.

**Scopes**: `license_keys:write`

func (*LicenseKeys) Validate

Validate License Key Validate a license key.

**Scopes**: `license_keys:write`

type Members

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

func (*Members) CreateMember

CreateMember - Create Member Create a new member for a customer.

Only B2B customers with the member management feature enabled can add members. The authenticated user or organization must have access to the customer's organization.

**Scopes**: `members:write`

func (*Members) DeleteMember

DeleteMember - Delete Member Delete a member.

The authenticated user or organization must have access to the member's organization.

**Scopes**: `members:write`

func (*Members) GetMember

GetMember - Get Member Get a member by ID.

The authenticated user or organization must have access to the member's organization.

**Scopes**: `members:read` `members:write`

func (*Members) ListMembers

ListMembers - List Members List members with optional customer ID filter.

**Scopes**: `members:read` `members:write`

func (*Members) UpdateMember

UpdateMember - Update Member Update a member.

Only name and role can be updated. The authenticated user or organization must have access to the member's organization.

**Scopes**: `members:write`

type Meters

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

func (*Meters) Create

Create Meter Create a meter.

**Scopes**: `meters:write`

func (*Meters) Get

Get Meter Get a meter by ID.

**Scopes**: `meters:read` `meters:write`

func (*Meters) List

List Meters List meters.

**Scopes**: `meters:read` `meters:write`

func (*Meters) Quantities

Quantities - Get Meter Quantities Get quantities of a meter over a time period.

**Scopes**: `meters:read` `meters:write`

func (*Meters) Update

Update Meter Update a meter.

**Scopes**: `meters:write`

type Metrics

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

func (*Metrics) CreateDashboard

CreateDashboard - Create Metric Dashboard Create a user-defined metric dashboard.

**Scopes**: `metrics:write`

func (*Metrics) DeleteDashboard

DeleteDashboard - Delete Metric Dashboard Delete a user-defined metric dashboard.

**Scopes**: `metrics:write`

func (*Metrics) Get

Get Metrics Get metrics about your orders and subscriptions.

Currency values are output in cents.

**Scopes**: `metrics:read`

func (*Metrics) GetDashboard

GetDashboard - Get Metric Dashboard Get a user-defined metric dashboard by ID.

**Scopes**: `metrics:read`

func (*Metrics) Limits

Limits - Get Metrics Limits Get the interval limits for the metrics endpoint.

**Scopes**: `metrics:read`

func (*Metrics) ListDashboards

ListDashboards - List Metric Dashboards List user-defined metric dashboards.

**Scopes**: `metrics:read`

func (*Metrics) UpdateDashboard

func (s *Metrics) UpdateDashboard(ctx context.Context, id string, metricDashboardUpdate components.MetricDashboardUpdate, opts ...operations.Option) (*operations.MetricsUpdateDashboardResponse, error)

UpdateDashboard - Update Metric Dashboard Update a user-defined metric dashboard.

**Scopes**: `metrics:write`

type Oauth2

type Oauth2 struct {
	Clients *Clients
	// contains filtered or unexported fields
}

func (*Oauth2) Authorize

Authorize

func (*Oauth2) Introspect

Introspect Token Get information about an access token.

func (*Oauth2) Revoke

Revoke Token Revoke an access token or a refresh token.

func (*Oauth2) Token

Request Token Request an access token using a valid grant.

func (*Oauth2) Userinfo

Userinfo - Get User Info Get information about the authenticated user.

type Orders

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

func (*Orders) Export

Export Orders Export orders as a CSV file.

**Scopes**: `orders:read`

func (*Orders) GenerateInvoice

func (s *Orders) GenerateInvoice(ctx context.Context, id string, opts ...operations.Option) (*operations.OrdersGenerateInvoiceResponse, error)

GenerateInvoice - Generate Order Invoice Trigger generation of an order's invoice.

**Scopes**: `orders:read`

func (*Orders) Get

Get Order Get an order by ID.

**Scopes**: `orders:read`

func (*Orders) Invoice

Invoice - Get Order Invoice Get an order's invoice data.

**Scopes**: `orders:read`

func (*Orders) List

List Orders List orders.

**Scopes**: `orders:read`

func (*Orders) Update

Update Order Update an order.

**Scopes**: `orders:write`

type OrganizationAccessTokens

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

func (*OrganizationAccessTokens) Create

Create **Scopes**: `organization_access_tokens:write`

func (*OrganizationAccessTokens) Delete

Delete **Scopes**: `organization_access_tokens:write`

func (*OrganizationAccessTokens) List

List List organization access tokens.

**Scopes**: `organization_access_tokens:read` `organization_access_tokens:write`

func (*OrganizationAccessTokens) Update

Update **Scopes**: `organization_access_tokens:write`

type Organizations

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

func (*Organizations) Create

Create Organization Create an organization.

**Scopes**: `organizations:write`

func (*Organizations) Get

Get Organization Get an organization by ID.

**Scopes**: `organizations:read` `organizations:write`

func (*Organizations) List

List Organizations List organizations.

**Scopes**: `organizations:read` `organizations:write`

func (*Organizations) Update

Update Organization Update an organization.

**Scopes**: `organizations:write`

type Payments

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

func (*Payments) Get

Get Payment Get a payment by ID.

**Scopes**: `payments:read`

func (*Payments) List

List Payments List payments.

**Scopes**: `payments:read`

type Products

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

func (*Products) Create

Create Product Create a product.

**Scopes**: `products:write`

func (*Products) Get

Get Product Get a product by ID.

**Scopes**: `products:read` `products:write`

func (*Products) List

List Products List products.

**Scopes**: `products:read` `products:write`

func (*Products) Update

Update Product Update a product.

**Scopes**: `products:write`

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.

**Scopes**: `products:write`

type Refunds

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

func (*Refunds) Create

Create Refund Create a refund.

**Scopes**: `refunds:write`

func (*Refunds) List

List Refunds List refunds.

**Scopes**: `refunds:read` `refunds:write`

type Ruba

type Ruba struct {
	SDKVersion               string
	Organizations            *Organizations
	Subscriptions            *Subscriptions
	Oauth2                   *Oauth2
	Benefits                 *Benefits
	BenefitGrants            *BenefitGrants
	Webhooks                 *Webhooks
	Products                 *Products
	Orders                   *Orders
	Refunds                  *Refunds
	Disputes                 *Disputes
	Checkouts                *Checkouts
	Files                    *Files
	Metrics                  *Metrics
	LicenseKeys              *LicenseKeys
	CheckoutLinks            *CheckoutLinks
	CustomFields             *CustomFields
	Discounts                *Discounts
	Customers                *Customers
	Members                  *Members
	CustomerPortal           *CustomerPortal
	CustomerSeats            *CustomerSeats
	CustomerSessions         *CustomerSessions
	Events                   *Events
	EventTypes               *EventTypes
	Meters                   *Meters
	OrganizationAccessTokens *OrganizationAccessTokens
	CustomerMeters           *CustomerMeters
	Payments                 *Payments
	// contains filtered or unexported fields
}

Ruba API: Ruba HTTP and Webhooks API Read the docs at https://docs.getruba.com/api-reference

func New

func New(opts ...SDKOption) *Ruba

New creates a new instance of the SDK with the provided options

type RubaBenefitGrants

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

func (*RubaBenefitGrants) Get

Get Benefit Grant Get a benefit grant by ID for the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaBenefitGrants) List

List Benefit Grants List benefits grants of the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaBenefitGrants) Update

Update Benefit Grant Update a benefit grant for the authenticated customer.

**Scopes**: `customer_portal:write`

type RubaCustomerMeters

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

func (*RubaCustomerMeters) Get

Get Customer Meter Get a meter by ID for the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaCustomerMeters) List

List Meters List meters of the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

type RubaCustomers

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

func (*RubaCustomers) AddPaymentMethod

AddPaymentMethod - Add Customer Payment Method Add a payment method to the authenticated customer.

func (*RubaCustomers) ConfirmPaymentMethod

ConfirmPaymentMethod - Confirm Customer Payment Method Confirm a payment method for the authenticated customer.

func (*RubaCustomers) DeletePaymentMethod

DeletePaymentMethod - Delete Customer Payment Method Delete a payment method from the authenticated customer.

func (*RubaCustomers) Get

Get Customer Get authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaCustomers) ListPaymentMethods

ListPaymentMethods - List Customer Payment Methods Get saved payment methods of the authenticated customer.

func (*RubaCustomers) Update

Update Customer Update authenticated customer.

type RubaLicenseKeys

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

func (*RubaLicenseKeys) Activate

Activate License Key Activate a license key instance.

> This endpoint doesn't require authentication and can be safely used on a public > client, like a desktop application or a mobile app. > If you plan to validate a license key on a server, use the `/v1/license-keys/activate` > endpoint instead.

func (*RubaLicenseKeys) Deactivate

Deactivate License Key Deactivate a license key instance.

> This endpoint doesn't require authentication and can be safely used on a public > client, like a desktop application or a mobile app. > If you plan to validate a license key on a server, use the `/v1/license-keys/deactivate` > endpoint instead.

func (*RubaLicenseKeys) Get

Get License Key Get a license key.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaLicenseKeys) List

List License Keys **Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaLicenseKeys) Validate

Validate License Key Validate a license key.

> This endpoint doesn't require authentication and can be safely used on a public > client, like a desktop application or a mobile app. > If you plan to validate a license key on a server, use the `/v1/license-keys/validate` > endpoint instead.

type RubaMembers

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

func (*RubaMembers) AddMember

AddMember - Add Member Add a new member to the customer's team.

Only available to owners and billing managers of team customers.

Rules: - Cannot add a member with the owner role (there must be exactly one owner) - If a member with this email already exists, the existing member is returned

func (*RubaMembers) ListMembers

ListMembers - List Members List all members of the customer's team.

Only available to owners and billing managers of team customers.

func (*RubaMembers) RemoveMember

RemoveMember - Remove Member Remove a member from the team.

Only available to owners and billing managers of team customers.

Rules: - Cannot remove yourself - Cannot remove the only owner

func (*RubaMembers) UpdateMember

UpdateMember - Update Member Update a member's role.

Only available to owners and billing managers of team customers.

Rules: - Cannot modify your own role (to prevent self-demotion) - Customer must have exactly one owner at all times

type RubaOrders

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

func (*RubaOrders) ConfirmRetryPayment

ConfirmRetryPayment - Confirm Retry Payment Confirm a retry payment using a Stripe confirmation token.

func (*RubaOrders) GenerateInvoice

GenerateInvoice - Generate Order Invoice Trigger generation of an order's invoice.

func (*RubaOrders) Get

Get Order Get an order by ID for the authenticated customer.

func (*RubaOrders) GetPaymentStatus

GetPaymentStatus - Get Order Payment Status Get the current payment status for an order.

func (*RubaOrders) Invoice

Invoice - Get Order Invoice Get an order's invoice data.

func (*RubaOrders) List

List Orders List orders of the authenticated customer.

func (*RubaOrders) Update

Update Order Update an order for the authenticated customer.

type RubaOrganizations

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

func (*RubaOrganizations) Get

Get Organization Get a customer portal's organization by slug.

type RubaSubscriptions

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

func (*RubaSubscriptions) Cancel

Cancel Subscription Cancel a subscription of the authenticated customer.

func (*RubaSubscriptions) Get

Get Subscription Get a subscription for the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaSubscriptions) List

List Subscriptions List subscriptions of the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*RubaSubscriptions) Update

Update Subscription Update a subscription of the authenticated customer.

type SDKOption

type SDKOption func(*Ruba)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(accessToken string) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServer

func WithServer(server string) SDKOption

WithServer allows the overriding of the default server by name

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows providing an alternative server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type Seats

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

func (*Seats) AssignSeat

AssignSeat - Assign Seat

func (*Seats) ListClaimedSubscriptions

ListClaimedSubscriptions - List Claimed Subscriptions List all subscriptions where the authenticated customer has claimed a seat.

**Scopes**: `customer_portal:read` `customer_portal:write`

func (*Seats) ListSeats

ListSeats - List Seats **Scopes**: `customer_portal:read` `customer_portal:write`

func (*Seats) ResendInvitation

ResendInvitation - Resend Invitation

func (*Seats) RevokeSeat

RevokeSeat - Revoke Seat

type Subscriptions

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

func (*Subscriptions) Create

Create Subscription Create a subscription programmatically.

This endpoint only allows to create subscription on free products. For paid products, use the checkout flow.

No initial order will be created and no confirmation email will be sent.

**Scopes**: `subscriptions:write`

func (*Subscriptions) Export

Export Subscriptions Export subscriptions as a CSV file.

**Scopes**: `subscriptions:read` `subscriptions:write`

func (*Subscriptions) Get

Get Subscription Get a subscription by ID.

**Scopes**: `subscriptions:read` `subscriptions:write`

func (*Subscriptions) List

List Subscriptions List subscriptions.

**Scopes**: `subscriptions:read` `subscriptions:write`

func (*Subscriptions) Revoke

Revoke Subscription Revoke a subscription, i.e cancel immediately.

**Scopes**: `subscriptions:write`

func (*Subscriptions) Update

Update Subscription Update a subscription.

**Scopes**: `subscriptions:write`

type Wallets

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

func (*Wallets) Get

Get Wallet Get a wallet by ID for the authenticated customer.

func (*Wallets) List

List Wallets List wallets of the authenticated customer.

type Webhooks

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

func (*Webhooks) CreateWebhookEndpoint

CreateWebhookEndpoint - Create Webhook Endpoint Create a webhook endpoint.

**Scopes**: `webhooks:write`

func (*Webhooks) DeleteWebhookEndpoint

func (s *Webhooks) DeleteWebhookEndpoint(ctx context.Context, id string, opts ...operations.Option) (*operations.WebhooksDeleteWebhookEndpointResponse, error)

DeleteWebhookEndpoint - Delete Webhook Endpoint Delete a webhook endpoint.

**Scopes**: `webhooks:write`

func (*Webhooks) GetWebhookEndpoint

GetWebhookEndpoint - Get Webhook Endpoint Get a webhook endpoint by ID.

**Scopes**: `webhooks:read` `webhooks:write`

func (*Webhooks) ListWebhookDeliveries

ListWebhookDeliveries - List Webhook Deliveries List webhook deliveries.

Deliveries are all the attempts to deliver a webhook event to an endpoint.

**Scopes**: `webhooks:read` `webhooks:write`

func (*Webhooks) ListWebhookEndpoints

func (s *Webhooks) ListWebhookEndpoints(ctx context.Context, organizationID *operations.QueryParamOrganizationID, page *int64, limit *int64, opts ...operations.Option) (*operations.WebhooksListWebhookEndpointsResponse, error)

ListWebhookEndpoints - List Webhook Endpoints List webhook endpoints.

**Scopes**: `webhooks:read` `webhooks:write`

func (*Webhooks) RedeliverWebhookEvent

func (s *Webhooks) RedeliverWebhookEvent(ctx context.Context, id string, opts ...operations.Option) (*operations.WebhooksRedeliverWebhookEventResponse, error)

RedeliverWebhookEvent - Redeliver Webhook Event Schedule the re-delivery of a webhook event.

**Scopes**: `webhooks:write`

func (*Webhooks) ResetWebhookEndpointSecret

func (s *Webhooks) ResetWebhookEndpointSecret(ctx context.Context, id string, opts ...operations.Option) (*operations.WebhooksResetWebhookEndpointSecretResponse, error)

ResetWebhookEndpointSecret - Reset Webhook Endpoint Secret Regenerate a webhook endpoint secret.

**Scopes**: `webhooks:write`

func (*Webhooks) UpdateWebhookEndpoint

func (s *Webhooks) UpdateWebhookEndpoint(ctx context.Context, id string, webhookEndpointUpdate components.WebhookEndpointUpdate, opts ...operations.Option) (*operations.WebhooksUpdateWebhookEndpointResponse, error)

UpdateWebhookEndpoint - Update Webhook Endpoint Update a webhook endpoint.

**Scopes**: `webhooks:write`

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

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