types

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyType added in v1.13.0

type AnyType struct {
	Type string `json:"$type"`
}

func (*AnyType) AsTypeBase added in v1.13.0

func (t *AnyType) AsTypeBase() *TypeBase

func (*AnyType) GetWriteOnly added in v1.13.0

func (t *AnyType) GetWriteOnly(i interface{}) interface{}

func (*AnyType) Validate added in v1.13.0

func (t *AnyType) Validate(body interface{}, path string) []error

type ArrayType

type ArrayType struct {
	Type      string         `json:"$type"`
	ItemType  *TypeReference `json:"itemType"`
	MinLength *int           `json:"minLength"`
	MaxLength *int           `json:"maxLength"`
}

func (*ArrayType) AsTypeBase

func (t *ArrayType) AsTypeBase() *TypeBase

func (*ArrayType) GetWriteOnly

func (t *ArrayType) GetWriteOnly(body interface{}) interface{}

func (*ArrayType) Validate

func (t *ArrayType) Validate(body interface{}, path string) []error

type BooleanType added in v1.13.0

type BooleanType struct {
	Type string `json:"$type"`
}

func (*BooleanType) AsTypeBase added in v1.13.0

func (t *BooleanType) AsTypeBase() *TypeBase

func (*BooleanType) GetWriteOnly added in v1.13.0

func (t *BooleanType) GetWriteOnly(i interface{}) interface{}

func (*BooleanType) Validate added in v1.13.0

func (t *BooleanType) Validate(body interface{}, path string) []error

type DiscriminatedObjectType

type DiscriminatedObjectType struct {
	Type           string                    `json:"$type"`
	Name           string                    `json:"name"`
	Discriminator  string                    `json:"discriminator"`
	BaseProperties map[string]ObjectProperty `json:"baseProperties"`
	Elements       map[string]*TypeReference `json:"elements"`
}

func (*DiscriminatedObjectType) AsTypeBase

func (t *DiscriminatedObjectType) AsTypeBase() *TypeBase

func (*DiscriminatedObjectType) GetWriteOnly

func (t *DiscriminatedObjectType) GetWriteOnly(body interface{}) interface{}

func (*DiscriminatedObjectType) Validate

func (t *DiscriminatedObjectType) Validate(body interface{}, path string) []error

type IntegerType added in v1.13.0

type IntegerType struct {
	Type     string `json:"$type"`
	MinValue *int   `json:"minValue"`
	MaxValue *int   `json:"maxValue"`
}

func (*IntegerType) AsTypeBase added in v1.13.0

func (t *IntegerType) AsTypeBase() *TypeBase

func (*IntegerType) GetWriteOnly added in v1.13.0

func (t *IntegerType) GetWriteOnly(i interface{}) interface{}

func (*IntegerType) Validate added in v1.13.0

func (t *IntegerType) Validate(body interface{}, path string) []error

type ObjectProperty

type ObjectProperty struct {
	Type        *TypeReference
	Flags       []ObjectPropertyFlag
	Description *string
}

func (ObjectProperty) IsReadOnly

func (o ObjectProperty) IsReadOnly() bool

func (ObjectProperty) IsRequired

func (o ObjectProperty) IsRequired() bool

func (*ObjectProperty) UnmarshalJSON

func (o *ObjectProperty) UnmarshalJSON(body []byte) error

type ObjectPropertyFlag

type ObjectPropertyFlag int
const (
	None ObjectPropertyFlag = 0

	Required ObjectPropertyFlag = 1 << 0

	ReadOnly ObjectPropertyFlag = 1 << 1

	WriteOnly ObjectPropertyFlag = 1 << 2

	DeployTimeConstant ObjectPropertyFlag = 1 << 3

	Identifier ObjectPropertyFlag = 1 << 4
)

func PossibleObjectPropertyFlagValues

func PossibleObjectPropertyFlagValues() []ObjectPropertyFlag

type ObjectType

type ObjectType struct {
	Type                 string                    `json:"$type"`
	Name                 string                    `json:"name"`
	Properties           map[string]ObjectProperty `json:"properties"`
	AdditionalProperties *TypeReference            `json:"additionalProperties"`
	Sensitive            bool                      `json:"sensitive"`
}

func (*ObjectType) AsTypeBase

func (t *ObjectType) AsTypeBase() *TypeBase

func (*ObjectType) GetWriteOnly

func (t *ObjectType) GetWriteOnly(body interface{}) interface{}

func (*ObjectType) Validate

func (t *ObjectType) Validate(body interface{}, path string) []error

type ResourceFunctionType

type ResourceFunctionType struct {
	Type         string         `json:"$type"`
	Name         string         `json:"name"`
	ResourceType string         `json:"resourceType"`
	ApiVersion   string         `json:"apiVersion"`
	Input        *TypeReference `json:"input"`
	Output       *TypeReference `json:"output"`
}

func (*ResourceFunctionType) AsTypeBase

func (t *ResourceFunctionType) AsTypeBase() *TypeBase

func (*ResourceFunctionType) GetWriteOnly

func (t *ResourceFunctionType) GetWriteOnly(body interface{}) interface{}

func (*ResourceFunctionType) Validate

func (t *ResourceFunctionType) Validate(body interface{}, path string) []error

type ResourceType

type ResourceType struct {
	Type       string
	Name       string
	ScopeTypes []ScopeType
	Body       *TypeReference
	Flags      []ResourceTypeFlag
}

func (*ResourceType) AsTypeBase

func (t *ResourceType) AsTypeBase() *TypeBase

func (*ResourceType) GetWriteOnly

func (t *ResourceType) GetWriteOnly(body interface{}) interface{}

func (*ResourceType) IsReadOnly

func (t *ResourceType) IsReadOnly() bool

func (*ResourceType) UnmarshalJSON

func (t *ResourceType) UnmarshalJSON(body []byte) error

func (*ResourceType) Validate

func (t *ResourceType) Validate(body interface{}, path string) []error

type ResourceTypeFlag

type ResourceTypeFlag int
const (
	ResourceTypeFlagNone ResourceTypeFlag = 0

	ResourceTypeFlagReadOnly ResourceTypeFlag = 1 << 0
)

func PossibleResourceTypeFlagValues

func PossibleResourceTypeFlagValues() []ResourceTypeFlag

type Schema

type Schema struct {
	Types []*TypeBase
}

func (*Schema) UnmarshalJSON

func (s *Schema) UnmarshalJSON(body []byte) error

type ScopeType

type ScopeType int
const (
	Unknown ScopeType = 0

	Tenant ScopeType = 1 << 0

	ManagementGroup ScopeType = 1 << 1

	Subscription ScopeType = 1 << 2

	ResourceGroup ScopeType = 1 << 3

	Extension ScopeType = 1 << 4
)

func PossibleScopeTypeValues

func PossibleScopeTypeValues() []ScopeType

func (ScopeType) String

func (scope ScopeType) String() string

type StringLiteralType

type StringLiteralType struct {
	Type  string `json:"$type"`
	Value string `json:"value"`
}

func (*StringLiteralType) AsTypeBase

func (t *StringLiteralType) AsTypeBase() *TypeBase

func (*StringLiteralType) GetWriteOnly

func (t *StringLiteralType) GetWriteOnly(i interface{}) interface{}

func (*StringLiteralType) Validate

func (t *StringLiteralType) Validate(body interface{}, path string) []error

type StringType added in v1.13.0

type StringType struct {
	Type      string `json:"$type"`
	MinLength *int   `json:"minLength"`
	MaxLength *int   `json:"maxLength"`
	Sensitive bool   `json:"sensitive"`
	Pattern   string `json:"pattern"`
}

func (*StringType) AsTypeBase added in v1.13.0

func (s *StringType) AsTypeBase() *TypeBase

func (*StringType) GetWriteOnly added in v1.13.0

func (s *StringType) GetWriteOnly(i interface{}) interface{}

func (*StringType) Validate added in v1.13.0

func (s *StringType) Validate(body interface{}, path string) []error

type TypeBase

type TypeBase interface {
	AsTypeBase() *TypeBase
	Validate(interface{}, string) []error
	GetWriteOnly(interface{}) interface{}
}

type TypeReference

type TypeReference struct {
	Type *TypeBase
	Ref  string `json:"$ref"`
}

func (*TypeReference) UpdateType

func (t *TypeReference) UpdateType(types []*TypeBase)

type UnionType

type UnionType struct {
	Type     string           `json:"$type"`
	Elements []*TypeReference `json:"elements"`
}

func (*UnionType) AsTypeBase

func (t *UnionType) AsTypeBase() *TypeBase

func (*UnionType) GetWriteOnly

func (t *UnionType) GetWriteOnly(body interface{}) interface{}

func (*UnionType) Validate

func (t *UnionType) Validate(body interface{}, path string) []error

Jump to

Keyboard shortcuts

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