subscription

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockSubscriptionOperationsConsumer

type MockSubscriptionOperationsConsumer struct {
	mock.Mock
}

func (*MockSubscriptionOperationsConsumer) CreateSubscriptionAsync

func (*MockSubscriptionOperationsConsumer) CreateSubscriptionAsyncExecute

func (*MockSubscriptionOperationsConsumer) DeleteSubscriptionAsync

func (*MockSubscriptionOperationsConsumer) DeleteSubscriptionAsyncExecute

func (*MockSubscriptionOperationsConsumer) DeleteSubscriptionLabels

func (*MockSubscriptionOperationsConsumer) GetEntitledApplication

func (*MockSubscriptionOperationsConsumer) GetEntitledApplications

func (*MockSubscriptionOperationsConsumer) GetSubscriptionLabels

func (*MockSubscriptionOperationsConsumer) UpdateSubscriptionParametersAsync

func (*MockSubscriptionOperationsConsumer) UpdateSubscriptionParametersAsyncExecute

func (*MockSubscriptionOperationsConsumer) UpsertSubscriptionLabels

type SubscriptionApiHandler

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

func NewSubscriptionApiHandler

func NewSubscriptionApiHandler(ctx context.Context, clientId string, clientSecret string, tokenUrl string, serviceUrl string) *SubscriptionApiHandler

NewSubscriptionApiHandler Creates instance of ApiHandler implementation

func (*SubscriptionApiHandler) CreateSubscription

func (s *SubscriptionApiHandler) CreateSubscription(ctx context.Context, subPost SubscriptionPost) (string, error)

func (*SubscriptionApiHandler) DeleteSubscription

func (s *SubscriptionApiHandler) DeleteSubscription(ctx context.Context, externalName string) error

func (*SubscriptionApiHandler) GetSubscription

func (s *SubscriptionApiHandler) GetSubscription(ctx context.Context, externalName string) (*SubscriptionGet, error)

func (*SubscriptionApiHandler) UpdateSubscription

func (s *SubscriptionApiHandler) UpdateSubscription(ctx context.Context, externalName string, subPut SubscriptionPut) error

type SubscriptionApiHandlerI

type SubscriptionApiHandlerI interface {
	CreateSubscription(ctx context.Context, payload SubscriptionPost) (string, error)
	UpdateSubscription(ctx context.Context, externalName string, payload SubscriptionPut) error
	DeleteSubscription(ctx context.Context, externalName string) error
	GetSubscription(ctx context.Context, externalName string) (*SubscriptionGet, error)
}

SubscriptionApiHandlerI interface that abstracts all API client operations that have to be exposed towards controller represents basic Rest CRUD operations

type SubscriptionGet

SubscriptionGet generic Get type that could be autogenerated, can be alias of existing client implementations value object

type SubscriptionPost

type SubscriptionPost struct {
	saas_client.CreateSubscriptionRequestPayload
	// contains filtered or unexported fields
}

SubscriptionPost generic Post type that could be autogenerated, here encapsulate existing api client type along with additional appName that is required for POST operation

type SubscriptionPut

type SubscriptionPut struct {
	saas_client.UpdateSubscriptionRequestPayload
	// contains filtered or unexported fields
}

SubscriptionPut generic Post type that could be autogenerated, here encapsulate existing api client type along with additional appName that is required for PUT operation

type SubscriptionTypeMapper

type SubscriptionTypeMapper struct {
}

func NewSubscriptionTypeMapper

func NewSubscriptionTypeMapper() *SubscriptionTypeMapper

func (*SubscriptionTypeMapper) ConvertToCreatePayload

func (s *SubscriptionTypeMapper) ConvertToCreatePayload(cr *v1alpha1.Subscription) SubscriptionPost

func (*SubscriptionTypeMapper) ConvertToUpdatePayload

func (s *SubscriptionTypeMapper) ConvertToUpdatePayload(cr *v1alpha1.Subscription) SubscriptionPut

func (*SubscriptionTypeMapper) IsAvailable

func (s *SubscriptionTypeMapper) IsAvailable(cr *v1alpha1.Subscription) bool

func (*SubscriptionTypeMapper) IsUpToDate

func (*SubscriptionTypeMapper) SyncStatus

type SubscriptionTypeMapperI

type SubscriptionTypeMapperI interface {
	// ConvertToCreatePayload maps a given CR to a API Post object (mostly payload, but might include addtional metadata)
	ConvertToCreatePayload(cr *v1alpha1.Subscription) SubscriptionPost
	// ConvertToUpdatePayload maps a given CR to a API Put object (mostly payload, but might include addtional metadata)
	ConvertToUpdatePayload(cr *v1alpha1.Subscription) SubscriptionPut
	// IsUpToDate compares a given CR with the external API representation, returns whether updates towards the API are required or not
	IsUpToDate(cr *v1alpha1.Subscription, get *SubscriptionGet) bool
	// IsAvailable allow additional check for whether a CR is fully available or not, maps to ready condition in controller, might be used for checking an observed API state field
	IsAvailable(cr *v1alpha1.Subscription) bool
	// SyncStatus allows to pull some data from external API resource towards the CR status
	SyncStatus(get *SubscriptionGet, crStatus *v1alpha1.SubscriptionObservation)
}

SubscriptionTypeMapperI interface to encapsulate all domain logic for making the controller work with otherwise unknown API and its types

Jump to

Keyboard shortcuts

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