Documentation ¶
Index ¶
- func AvailableSourceDataTypes() []models.SourceDataType
- type APIResourceSummary
- type AvailableServiceSummary
- type Client
- func (c *Client) DetailsForAPIVersion(ctx context.Context, apiVersion ServiceAPIVersionSummary) (*DetailsForAPIVersionResponse, error)
- func (c *Client) GetAvailableServices(ctx context.Context) (*GetAvailableServicesResponse, error)
- func (c *Client) GetCommonTypes(ctx context.Context) (*GetCommonTypesResponse, error)
- func (c *Client) GetDetailsForServiceResponse(ctx context.Context, service AvailableServiceSummary) (*GetDetailsForServiceResponse, error)
- func (c *Client) GetSDKOperationsForAPIResource(ctx context.Context, apiResource APIResourceSummary) (*GetSDKOperationsForAPIResourceResponse, error)
- func (c *Client) GetSDKSchemaForAPIResource(ctx context.Context, apiResource APIResourceSummary) (*GetSDKSchemaForAPIResourceResponse, error)
- func (c *Client) GetTerraformDetailsForService(ctx context.Context, service ServiceDetailsResponse) (*GetTerraformDetailsForServiceResponse, error)
- func (c *Client) Health(ctx context.Context) (*HealthResponse, error)
- func (c *Client) LoadAllData(ctx context.Context, serviceNamesToLimitTo []string) (*LoadAllDataResult, error)
- func (c *Client) SetLogger(logger hclog.Logger)
- type DetailsForAPIVersionResponse
- type DetailsForAPIVersionSummary
- type GetAvailableServices
- type GetAvailableServicesResponse
- type GetCommonTypesResponse
- type GetDetailsForServiceResponse
- type GetSDKOperationsForAPIResource
- type GetSDKOperationsForAPIResourceResponse
- type GetSDKSchemaForAPIResource
- type GetSDKSchemaForAPIResourceResponse
- type GetTerraformDetailsForServiceResponse
- type HealthResponse
- type LoadAllDataResult
- type ServiceAPIVersionSummary
- type ServiceDetailsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableSourceDataTypes ¶
func AvailableSourceDataTypes() []models.SourceDataType
AvailableSourceDataTypes returns a list of the supported Source Data Types. This can be used to allow tooling to automatically support new Source Data Types as these are defined here, for example by using this information in CLIs.
Types ¶
type APIResourceSummary ¶
type APIResourceSummary struct { // OperationsURI specifies the endpoint where information about the Operations for // this API Resource can be loaded from. OperationsURI string `json:"operationsUri"` // SchemaURI specifies the endpoint where information about the Schema for the // SDK Constants, Models and Resource IDs for this API Resource can be loaded from. SchemaURI string `json:"schemaUri"` }
type AvailableServiceSummary ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(endpoint string, sourceDataType models.SourceDataType) *Client
NewClient returns an instance of Client configured for the current endpoint and sourceDataType combination - used to retrieve information from the Data API.
func (*Client) DetailsForAPIVersion ¶
func (c *Client) DetailsForAPIVersion(ctx context.Context, apiVersion ServiceAPIVersionSummary) (*DetailsForAPIVersionResponse, error)
DetailsForAPIVersion retrieves information about the specified API Version, including the list of API Resources available within it.
func (*Client) GetAvailableServices ¶
func (c *Client) GetAvailableServices(ctx context.Context) (*GetAvailableServicesResponse, error)
GetAvailableServices returns the list of available Services within this Source Data Type.
func (*Client) GetCommonTypes ¶
func (c *Client) GetCommonTypes(ctx context.Context) (*GetCommonTypesResponse, error)
GetCommonTypes returns the Common SDK Types for this Source Data Type.
func (*Client) GetDetailsForServiceResponse ¶
func (c *Client) GetDetailsForServiceResponse(ctx context.Context, service AvailableServiceSummary) (*GetDetailsForServiceResponse, error)
GetDetailsForServiceResponse returns information about the specified Service, including the list of available API Versions.
func (*Client) GetSDKOperationsForAPIResource ¶
func (c *Client) GetSDKOperationsForAPIResource(ctx context.Context, apiResource APIResourceSummary) (*GetSDKOperationsForAPIResourceResponse, error)
GetSDKOperationsForAPIResource returns the SDK Operations for the specified API Resource (within a given API Version/Service).
func (*Client) GetSDKSchemaForAPIResource ¶
func (c *Client) GetSDKSchemaForAPIResource(ctx context.Context, apiResource APIResourceSummary) (*GetSDKSchemaForAPIResourceResponse, error)
GetSDKSchemaForAPIResource returns the SDK Schema for the specified API Resource (within a given API Version/Service).
func (*Client) GetTerraformDetailsForService ¶
func (c *Client) GetTerraformDetailsForService(ctx context.Context, service ServiceDetailsResponse) (*GetTerraformDetailsForServiceResponse, error)
GetTerraformDetailsForService retrieves the Terraform Details for the specified Service.
func (*Client) Health ¶
func (c *Client) Health(ctx context.Context) (*HealthResponse, error)
Health checks the current status of the Data API, returning whether it's ready to accept requests or not.
func (*Client) LoadAllData ¶
func (c *Client) LoadAllData(ctx context.Context, serviceNamesToLimitTo []string) (*LoadAllDataResult, error)
LoadAllData is a helper function which returns all information for a given SourceDataType from the Data API. This allows implementations to rely on the entire set of source data being available, and means they don't need to reimplement this logic. This function assumes that the Data API is online and available, which can be checked via the Health function.
serviceNamesToLimitTo is an optional value allowing limiting the returned result to a subset of the available services, primarily intended for debugging purposes.
type DetailsForAPIVersionResponse ¶
type DetailsForAPIVersionResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model describes details about the specified API Version, including the API Resources available within it. Model *DetailsForAPIVersionSummary }
type DetailsForAPIVersionSummary ¶
type DetailsForAPIVersionSummary struct { // Resources is a map of API Resource names (key) to APIResourceSummary (value). // This can be used to retrieve information about the API Resource in question. Resources map[string]APIResourceSummary `json:"resources"` // Source specifies the origin of the Source Data for this API version. Source models.SourceDataOrigin `json:"source"` }
type GetAvailableServices ¶
type GetAvailableServices struct { // Services is a map of Service Name to AvailableServiceSummary, which can be used to determine // the API Versions available for this Service. Services map[string]AvailableServiceSummary `json:"services"` }
type GetAvailableServicesResponse ¶
type GetAvailableServicesResponse struct { // HttpResponse is the raw HTTP Response HttpResponse *http.Response // Model contains a list of the Available Services within this Source Data Type. Model *GetAvailableServices }
type GetCommonTypesResponse ¶
type GetCommonTypesResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model is the Common SDK Types for this Source Data Type. Model *models.CommonTypes }
type GetDetailsForServiceResponse ¶
type GetDetailsForServiceResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model describes details about the specified Service, including the API Versions that are available. Model *ServiceDetailsResponse }
type GetSDKOperationsForAPIResource ¶
type GetSDKOperationsForAPIResource struct { // Operations describes a map of key (Operation Name) to value (SDKOperation) of the // SDK Operations available within this API Resource. Operations map[string]models.SDKOperation `json:"operations"` }
type GetSDKOperationsForAPIResourceResponse ¶
type GetSDKOperationsForAPIResourceResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model contains the SDKOperations for this APIResource. Model *GetSDKOperationsForAPIResource }
type GetSDKSchemaForAPIResource ¶
type GetSDKSchemaForAPIResource struct { // Constants describes a map of Constant Name (key) to SDKConstant (value) used within this APIResource. // The Constant Name is a valid Identifier. Constants map[string]models.SDKConstant `json:"constants"` // Models describes a map of Model Name (key) to SDKModel (value) used within this APIResource. // The Model Name is a valid Identifier. Models map[string]models.SDKModel `json:"models"` // ResourceIDs describes a map of Resource ID Name (key) to ResourceID (value) used within this APIResource. // The Resource ID Name is a valid Identifier. ResourceIDs map[string]models.ResourceID `json:"resourceIds"` }
type GetSDKSchemaForAPIResourceResponse ¶
type GetSDKSchemaForAPIResourceResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model contains the SDKConstants, SDKModels and ResourceIDs for this APIResource. Model *GetSDKSchemaForAPIResource }
type GetTerraformDetailsForServiceResponse ¶
type GetTerraformDetailsForServiceResponse struct { // HttpResponse is the raw HTTP Response. HttpResponse *http.Response // Model returns the Terraform Definition for this Service. Model *models.TerraformDefinition }
type HealthResponse ¶
type LoadAllDataResult ¶
type LoadAllDataResult struct { // CommonTypes specifies the Common Types which exist across the entire API, rather than being scoped to an // APIResource (within an APIVersion within a Service). // This allows for Common Types which are defined in _every_ package to be sourced from a single location, // reducing the size of each APIResource - particularly where circular references exist in the Types. CommonTypes models.CommonTypes // Services specifies a map of Service Name (key) to Service (value) representing the available Services for // this SourceDataType. // The Service Name is a valid Identifier. Services map[string]models.Service }
type ServiceAPIVersionSummary ¶
type ServiceAPIVersionSummary struct { // Generate specifies whether this API Version should be generated or not. Generate bool `json:"generate"` // Preview specifies whether this API Version is a Preview rather than a Stable version. Preview bool `json:"preview"` // URI specifies the URI where additional information about this API version can be loaded from. URI string `json:"uri"` }
type ServiceDetailsResponse ¶
type ServiceDetailsResponse struct { // ResourceProvider specifies the Azure Resource Provider associated with this Service. This is // only relevant for Source Data from Resource Manager. For other Source Data Types this is null. ResourceProvider *string `json:"resourceProvider,omitempty"` // TerraformPackageName specifies the name of the Service Package associated with this Service used // in the associated Terraform Provider. TerraformPackageName *string `json:"terraformPackageName,omitempty"` // TerraformURI specifies the URI where the Terraform-specific information can be loaded from. TerraformURI string `json:"terraformUri"` // Versions specifies a map of ApiVersion (key) to ServiceAPIVersionSummary, containing Versions map[string]ServiceAPIVersionSummary `json:"versions"` }