api

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_POST   = "POST"
	HTTP_GET    = "GET"
	HTTP_DELETE = "DELETE"
	HTTP_PUT    = "PUT"
	HTTP_PATCH  = "PATCH"
)

Variables

View Source
var ApiRequest = Api{
	// contains filtered or unexported fields
}

ApiRequest is struct to call api

Functions

func NewApi

func NewApi(accessToken string, envDomain string)

NewApi returns api client

Types

type Api

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

Api has config data for calling api

type CardApiInterface added in v0.1.4

type CardApiInterface interface {
	CreateCard(models.CreateCardRequest) (*models.CreateCardResponse, error)
	ListCards(req models.ListCardsRequest) (*models.ListCardsResponse, error)
	RetrieveCard(cardID string) (*models.RetrieveCardResponse, error)
	DisableCard(cardID string) (*models.DisableCardResponse, error)
}

CardApiInterface defines the interface for the CustomerApi

type CardsApi added in v0.1.4

type CardsApi struct{}

CardsApi is a struct that implements CustomerApiInterface

func NewCardApi added in v0.1.4

func NewCardApi() *CardsApi

NewCardApi returns a new CustomerApi

func (*CardsApi) CreateCard added in v0.1.4

CreateCard create new card

func (*CardsApi) DisableCard added in v0.1.11

func (api *CardsApi) DisableCard(cardID string) (*models.DisableCardResponse, error)

func (*CardsApi) ListCards added in v0.1.11

func (*CardsApi) RetrieveCard added in v0.1.11

func (api *CardsApi) RetrieveCard(cardID string) (*models.RetrieveCardResponse, error)

type CatalogApi added in v0.1.4

type CatalogApi struct{}

CatalogApi is a struct that implements CatalogApiInterface

func NewCatalogApi added in v0.1.4

func NewCatalogApi() *CatalogApi

NewCatalogApi returns a new CatalogApi

func (*CatalogApi) ListCatalog added in v0.1.4

CreateCatalog returns list of catalog objects

func (*CatalogApi) RetrieveCatalogObject added in v0.1.13

func (api *CatalogApi) RetrieveCatalogObject(objectID string) (*models.CatalogResponse, error)

RetrieveCatalogObject

type CatalogApiInterface added in v0.1.4

type CatalogApiInterface interface {
	ListCatalog(models.ListCatalogRequest) (*models.ListCatalogResponse, error)
	RetrieveCatalogObject(objectID string) (*models.CatalogResponse, error)
}

CatalogApiInterface defines the interface for the CatalogApi

type CustomersApi added in v0.1.3

type CustomersApi struct{}

CustomerApi is a struct that implements CustomerApiInterface

func NewCustomerApi

func NewCustomerApi() *CustomersApi

NewCustomerApi returns a new CustomerApi

func (*CustomersApi) CreateCustomer added in v0.1.3

CreateCustomer create customer

func (*CustomersApi) DeleteCustomer added in v0.1.11

DeleteCustomer deletes a customer profile from a business.

func (*CustomersApi) RetrieveCustomer added in v0.1.11

func (api *CustomersApi) RetrieveCustomer(cID string) (*models.RetrieveCustomerResponse, error)

RetrieveCustomer returns details for a single customer.

type CustomersApiInterface added in v0.1.3

type CustomersApiInterface interface {
	CreateCustomer(models.CreateCustomerRequest) (*models.CreateCustomerResponse, error)
	DeleteCustomer(req models.DeleteCustomerRequest) (*models.DeleteCustomerResponse, error)
	RetrieveCustomer(cID string) (*models.RetrieveCustomerResponse, error)
}

CustomerApiInterface defines the interface for the CustomerApi

type SubscriptionApi added in v0.1.4

type SubscriptionApi struct{}

SubscriptionApi is a struct that implements SubscriptionApiInterface

func NewSubscriptionApi added in v0.1.4

func NewSubscriptionApi() *SubscriptionApi

NewSubscriptionApi returns a new SubscriptionApi

func (*SubscriptionApi) CancelSubscription added in v0.1.11

func (api *SubscriptionApi) CancelSubscription(subscriptionID string) (*models.CancelSubscriptionResponse, error)

CancelSubscription schedules a CANCEL action to cancel an active subscription by setting the canceled_date field to the end of the active billing period and changing the subscription status from ACTIVE to CANCELED after this date.

func (*SubscriptionApi) CreateSubscription added in v0.1.4

CreateSubscription create new subscription

func (*SubscriptionApi) UpdateSubscription added in v0.1.11

func (api *SubscriptionApi) UpdateSubscription(subscriptionID string, req models.UpdateSubscriptionRequest) (*models.UpdateSubscriptionResponse, error)

UpdateSubscription update a subscription

type SubscriptionApiInterface added in v0.1.4

type SubscriptionApiInterface interface {
	CreateSubscription(models.CreateSubscriptionRequest) (*models.CreateSubscriptionResponse, error)
	UpdateSubscription(string, models.UpdateSubscriptionRequest) (*models.UpdateSubscriptionResponse, error)
	CancelSubscription(string) (*models.CancelSubscriptionResponse, error)
}

SubscriptionApiInterface defines the interface for the SubscriptionApi

Jump to

Keyboard shortcuts

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