Documentation ¶
Index ¶
- func OutputSupportedServices(input RunInput) error
- func Run(input RunInput) error
- type DataType
- type Model
- type ModelField
- type Models
- type Operation
- type OperationType
- type Resource
- type ResourceId
- func (r ResourceId) FindResourceIdName() (*string, bool)
- func (r ResourceId) FindResourceName() (*string, bool)
- func (r ResourceId) FullyQualifiedResourceName(suffixQualification *string) (*string, bool)
- func (r ResourceId) HasUserValue() bool
- func (r ResourceId) ID() string
- func (r ResourceId) IsMatchOrAncestor(r2 ResourceId) (ResourceId, bool)
- func (r ResourceId) LastLabel() *ResourceIdSegment
- func (r ResourceId) LastLabelBeforeSegment(i int) *ResourceIdSegment
- func (r ResourceId) LastSegmentOfTypeBeforeSegment(types []ResourceIdSegmentType, i int) *ResourceIdSegment
- func (r ResourceId) TruncateToLastSegmentOfTypeBeforeSegment(types []ResourceIdSegmentType, i int) *ResourceId
- type ResourceIdMatch
- type ResourceIdSegment
- type ResourceIdSegmentType
- type ResourceIds
- type Resources
- type Response
- type Responses
- type RunInput
- type ServiceTags
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OutputSupportedServices ¶
Types ¶
type DataType ¶
type DataType uint8
const ( DataTypeUnknown DataType = iota DataTypeModel DataTypeArray DataTypeString DataTypeInteger64 DataTypeIntegerUnsigned64 DataTypeInteger32 DataTypeIntegerUnsigned32 DataTypeInteger16 DataTypeIntegerUnsigned16 DataTypeInteger8 DataTypeIntegerUnsigned8 DataTypeFloat32 DataTypeFloat64 DataTypeBool DataTypeBase64 DataTypeDate DataTypeDateTime DataTypeDuration DataTypeTime DataTypeUuid DataTypeBinary )
type ModelField ¶
type ModelField struct { Title string Type *DataType Description string Default interface{} Enum []string ItemType *DataType ConstantName *string ModelName *string JsonField string }
func (ModelField) CSType ¶
func (f ModelField) CSType(models Models) *string
CSType returns a string containing the C# type name for the ModelField, either describing it as a literal type, a specific model type, or a collection of either.
type Models ¶
type Operation ¶
type Operation struct { Name string Type OperationType Method string ResourceId *ResourceId UriSuffix *string RequestModel *string RequestType *DataType Responses Responses Tags []string }
type OperationType ¶
type OperationType uint8
const ( OperationTypeUnknown OperationType = iota OperationTypeList OperationTypeRead OperationTypeCreate OperationTypeCreateUpdate OperationTypeUpdate OperationTypeDelete )
func NewOperationType ¶
func NewOperationType(method string) OperationType
type ResourceId ¶
type ResourceId struct { Name string Service string Version string Segments []ResourceIdSegment }
func NewResourceId ¶
func NewResourceId(path string, tags []string) (id ResourceId)
func (ResourceId) FindResourceIdName ¶
func (r ResourceId) FindResourceIdName() (*string, bool)
FindResourceIdName returns a short name for the ResourceId. This currently has the same behavior as FindResourceName but may be changed in future if the ResourceId needs to be distinctly named.
func (ResourceId) FindResourceName ¶
func (r ResourceId) FindResourceName() (*string, bool)
FindResourceName returns a short resource name based on the last significant segments of the ResourceId. Singularization follows the same rules as FullyQualifiedResourceName. e.g. if r represents `/applications/{applicationId}/synchronization/jobs/{synchronizationJobId}/schema`, the (shortened) returned name will be `SynchronizationJob`.
func (ResourceId) FullyQualifiedResourceName ¶
func (r ResourceId) FullyQualifiedResourceName(suffixQualification *string) (*string, bool)
FullyQualifiedResourceName returns a human-readable name for the ResourceId, using all segments, each segment singularized except when the following segment is a plural function, or the first known verb is encountered. e.g. if r represents `/applications/{applicationId}/synchronization/jobs/{synchronizationJobId}/schema`, the returned name will be `ApplicationSynchronizationJob`
func (ResourceId) HasUserValue ¶
func (r ResourceId) HasUserValue() bool
func (ResourceId) ID ¶
func (r ResourceId) ID() string
func (ResourceId) IsMatchOrAncestor ¶
func (r ResourceId) IsMatchOrAncestor(r2 ResourceId) (ResourceId, bool)
IsMatchOrAncestor compares the provided ResourceId (r2) against the current ResourceId and returns true if the two resource IDs match, or if this ResourceId is an ancestor of the provided ResourceId.
func (ResourceId) LastLabel ¶
func (r ResourceId) LastLabel() *ResourceIdSegment
LastLabel returns the last label segment from the ResourceId
func (ResourceId) LastLabelBeforeSegment ¶
func (r ResourceId) LastLabelBeforeSegment(i int) *ResourceIdSegment
LastLabelBeforeSegment returns the last label segment from the ResourceId that precedes the provided segment index
func (ResourceId) LastSegmentOfTypeBeforeSegment ¶
func (r ResourceId) LastSegmentOfTypeBeforeSegment(types []ResourceIdSegmentType, i int) *ResourceIdSegment
LastSegmentOfTypeBeforeSegment returns the last segment of the specified type from the ResourceId that precedes the provided segment index
func (ResourceId) TruncateToLastSegmentOfTypeBeforeSegment ¶
func (r ResourceId) TruncateToLastSegmentOfTypeBeforeSegment(types []ResourceIdSegmentType, i int) *ResourceId
TruncateToLastSegmentOfTypeBeforeSegment returns a new ResourceId, truncating this ResourceId to the last segment of the specified type from the ResourceId that precedes the provided segment index
type ResourceIdMatch ¶
type ResourceIdMatch struct { Id *ResourceId Remainder *ResourceId }
type ResourceIdSegment ¶
type ResourceIdSegment struct { Type ResourceIdSegmentType Value string Field *string }
type ResourceIdSegmentType ¶
type ResourceIdSegmentType uint
const ( SegmentLabel ResourceIdSegmentType = iota SegmentUserValue SegmentODataReference SegmentAction SegmentCast SegmentFunction )
type ResourceIds ¶
type ResourceIds []*ResourceId
func (ResourceIds) MatchIdOrAncestor ¶
func (ri ResourceIds) MatchIdOrAncestor(resourceId ResourceId) (*ResourceIdMatch, bool)
MatchIdOrAncestor returns a ResourceIdMatch containing a matching/ancestor ResourceId and/or a remaininder value, or nil if no match/ancestor was found. A match is a ResourceId that represents the same path, and an ancestor is any ResourceId that represents a shorter matching path. Where multiple ancestors are found, the most granular (i.e. the longest) ancestor is returned.
Example 1: If resourceId represents `/users/{userId}` The returned ResourceIdMatch is likely to represent `/users/{userId}` (a match) with no remainder.
Example 2: If resourceId represents `/applications/{applicationId}/owners` The returned ResourceIdMatch is likely to represent `/applications/{applicationId}` with a remainder of `/owners`
type Resources ¶
func (Resources) ServiceHasValidResources ¶
ServiceHasValidResources returns true when resources are found for the provided serviceName that have usable operations defined (specifically any operations that do not require a response model, or that have a response model for any response)
type ServiceTags ¶
Source Files ¶
- git.go
- interface.go
- normalize.go
- parser_models.go
- parser_resourceids.go
- parser_resources.go
- parser_tags.go
- run_importer.go
- supported_services.go
- task.go
- task_parse_resourceids.go
- task_parse_resources.go
- task_remove_directory.go
- task_template_apiversiondefinition.go
- task_template_constants.go
- task_template_definitions.go
- task_template_models.go
- task_template_operations.go
- task_template_resourceids.go
- task_template_servicedefinition.go
- tree.go
- util.go