Documentation
¶
Index ¶
- Constants
- type API
- func (a *API) Create(ctx context.Context, subscription FixedSubscriptionRequest) (int, error)
- func (a *API) Delete(ctx context.Context, id int) error
- func (a *API) Get(ctx context.Context, id int) (*FixedSubscriptionResponse, error)
- func (a *API) List(ctx context.Context) ([]*FixedSubscriptionResponse, error)
- func (a *API) Update(ctx context.Context, id int, subscription FixedSubscriptionRequest) error
- type FixedSubscriptionRequest
- type FixedSubscriptionResponse
- type HttpClient
- type Log
- type NotFound
- type TaskWaiter
Constants ¶
View Source
const ( // FixedSubscriptionStatusActive is the active value of the `Status` field in `Subscription` FixedSubscriptionStatusActive = "active" // FixedSubscriptionStatusPending is the pending value of the `Status` field in `Subscription` FixedSubscriptionStatusPending = "pending" // FixedSubscriptionStatusError is the error value of the `Status` field in `Subscription` FixedSubscriptionStatusError = "error" // FixedSubscriptionStatusDeleting is the deleting value of the `Status` field in `Subscription` FixedSubscriptionStatusDeleting = "deleting" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API
func (*API) Delete ¶
Delete will destroy an existing subscription. All existing databases within the subscription should already be deleted, otherwise this function will fail.
type FixedSubscriptionRequest ¶ added in v0.27.0
type FixedSubscriptionRequest struct { Name *string `json:"name,omitempty"` PlanId *int `json:"planId,omitempty"` PaymentMethod *string `json:"paymentMethod,omitempty"` PaymentMethodID *int `json:"paymentMethodId,omitempty"` }
Represents request information to create/update a fixed subscription
func (FixedSubscriptionRequest) String ¶ added in v0.27.0
func (o FixedSubscriptionRequest) String() string
type FixedSubscriptionResponse ¶ added in v0.27.0
type FixedSubscriptionResponse struct { ID *int `json:"id,omitempty"` Name *string `json:"name,omitempty"` Status *string `json:"status,omitempty"` PlanId *int `json:"planId,omitempty"` PaymentMethod *string `json:"paymentMethodType,omitempty"` PaymentMethodID *int `json:"paymentMethodId,omitempty"` CreationDate *time.Time `json:"creationDate,omitempty"` }
Represents subscription info response from the get/list endpoints
func (FixedSubscriptionResponse) String ¶ added in v0.27.0
func (o FixedSubscriptionResponse) String() string
type HttpClient ¶
type HttpClient interface { Get(ctx context.Context, name, path string, responseBody interface{}) error Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error Delete(ctx context.Context, name, path string, responseBody interface{}) error }
Click to show internal directories.
Click to hide internal directories.