model

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildModel

func BuildModel(openapi *openapi3.T) map[string]RestType

func FirstCharToLower

func FirstCharToLower(input string) string

func FirstCharToUpper

func FirstCharToUpper(input string) string

func NewRestClassType

func NewRestClassType(realSuperClass RestType, superClass RestType, name string, discriminator string) *restClassType

func RecurseCutOff

func RecurseCutOff(restType RestType) string

func StripLowercasePrefix

func StripLowercasePrefix(name string) string

Types

type RestProperty

type RestProperty struct {
	Parent     RestType
	Name       string
	Type       RestPropertyType
	Required   bool
	WriteOnly  bool
	Deprecated bool
	// contains filtered or unexported fields
}

func AdditionalObjectsProperties

func AdditionalObjectsProperties(restType RestType) []*RestProperty

func AllDirectProperties

func AllDirectProperties(restType RestType) []*RestProperty

func IdentifyingProperties added in v1.0.12

func IdentifyingProperties(restType RestType) []*RestProperty

func (*RestProperty) DS

func (p *RestProperty) DS() *RestProperty

func (*RestProperty) GoName

func (p *RestProperty) GoName() string

func (*RestProperty) IsDTypeRequired

func (p *RestProperty) IsDTypeRequired() bool

func (*RestProperty) IsNotComputed added in v1.0.12

func (p *RestProperty) IsNotComputed() bool

func (*RestProperty) IsRequired added in v1.0.12

func (p *RestProperty) IsRequired() bool

func (*RestProperty) TFAttrType

func (p *RestProperty) TFAttrType(inAdditionalObjects bool) string

func (*RestProperty) TFName

func (p *RestProperty) TFName() string

func (*RestProperty) TFToTKH

func (p *RestProperty) TFToTKH() string

func (*RestProperty) TFType

func (p *RestProperty) TFType() string

func (*RestProperty) TKHSetter

func (p *RestProperty) TKHSetter() string

func (*RestProperty) TKHToTF

func (p *RestProperty) TKHToTF() string

type RestPropertyType

type RestPropertyType interface {
	MarkReachable()
	PropertyNameSuffix() string
	FlattenMode() string
	OrderMode() string
	TFName() string
	TFValueType() string
	TFAttrType(inAdditionalObjects bool) string
	TFValidatorType() string
	TFValidators() []string
	ToTFAttrWithDiag() bool
	ToTKHAttrWithDiag() bool
	ToTKHCustomCode() string
	TFAttrNeeded() bool
	Complex() bool
	RequiresReplace() bool
	NestedType() RestType
	TKHToTF(value string, listItem bool) string
	TFToTKH(value string, listItem bool) string
	TKHToTFGuard() string
	TFToTKHGuard() string
	TKHGetter(propertyName string) string
	SDKTypeName(listItem bool) string
	SDKTypeConstructor() string
	DSSchemaTemplate() string
	DSSchemaTemplateData() map[string]any
	RSSchemaTemplate() string
	RSSchemaTemplateData() map[string]any
	DS() RestPropertyType
}

func NewAdditionalType

func NewAdditionalType(names []string) RestPropertyType

func NewEnumPropertyType

func NewEnumPropertyType(enumType RestType, rsSchemaTemplateBase map[string]any) RestPropertyType

func NewFindBaseByUUIDObjectType

func NewFindBaseByUUIDObjectType(baseType *restFindByUUIDClassType) RestPropertyType

func NewFindByUUIDObjectType

func NewFindByUUIDObjectType(nestedType RestPropertyType, rsSchemaTemplateBase map[string]any) RestPropertyType

func NewFindParentByUUIDObjectType

func NewFindParentByUUIDObjectType() RestPropertyType

func NewNestedObjectType

func NewNestedObjectType(property *RestProperty, nestedType RestType, rsSchemaTemplateBase map[string]any) RestPropertyType

func NewPolymorphicSubtype

func NewPolymorphicSubtype(property *RestProperty, superType RestType, nestedType RestType) RestPropertyType

func NewRestArrayType

func NewRestArrayType(itemType RestPropertyType, setCollection bool, rsSchemaTemplateBase map[string]any) RestPropertyType

func NewRestMapType

func NewRestMapType(name string, itemType RestPropertyType, rsSchemaTemplateBase map[string]any) RestPropertyType

func NewRestSimpleType

func NewRestSimpleType(property *RestProperty, schema *openapi3.Schema, rsSchemaTemplateBase map[string]any) RestPropertyType

type RestType

type RestType interface {
	Reachable() bool
	MarkReachable()
	Extends(typeName string) bool
	IsObject() bool
	ObjectAttrTypesName() string
	DataStructName() string
	APITypeName() string
	APIDiscriminator() string
	GoTypeName() string
	SDKTypeName() string
	SDKTypeConstructor() string
	AllProperties() []*RestProperty
	HasDirectUUIDProperty() bool
	Suffix() string
	DS() RestType
}

func NewRestEnumType

func NewRestEnumType(name string, values []any) RestType

func NewRestFindByUUIDClassType

func NewRestFindByUUIDClassType(superClass RestType, name string, nestedType *restClassType) RestType

func NewRestPolymorphicBaseClassType

func NewRestPolymorphicBaseClassType(nestedType RestType) RestType

func NewRestSubresourceClassType

func NewRestSubresourceClassType(name string, prefix string, nestedType RestType) RestType

Jump to

Keyboard shortcuts

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