api

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Analytics    *analytics.Analytics
	Billing      *bClient.Billing
	Catalog      *cClient.Catalog
	Identity     *iClient.Identity
	Marketplace  *mClient.Marketplace
	Provisioning *pClient.Provisioning
	Connector    *conClient.Connector
	// contains filtered or unexported fields
}

API is a composition of all clients generated from the spec. Use the `New` function to load the necessary clients for the operation.

func New

func New(list ...Client) (*API, error)

New loads all clients passed on the list. If any of the clients fails to load an error is returned.

func (*API) Context

func (api *API) Context() context.Context

Context returns API underlining context.

func (*API) FetchPlan

func (api *API) FetchPlan(label string, productID string) (*models.Plan, error)

FetchPlan returns a plan from a product.

func (*API) FetchPlans

func (api *API) FetchPlans(productID string) ([]*models.Plan, error)

FetchPlans returns a list of all plans for a product.

func (*API) FetchProduct

func (api *API) FetchProduct(label string, providerID string) (*models.Product, error)

FetchProduct returns a product based on a label.

func (*API) FetchProducts

func (api *API) FetchProducts(providerID string) ([]*models.Product, error)

FetchProducts returns a list of all products for a provider.

func (*API) FetchProvider

func (api *API) FetchProvider(label string) (*models.Provider, error)

FetchProvider returns a provider based on a label.

func (*API) FetchProviders

func (api *API) FetchProviders() ([]*models.Provider, error)

FetchProviders returns a list of all available providers.

func (*API) FetchRegions

func (api *API) FetchRegions() ([]*models.Region, error)

FetchRegions returns a list of all available regions.

type Client

type Client int

Client represents one of the clients generated from the spec.

const (
	// Analytics represents the analytics client
	Analytics Client = iota

	// Billing represents the billing client
	Billing

	// Catalog represents the catalog client
	Catalog

	// Identity represents the identity client
	Identity

	// Marketplace represents the marketplace client
	Marketplace

	// Provisioning represents the provisioning client
	Provisioning

	// Connector represents the connector client
	Connector
)

func (Client) String

func (c Client) String() string

String returns a string representation of the client type.

Jump to

Keyboard shortcuts

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