customer

package
v1.0.0-beta.189 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncludeDeleted    = false
	DefaultPageNumber = 1
	DefaultPageSize   = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	CustomerAdapter

	entutils.TxCreator
}

type CreateCustomerInput

type CreateCustomerInput struct {
	Namespace string
	CustomerMutate
}

CreateCustomerInput represents the input for the CreateCustomer method

func (CreateCustomerInput) Validate

func (i CreateCustomerInput) Validate() error

type Customer

type Customer struct {
	models.ManagedResource

	Key              *string                  `json:"key,omitempty"`
	UsageAttribution CustomerUsageAttribution `json:"usageAttribution"`
	PrimaryEmail     *string                  `json:"primaryEmail,omitempty"`
	Currency         *currencyx.Code          `json:"currency,omitempty"`
	BillingAddress   *models.Address          `json:"billingAddress,omitempty"`

	CurrentSubscriptionID *string `json:"currentSubscriptionId,omitempty"`
}

Customer represents a customer

func (Customer) GetID

func (c Customer) GetID() CustomerID

func (Customer) Validate

func (c Customer) Validate() error

type CustomerAdapter

type CustomerAdapter interface {
	ListCustomers(ctx context.Context, params ListCustomersInput) (pagination.PagedResponse[Customer], error)
	CreateCustomer(ctx context.Context, params CreateCustomerInput) (*Customer, error)
	DeleteCustomer(ctx context.Context, customer DeleteCustomerInput) error
	GetCustomer(ctx context.Context, customer GetCustomerInput) (*Customer, error)
	UpdateCustomer(ctx context.Context, params UpdateCustomerInput) (*Customer, error)
}

type CustomerID

type CustomerID models.NamespacedID

func (CustomerID) Validate

func (i CustomerID) Validate() error

type CustomerMutate

type CustomerMutate struct {
	Key              *string                  `json:"key,omitempty"`
	Name             string                   `json:"name"`
	Description      *string                  `json:"description,omitempty"`
	UsageAttribution CustomerUsageAttribution `json:"usageAttribution"`
	PrimaryEmail     *string                  `json:"primaryEmail"`
	Currency         *currencyx.Code          `json:"currency"`
	BillingAddress   *models.Address          `json:"billingAddress"`
}

func (CustomerMutate) Validate

func (c CustomerMutate) Validate() error

type CustomerService

type CustomerService interface {
	ListCustomers(ctx context.Context, params ListCustomersInput) (pagination.PagedResponse[Customer], error)
	CreateCustomer(ctx context.Context, params CreateCustomerInput) (*Customer, error)
	DeleteCustomer(ctx context.Context, customer DeleteCustomerInput) error
	GetCustomer(ctx context.Context, customer GetCustomerInput) (*Customer, error)
	UpdateCustomer(ctx context.Context, params UpdateCustomerInput) (*Customer, error)
	GetEntitlementValue(ctx context.Context, input GetEntitlementValueInput) (entitlement.EntitlementValue, error)
}

type CustomerUsageAttribution

type CustomerUsageAttribution struct {
	SubjectKeys []string `json:"subjectKeys"`
}

CustomerUsageAttribution represents the usage attribution for a customer

func (CustomerUsageAttribution) GetSubjectKey

func (c CustomerUsageAttribution) GetSubjectKey() (string, error)

UsageAttribution

type DeleteCustomerInput

type DeleteCustomerInput CustomerID

DeleteCustomerInput represents the input for the DeleteCustomer method

func (DeleteCustomerInput) Validate

func (i DeleteCustomerInput) Validate() error

type ForbiddenError

type ForbiddenError genericError

func (ForbiddenError) Error

func (e ForbiddenError) Error() string

func (ForbiddenError) Unwrap

func (e ForbiddenError) Unwrap() error

type GetCustomerInput

type GetCustomerInput CustomerID

GetCustomerInput represents the input for the GetCustomer method

func (GetCustomerInput) Validate

func (i GetCustomerInput) Validate() error

type GetEntitlementValueInput

type GetEntitlementValueInput struct {
	ID         models.NamespacedID
	FeatureKey string
}

func (GetEntitlementValueInput) Validate

func (i GetEntitlementValueInput) Validate() error

type KeyConflictError

type KeyConflictError struct {
	Namespace string `json:"namespace"`
	Key       string `json:"key"`
}

KeyConflictError represents an error when a subject key is already associated with a customer

func (KeyConflictError) Error

func (e KeyConflictError) Error() string

type ListCustomersInput

type ListCustomersInput struct {
	Namespace string
	pagination.Page

	IncludeDeleted bool

	// Order
	OrderBy api.CustomerOrderBy
	Order   sortx.Order

	// Filters
	Key          *string
	Name         *string
	PrimaryEmail *string
	Subject      *string
	PlanKey      *string
}

ListCustomersInput represents the input for the ListCustomers method

type NotFoundError

type NotFoundError struct {
	CustomerID
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Service

type Service interface {
	CustomerService
}

type SubjectKeyConflictError

type SubjectKeyConflictError struct {
	Namespace   string   `json:"namespace"`
	SubjectKeys []string `json:"subjectKeys"`
}

SubjectKeyConflictError represents an error when a subject key is already associated with a customer

func (SubjectKeyConflictError) Error

func (e SubjectKeyConflictError) Error() string

type UpdateAfterDeleteError

type UpdateAfterDeleteError genericError

func (UpdateAfterDeleteError) Error

func (e UpdateAfterDeleteError) Error() string

func (UpdateAfterDeleteError) Unwrap

func (e UpdateAfterDeleteError) Unwrap() error

type UpdateCustomerInput

type UpdateCustomerInput struct {
	CustomerID CustomerID
	CustomerMutate
}

UpdateCustomerInput represents the input for the UpdateCustomer method

func (UpdateCustomerInput) Validate

func (i UpdateCustomerInput) Validate() error

type ValidationError

type ValidationError genericError

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) Unwrap

func (e ValidationError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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