usage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for usage API

func New

func New(transport runtime.ClientTransport,
	formats strfmt.Registry,
	authInfo runtime.ClientAuthInfoWriter,
	defaults KillbillDefaults) *Client

New creates a new usage API client.

func (*Client) GetAllUsage

func (a *Client) GetAllUsage(ctx context.Context, params *GetAllUsageParams) (*GetAllUsageOK, error)

GetAllUsage retrieves usage for a subscription

func (*Client) GetUsage

func (a *Client) GetUsage(ctx context.Context, params *GetUsageParams) (*GetUsageOK, error)

GetUsage retrieves usage for a subscription and unit type

func (*Client) RecordUsage

func (a *Client) RecordUsage(ctx context.Context, params *RecordUsageParams) (*RecordUsageOK, error)

RecordUsage records usage for a subscription

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type GetAllUsageBadRequest

type GetAllUsageBadRequest struct {
	HttpResponse runtime.ClientResponse
}

GetAllUsageBadRequest handles this case with default header values.

Missing start date or end date

func NewGetAllUsageBadRequest

func NewGetAllUsageBadRequest() *GetAllUsageBadRequest

NewGetAllUsageBadRequest creates a GetAllUsageBadRequest with default headers values

func (*GetAllUsageBadRequest) Error

func (o *GetAllUsageBadRequest) Error() string

type GetAllUsageOK

type GetAllUsageOK struct {
	Payload *kbmodel.RolledUpUsage

	HttpResponse runtime.ClientResponse
}

GetAllUsageOK handles this case with default header values.

successful operation

func NewGetAllUsageOK

func NewGetAllUsageOK() *GetAllUsageOK

NewGetAllUsageOK creates a GetAllUsageOK with default headers values

func (*GetAllUsageOK) Error

func (o *GetAllUsageOK) Error() string

type GetAllUsageParams

type GetAllUsageParams struct {

	/*EndDate*/
	EndDate *strfmt.Date
	/*StartDate*/
	StartDate *strfmt.Date
	/*SubscriptionID*/
	SubscriptionID strfmt.UUID

	WithStackTrace *bool // If set, returns full stack trace with error message

	Context               context.Context
	HTTPClient            *http.Client
	ProcessLocationHeader bool // For create APIs that return 201, send another request and retrieve the resource.
	// contains filtered or unexported fields
}

GetAllUsageParams contains all the parameters to send to the API endpoint for the get all usage operation typically these are written to a http.Request

func NewGetAllUsageParams

func NewGetAllUsageParams() *GetAllUsageParams

NewGetAllUsageParams creates a new GetAllUsageParams object with the default values initialized.

func NewGetAllUsageParamsWithContext

func NewGetAllUsageParamsWithContext(ctx context.Context) *GetAllUsageParams

NewGetAllUsageParamsWithContext creates a new GetAllUsageParams object with the default values initialized, and the ability to set a context for a request

func NewGetAllUsageParamsWithHTTPClient

func NewGetAllUsageParamsWithHTTPClient(client *http.Client) *GetAllUsageParams

NewGetAllUsageParamsWithHTTPClient creates a new GetAllUsageParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewGetAllUsageParamsWithTimeout

func NewGetAllUsageParamsWithTimeout(timeout time.Duration) *GetAllUsageParams

NewGetAllUsageParamsWithTimeout creates a new GetAllUsageParams object with the default values initialized, and the ability to set a timeout on a request

func (*GetAllUsageParams) SetContext

func (o *GetAllUsageParams) SetContext(ctx context.Context)

SetContext adds the context to the get all usage params

func (*GetAllUsageParams) SetEndDate

func (o *GetAllUsageParams) SetEndDate(endDate *strfmt.Date)

SetEndDate adds the endDate to the get all usage params

func (*GetAllUsageParams) SetHTTPClient

func (o *GetAllUsageParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get all usage params

func (*GetAllUsageParams) SetStartDate

func (o *GetAllUsageParams) SetStartDate(startDate *strfmt.Date)

SetStartDate adds the startDate to the get all usage params

func (*GetAllUsageParams) SetSubscriptionID

func (o *GetAllUsageParams) SetSubscriptionID(subscriptionID strfmt.UUID)

SetSubscriptionID adds the subscriptionId to the get all usage params

func (*GetAllUsageParams) SetTimeout

func (o *GetAllUsageParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get all usage params

func (*GetAllUsageParams) WithContext

func (o *GetAllUsageParams) WithContext(ctx context.Context) *GetAllUsageParams

WithContext adds the context to the get all usage params

func (*GetAllUsageParams) WithEndDate

func (o *GetAllUsageParams) WithEndDate(endDate *strfmt.Date) *GetAllUsageParams

WithEndDate adds the endDate to the get all usage params

func (*GetAllUsageParams) WithHTTPClient

func (o *GetAllUsageParams) WithHTTPClient(client *http.Client) *GetAllUsageParams

WithHTTPClient adds the HTTPClient to the get all usage params

func (*GetAllUsageParams) WithStartDate

func (o *GetAllUsageParams) WithStartDate(startDate *strfmt.Date) *GetAllUsageParams

WithStartDate adds the startDate to the get all usage params

func (*GetAllUsageParams) WithSubscriptionID

func (o *GetAllUsageParams) WithSubscriptionID(subscriptionID strfmt.UUID) *GetAllUsageParams

WithSubscriptionID adds the subscriptionID to the get all usage params

func (*GetAllUsageParams) WithTimeout

func (o *GetAllUsageParams) WithTimeout(timeout time.Duration) *GetAllUsageParams

WithTimeout adds the timeout to the get all usage params

func (*GetAllUsageParams) WriteToRequest

func (o *GetAllUsageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetAllUsageReader

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

GetAllUsageReader is a Reader for the GetAllUsage structure.

func (*GetAllUsageReader) ReadResponse

func (o *GetAllUsageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type GetUsageBadRequest

type GetUsageBadRequest struct {
	HttpResponse runtime.ClientResponse
}

GetUsageBadRequest handles this case with default header values.

Missing start date or end date

func NewGetUsageBadRequest

func NewGetUsageBadRequest() *GetUsageBadRequest

NewGetUsageBadRequest creates a GetUsageBadRequest with default headers values

func (*GetUsageBadRequest) Error

func (o *GetUsageBadRequest) Error() string

type GetUsageOK

type GetUsageOK struct {
	Payload *kbmodel.RolledUpUsage

	HttpResponse runtime.ClientResponse
}

GetUsageOK handles this case with default header values.

successful operation

func NewGetUsageOK

func NewGetUsageOK() *GetUsageOK

NewGetUsageOK creates a GetUsageOK with default headers values

func (*GetUsageOK) Error

func (o *GetUsageOK) Error() string

type GetUsageParams

type GetUsageParams struct {

	/*EndDate*/
	EndDate *strfmt.Date
	/*StartDate*/
	StartDate *strfmt.Date
	/*SubscriptionID*/
	SubscriptionID strfmt.UUID
	/*UnitType*/
	UnitType string

	WithStackTrace *bool // If set, returns full stack trace with error message

	Context               context.Context
	HTTPClient            *http.Client
	ProcessLocationHeader bool // For create APIs that return 201, send another request and retrieve the resource.
	// contains filtered or unexported fields
}

GetUsageParams contains all the parameters to send to the API endpoint for the get usage operation typically these are written to a http.Request

func NewGetUsageParams

func NewGetUsageParams() *GetUsageParams

NewGetUsageParams creates a new GetUsageParams object with the default values initialized.

func NewGetUsageParamsWithContext

func NewGetUsageParamsWithContext(ctx context.Context) *GetUsageParams

NewGetUsageParamsWithContext creates a new GetUsageParams object with the default values initialized, and the ability to set a context for a request

func NewGetUsageParamsWithHTTPClient

func NewGetUsageParamsWithHTTPClient(client *http.Client) *GetUsageParams

NewGetUsageParamsWithHTTPClient creates a new GetUsageParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewGetUsageParamsWithTimeout

func NewGetUsageParamsWithTimeout(timeout time.Duration) *GetUsageParams

NewGetUsageParamsWithTimeout creates a new GetUsageParams object with the default values initialized, and the ability to set a timeout on a request

func (*GetUsageParams) SetContext

func (o *GetUsageParams) SetContext(ctx context.Context)

SetContext adds the context to the get usage params

func (*GetUsageParams) SetEndDate

func (o *GetUsageParams) SetEndDate(endDate *strfmt.Date)

SetEndDate adds the endDate to the get usage params

func (*GetUsageParams) SetHTTPClient

func (o *GetUsageParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get usage params

func (*GetUsageParams) SetStartDate

func (o *GetUsageParams) SetStartDate(startDate *strfmt.Date)

SetStartDate adds the startDate to the get usage params

func (*GetUsageParams) SetSubscriptionID

func (o *GetUsageParams) SetSubscriptionID(subscriptionID strfmt.UUID)

SetSubscriptionID adds the subscriptionId to the get usage params

func (*GetUsageParams) SetTimeout

func (o *GetUsageParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get usage params

func (*GetUsageParams) SetUnitType

func (o *GetUsageParams) SetUnitType(unitType string)

SetUnitType adds the unitType to the get usage params

func (*GetUsageParams) WithContext

func (o *GetUsageParams) WithContext(ctx context.Context) *GetUsageParams

WithContext adds the context to the get usage params

func (*GetUsageParams) WithEndDate

func (o *GetUsageParams) WithEndDate(endDate *strfmt.Date) *GetUsageParams

WithEndDate adds the endDate to the get usage params

func (*GetUsageParams) WithHTTPClient

func (o *GetUsageParams) WithHTTPClient(client *http.Client) *GetUsageParams

WithHTTPClient adds the HTTPClient to the get usage params

func (*GetUsageParams) WithStartDate

func (o *GetUsageParams) WithStartDate(startDate *strfmt.Date) *GetUsageParams

WithStartDate adds the startDate to the get usage params

func (*GetUsageParams) WithSubscriptionID

func (o *GetUsageParams) WithSubscriptionID(subscriptionID strfmt.UUID) *GetUsageParams

WithSubscriptionID adds the subscriptionID to the get usage params

func (*GetUsageParams) WithTimeout

func (o *GetUsageParams) WithTimeout(timeout time.Duration) *GetUsageParams

WithTimeout adds the timeout to the get usage params

func (*GetUsageParams) WithUnitType

func (o *GetUsageParams) WithUnitType(unitType string) *GetUsageParams

WithUnitType adds the unitType to the get usage params

func (*GetUsageParams) WriteToRequest

func (o *GetUsageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetUsageReader

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

GetUsageReader is a Reader for the GetUsage structure.

func (*GetUsageReader) ReadResponse

func (o *GetUsageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type IUsage

type IUsage interface {
	/*
		GetAllUsage retrieves usage for a subscription
	*/
	GetAllUsage(ctx context.Context, params *GetAllUsageParams) (*GetAllUsageOK, error)

	/*
		GetUsage retrieves usage for a subscription and unit type
	*/
	GetUsage(ctx context.Context, params *GetUsageParams) (*GetUsageOK, error)

	/*
		RecordUsage records usage for a subscription
	*/
	RecordUsage(ctx context.Context, params *RecordUsageParams) (*RecordUsageOK, error)
}

IUsage - interface for Usage client.

type KillbillDefaults

type KillbillDefaults interface {
	// Default CreatedBy. If not set explicitly in params, this will be used.
	XKillbillCreatedBy() *string
	// Default Comment. If not set explicitly in params, this will be used.
	XKillbillComment() *string
	// Default Reason. If not set explicitly in params, this will be used.
	XKillbillReason() *string
	// Default WithStackTrace. If not set explicitly in params, this will be used.
	KillbillWithStackTrace() *bool
}

killbill default values. When a call is made to an operation, these values are used if params doesn't specify them.

type RecordUsageBadRequest

type RecordUsageBadRequest struct {
	HttpResponse runtime.ClientResponse
}

RecordUsageBadRequest handles this case with default header values.

Invalid subscription (e.g. inactive)

func NewRecordUsageBadRequest

func NewRecordUsageBadRequest() *RecordUsageBadRequest

NewRecordUsageBadRequest creates a RecordUsageBadRequest with default headers values

func (*RecordUsageBadRequest) Error

func (o *RecordUsageBadRequest) Error() string

type RecordUsageOK

type RecordUsageOK struct {
	HttpResponse runtime.ClientResponse
}

RecordUsageOK handles this case with default header values.

Successfully recorded usage data change

func NewRecordUsageOK

func NewRecordUsageOK() *RecordUsageOK

NewRecordUsageOK creates a RecordUsageOK with default headers values

func (*RecordUsageOK) Error

func (o *RecordUsageOK) Error() string

type RecordUsageParams

type RecordUsageParams struct {

	/*XKillbillComment*/
	XKillbillComment *string
	/*XKillbillCreatedBy*/
	XKillbillCreatedBy string
	/*XKillbillReason*/
	XKillbillReason *string
	/*Body*/
	Body *kbmodel.SubscriptionUsageRecord

	WithStackTrace *bool // If set, returns full stack trace with error message

	Context               context.Context
	HTTPClient            *http.Client
	ProcessLocationHeader bool // For create APIs that return 201, send another request and retrieve the resource.
	// contains filtered or unexported fields
}

RecordUsageParams contains all the parameters to send to the API endpoint for the record usage operation typically these are written to a http.Request

func NewRecordUsageParams

func NewRecordUsageParams() *RecordUsageParams

NewRecordUsageParams creates a new RecordUsageParams object with the default values initialized.

func NewRecordUsageParamsWithContext

func NewRecordUsageParamsWithContext(ctx context.Context) *RecordUsageParams

NewRecordUsageParamsWithContext creates a new RecordUsageParams object with the default values initialized, and the ability to set a context for a request

func NewRecordUsageParamsWithHTTPClient

func NewRecordUsageParamsWithHTTPClient(client *http.Client) *RecordUsageParams

NewRecordUsageParamsWithHTTPClient creates a new RecordUsageParams object with the default values initialized, and the ability to set a custom HTTPClient for a request

func NewRecordUsageParamsWithTimeout

func NewRecordUsageParamsWithTimeout(timeout time.Duration) *RecordUsageParams

NewRecordUsageParamsWithTimeout creates a new RecordUsageParams object with the default values initialized, and the ability to set a timeout on a request

func (*RecordUsageParams) SetBody

SetBody adds the body to the record usage params

func (*RecordUsageParams) SetContext

func (o *RecordUsageParams) SetContext(ctx context.Context)

SetContext adds the context to the record usage params

func (*RecordUsageParams) SetHTTPClient

func (o *RecordUsageParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the record usage params

func (*RecordUsageParams) SetTimeout

func (o *RecordUsageParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the record usage params

func (*RecordUsageParams) SetXKillbillComment

func (o *RecordUsageParams) SetXKillbillComment(xKillbillComment *string)

SetXKillbillComment adds the xKillbillComment to the record usage params

func (*RecordUsageParams) SetXKillbillCreatedBy

func (o *RecordUsageParams) SetXKillbillCreatedBy(xKillbillCreatedBy string)

SetXKillbillCreatedBy adds the xKillbillCreatedBy to the record usage params

func (*RecordUsageParams) SetXKillbillReason

func (o *RecordUsageParams) SetXKillbillReason(xKillbillReason *string)

SetXKillbillReason adds the xKillbillReason to the record usage params

func (*RecordUsageParams) WithBody

WithBody adds the body to the record usage params

func (*RecordUsageParams) WithContext

func (o *RecordUsageParams) WithContext(ctx context.Context) *RecordUsageParams

WithContext adds the context to the record usage params

func (*RecordUsageParams) WithHTTPClient

func (o *RecordUsageParams) WithHTTPClient(client *http.Client) *RecordUsageParams

WithHTTPClient adds the HTTPClient to the record usage params

func (*RecordUsageParams) WithTimeout

func (o *RecordUsageParams) WithTimeout(timeout time.Duration) *RecordUsageParams

WithTimeout adds the timeout to the record usage params

func (*RecordUsageParams) WithXKillbillComment

func (o *RecordUsageParams) WithXKillbillComment(xKillbillComment *string) *RecordUsageParams

WithXKillbillComment adds the xKillbillComment to the record usage params

func (*RecordUsageParams) WithXKillbillCreatedBy

func (o *RecordUsageParams) WithXKillbillCreatedBy(xKillbillCreatedBy string) *RecordUsageParams

WithXKillbillCreatedBy adds the xKillbillCreatedBy to the record usage params

func (*RecordUsageParams) WithXKillbillReason

func (o *RecordUsageParams) WithXKillbillReason(xKillbillReason *string) *RecordUsageParams

WithXKillbillReason adds the xKillbillReason to the record usage params

func (*RecordUsageParams) WriteToRequest

func (o *RecordUsageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type RecordUsageReader

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

RecordUsageReader is a Reader for the RecordUsage structure.

func (*RecordUsageReader) ReadResponse

func (o *RecordUsageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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