Documentation
¶
Index ¶
- func AppendResourceData(newResources map[string]Resource)
- func ConvertUriTemplateValueToType(value string) string
- func GenerateResourceMetadataFromYaml() (map[string]Resource, error)
- func GenerateUrl(urlInfo *CrudEntityInfo, args []string, useAliases bool) (string, error)
- func GenerateUrlViaIdableAttributes(urlInfo *CrudEntityInfo, args []id.IdableAttributes) (string, error)
- func GetNumberOfVariablesNeeded(url string) (int, error)
- func GetPluralResourceNames() []string
- func GetPluralResources() map[string]Resource
- func GetSingularResourceNames() []string
- func GetSingularTypesOfVariablesNeeded(url string) ([]string, error)
- func GetTypesOfVariablesNeeded(url string) ([]string, error)
- func PublicInit()
- type CrudEntityAttribute
- type CrudEntityInfo
- type QueryParameter
- type Resource
- type VerbResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendResourceData ¶ added in v0.6.0
func ConvertUriTemplateValueToType ¶ added in v0.10.0
func GenerateResourceMetadataFromYaml ¶ added in v0.6.0
func GenerateUrl ¶ added in v0.1.0
func GenerateUrl(urlInfo *CrudEntityInfo, args []string, useAliases bool) (string, error)
func GenerateUrlViaIdableAttributes ¶ added in v0.7.0
func GenerateUrlViaIdableAttributes(urlInfo *CrudEntityInfo, args []id.IdableAttributes) (string, error)
func GetNumberOfVariablesNeeded ¶ added in v0.1.0
func GetPluralResourceNames ¶ added in v0.1.0
func GetPluralResourceNames() []string
func GetPluralResources ¶ added in v0.1.0
func GetSingularResourceNames ¶ added in v0.1.0
func GetSingularResourceNames() []string
func GetSingularTypesOfVariablesNeeded ¶ added in v0.10.0
func GetTypesOfVariablesNeeded ¶ added in v0.5.0
func PublicInit ¶ added in v0.11.0
func PublicInit()
Types ¶
type CrudEntityAttribute ¶
type CrudEntityAttribute struct {
// The name of the attribute
Key string `yaml:"-"`
// The type of the attribute
Type string `yaml:"type"`
Usage string `yaml:"usage"`
AutoFill string `yaml:"autofill,omitempty"`
AliasAttribute string `yaml:"alias_attribute,omitempty"`
// Expr for when the attribute is enabled
When string `yaml:"when,omitempty"`
}
type CrudEntityInfo ¶
type CrudEntityInfo struct {
// A link to the docs specific for the Crud operation in EPCC.
Docs string `yaml:"docs"`
// The Url we should use when invoking this method.
Url string `yaml:"url"`
// Content type to send
ContentType string `yaml:"content-type,omitempty"`
// A list of valid query parameters
QueryParameters []QueryParameter `yaml:"query,omitempty"`
// Minimum resources so we don't keep trying to delete in
MinResources int `yaml:"min,omitempty"`
// Override the attribute we use in the URL for a specific key
ParentResourceValueOverrides map[string]string `yaml:"parent_resource_value_overrides,omitempty"`
OpenApiOperationId string `yaml:"openapi-operation-id"`
// Only valid on create, if set we report that the type created by this is different.
Creates string `yaml:"creates"`
DefaultQueryParams map[string]string `yaml:"default-query-params,omitempty"`
}
type QueryParameter ¶ added in v0.14.0
type Resource ¶
type Resource struct {
// The type as far as the EPCC CLI is concerned.
Type string `yaml:"-"`
// A link to the generic documentation page about a type in the EPCC API
Docs string `yaml:"docs"`
// The type that should be used in the JSON API.
JsonApiType string `yaml:"json-api-type"`
// Alterative types used for aliases
AlternateJsonApiTypesForAliases []string `yaml:"alternate-json-type-for-aliases,omitempty"`
// Some resources (e.g., PCM, accelerator svc, bury most attributes under the attributes key). This is considered "compliant", other services just bury attributes under data, this is "legacy.
JsonApiFormat string `yaml:"json-api-format"`
// Information about how to get a collection
GetCollectionInfo *CrudEntityInfo `yaml:"get-collection,omitempty"`
// Information about how to get a single object.
GetEntityInfo *CrudEntityInfo `yaml:"get-entity,omitempty"`
// Information about how to create an entity.
CreateEntityInfo *CrudEntityInfo `yaml:"create-entity,omitempty"`
// Information about how to update an entity.
UpdateEntityInfo *CrudEntityInfo `yaml:"update-entity,omitempty"`
// Information about how to delete an entity.
DeleteEntityInfo *CrudEntityInfo `yaml:"delete-entity,omitempty"`
Attributes map[string]*CrudEntityAttribute `yaml:"attributes,omitempty"`
// If true, don't wrap json in a data tag
NoWrapping bool `yaml:"no-wrapping,omitempty"`
// The singular name version of the resource.
SingularName string `yaml:"singular-name"`
PluralName string `yaml:"-"`
// Use this value to silence warnings about a resource not supporting resets.
// This should only be used for cases where we manually fix things, or where
// a store reset would clear a resource another way (e.g., the resource represents a projection).
SuppressResetWarning bool `yaml:"suppress-reset-warning,omitempty"`
Legacy bool `yaml:"legacy"`
// If another resource is used to create this resource, list it here
CreatedBy []VerbResource `yaml:"created_by,omitempty"`
// Source Filename
SourceFile string
}
func GetResourceByName ¶ added in v0.1.0
func GetSingularResourceByName ¶ added in v0.9.3
func MustGetResourceByName ¶ added in v0.11.0
type VerbResource ¶ added in v0.14.0
Click to show internal directories.
Click to hide internal directories.