thingDescription

package
v0.0.0-...-79b5f39 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionElement

type ActionElement struct {
	Type             *TypeDeclaration       `json:"@type"`
	Description      *string                `json:"description,omitempty"`
	Descriptions     map[string]string      `json:"descriptions,omitempty"`
	Forms            []FormElementAction    `json:"forms"`
	Idempotent       *bool                  `json:"idempotent,omitempty"`
	Input            *DataSchema            `json:"input,omitempty"`
	Output           *DataSchema            `json:"output,omitempty"`
	Safe             *bool                  `json:"safe,omitempty"`
	Synchronous      *bool                  `json:"synchronous,omitempty"`
	Title            *string                `json:"title,omitempty"`
	Titles           map[string]string      `json:"titles,omitempty"`
	URIVariables     map[string]DataSchema  `json:"uriVariables,omitempty"`
	AdditionalFields map[string]interface{} `json:",unknown"`
}

type AdditionalResponsesDefinition

type AdditionalResponsesDefinition struct {
	ContentType *string `json:"contentType,omitempty"`
	Schema      *string `json:"schema,omitempty"`
	Success     *bool   `json:"success,omitempty"`
}

type DataSchema

type DataSchema struct {
	Type             *TypeDeclaration       `json:"@type,omitempty"`
	Const            interface{}            `json:"const,omitempty"`
	ContentEncoding  *string                `json:"contentEncoding,omitempty"`
	ContentMediaType *string                `json:"contentMediaType,omitempty"`
	Default          interface{}            `json:"default,omitempty"`
	Description      *string                `json:"description,omitempty"`
	Descriptions     map[string]string      `json:"descriptions,omitempty"`
	Enum             []interface{}          `json:"enum,omitempty"`
	ExclusiveMaximum *float64               `json:"exclusiveMaximum,omitempty"`
	ExclusiveMinimum *float64               `json:"exclusiveMinimum,omitempty"`
	Format           *string                `json:"format,omitempty"`
	Items            *Items                 `json:"items,omitempty"`
	Maximum          *float64               `json:"maximum,omitempty"`
	MaxItems         *int64                 `json:"maxItems,omitempty"`
	MaxLength        *int64                 `json:"maxLength,omitempty"`
	Minimum          *float64               `json:"minimum,omitempty"`
	MinItems         *int64                 `json:"minItems,omitempty"`
	MinLength        *int64                 `json:"minLength,omitempty"`
	MultipleOf       *MultipleOfDefinition  `json:"multipleOf,omitempty"`
	OneOf            []DataSchema           `json:"oneOf,omitempty"`
	Properties       *Properties            `json:"properties,omitempty"`
	ReadOnly         *bool                  `json:"readOnly,omitempty"`
	Required         []string               `json:"required,omitempty"`
	Title            *string                `json:"title,omitempty"`
	Titles           map[string]string      `json:"titles,omitempty"`
	DataSchemaType   *DataSchemaType        `json:"type,omitempty"`
	Unit             *string                `json:"unit,omitempty"`
	WriteOnly        *bool                  `json:"writeOnly,omitempty"`
	AdditionalFields map[string]interface{} `json:",unknown"`
}

func (*DataSchema) ToPropertyElement

func (ds *DataSchema) ToPropertyElement() PropertyElement

type DataSchemaType

type DataSchemaType string
const (
	Array   DataSchemaType = "array"
	Boolean DataSchemaType = "boolean"
	Integer DataSchemaType = "integer"
	Null    DataSchemaType = "null"
	Number  DataSchemaType = "number"
	Object  DataSchemaType = "object"
	String  DataSchemaType = "string"
)

type EventElement

type EventElement struct {
	Type             *TypeDeclaration       `json:"@type"`
	Cancellation     *DataSchema            `json:"cancellation,omitempty"`
	Data             *DataSchema            `json:"data,omitempty"`
	DataResponse     *DataSchema            `json:"dataResponse,omitempty"`
	Description      *string                `json:"description,omitempty"`
	Descriptions     map[string]string      `json:"descriptions,omitempty"`
	Forms            []FormElementEvent     `json:"forms"`
	Subscription     *DataSchema            `json:"subscription,omitempty"`
	Title            *string                `json:"title,omitempty"`
	Titles           map[string]string      `json:"titles,omitempty"`
	URIVariables     map[string]DataSchema  `json:"uriVariables,omitempty"`
	AdditionalFields map[string]interface{} `json:",unknown"`
}

type ExpectedResponse

type ExpectedResponse struct {
	ContentType string `json:"contentType"`
}

type FluffyDescription

type FluffyDescription string
const (
	Subscribeevent   FluffyDescription = "subscribeevent"
	Unsubscribeevent FluffyDescription = "unsubscribeevent"
)

type FormElementAction

type FormElementAction struct {
	Op                  *FormElementActionOp            `json:"op"`
	AdditionalResponses []AdditionalResponsesDefinition `json:"additionalResponses,omitempty"`
	ContentCoding       *string                         `json:"contentCoding,omitempty"`
	ContentType         *string                         `json:"contentType,omitempty"`
	Href                string                          `json:"href"`
	Response            *ExpectedResponse               `json:"response,omitempty"`
	Scopes              *TypeDeclaration                `json:"scopes,omitempty"`
	Security            *TypeDeclaration                `json:"security,omitempty"`
	Subprotocol         *string                         `json:"subprotocol,omitempty"`
	AdditionalFields    map[string]interface{}          `json:",unknown"`
}

type FormElementActionOp

type FormElementActionOp struct {
	Enum        *PurpleDescription
	StringArray []string
}

func (*FormElementActionOp) MarshalJSON

func (x *FormElementActionOp) MarshalJSON() ([]byte, error)

func (*FormElementActionOp) UnmarshalJSON

func (x *FormElementActionOp) UnmarshalJSON(data []byte) error

type FormElementEvent

type FormElementEvent struct {
	Op                  *FormElementEventOp             `json:"op"`
	AdditionalResponses []AdditionalResponsesDefinition `json:"additionalResponses,omitempty"`
	ContentCoding       *string                         `json:"contentCoding,omitempty"`
	ContentType         *string                         `json:"contentType,omitempty"`
	Href                string                          `json:"href"`
	Response            *ExpectedResponse               `json:"response,omitempty"`
	Scopes              *TypeDeclaration                `json:"scopes,omitempty"`
	Security            *TypeDeclaration                `json:"security,omitempty"`
	Subprotocol         *string                         `json:"subprotocol,omitempty"`
	AdditionalFields    map[string]interface{}          `json:",unknown"`
}

type FormElementEventOp

type FormElementEventOp struct {
	Enum        *FluffyDescription
	StringArray []string
}

func (*FormElementEventOp) MarshalJSON

func (x *FormElementEventOp) MarshalJSON() ([]byte, error)

func (*FormElementEventOp) UnmarshalJSON

func (x *FormElementEventOp) UnmarshalJSON(data []byte) error

type FormElementProperty

type FormElementProperty struct {
	Op                  *FormElementPropertyOp          `json:"op"`
	AdditionalResponses []AdditionalResponsesDefinition `json:"additionalResponses,omitempty"`
	ContentCoding       *string                         `json:"contentCoding,omitempty"`
	ContentType         *string                         `json:"contentType,omitempty"`
	Href                url.URL                         `json:"href"`
	Response            *ExpectedResponse               `json:"response,omitempty"`
	Scopes              *TypeDeclaration                `json:"scopes,omitempty"`
	Security            *TypeDeclaration                `json:"security,omitempty"`
	Subprotocol         *string                         `json:"subprotocol,omitempty"`
	AdditionalFields    map[string]interface{}          `json:",unknown"`
}

func (FormElementProperty) MarshalJSON

func (r FormElementProperty) MarshalJSON() ([]byte, error)

func (*FormElementProperty) UnmarshalJSON

func (r *FormElementProperty) UnmarshalJSON(data []byte) error

type FormElementPropertyOp

type FormElementPropertyOp struct {
	Enum        *StickyDescription
	StringArray []string
}

func (*FormElementPropertyOp) MarshalJSON

func (x *FormElementPropertyOp) MarshalJSON() ([]byte, error)

func (*FormElementPropertyOp) UnmarshalJSON

func (x *FormElementPropertyOp) UnmarshalJSON(data []byte) error

type FormElementRoot

type FormElementRoot struct {
	Op                  *FormElementRootOp              `json:"op"`
	AdditionalResponses []AdditionalResponsesDefinition `json:"additionalResponses,omitempty"`
	ContentCoding       *string                         `json:"contentCoding,omitempty"`
	ContentType         *string                         `json:"contentType,omitempty"`
	Href                string                          `json:"href"`
	Response            *ExpectedResponse               `json:"response,omitempty"`
	Scopes              *TypeDeclaration                `json:"scopes,omitempty"`
	Security            *TypeDeclaration                `json:"security,omitempty"`
	Subprotocol         *string                         `json:"subprotocol,omitempty"`
	AdditionalFields    map[string]interface{}          `json:",unknown"`
}

type FormElementRootOp

type FormElementRootOp struct {
	Enum        *TentacledDescription
	StringArray []string
}

func (*FormElementRootOp) MarshalJSON

func (x *FormElementRootOp) MarshalJSON() ([]byte, error)

func (*FormElementRootOp) UnmarshalJSON

func (x *FormElementRootOp) UnmarshalJSON(data []byte) error

type Hreflang

type Hreflang struct {
	String      *string
	StringArray []string
}

func (*Hreflang) MarshalJSON

func (x *Hreflang) MarshalJSON() ([]byte, error)

func (*Hreflang) UnmarshalJSON

func (x *Hreflang) UnmarshalJSON(data []byte) error

type IconLinkElement

type IconLinkElement struct {
	Anchor   *string   `json:"anchor,omitempty"`
	Href     string    `json:"href"`
	Hreflang *Hreflang `json:"hreflang,omitempty"`
	Rel      *string   `json:"rel,omitempty"`
	Type     *string   `json:"type,omitempty"`
	Sizes    *string   `json:"sizes,omitempty"`
}

type In

type In string
const (
	Auto   In = "auto"
	Body   In = "body"
	Cookie In = "cookie"
	Header In = "header"
	Query  In = "query"
	URI    In = "uri"
)

type Items

type Items struct {
	DataSchema      *DataSchema
	DataSchemaArray []DataSchema
}

func (*Items) MarshalJSON

func (x *Items) MarshalJSON() ([]byte, error)

func (*Items) UnmarshalJSON

func (x *Items) UnmarshalJSON(data []byte) error

type MultipleOfDefinition

type MultipleOfDefinition struct {
	Double  *float64
	Integer *int64
}

func (*MultipleOfDefinition) MarshalJSON

func (x *MultipleOfDefinition) MarshalJSON() ([]byte, error)

func (*MultipleOfDefinition) UnmarshalJSON

func (x *MultipleOfDefinition) UnmarshalJSON(data []byte) error

type Properties

type Properties struct {
	AnythingArray []interface{}
	Bool          *bool
	DataSchemaMap map[string]DataSchema
	Double        *float64
	Integer       *int64
	String        *string
}

func (*Properties) MarshalJSON

func (x *Properties) MarshalJSON() ([]byte, error)

func (*Properties) UnmarshalJSON

func (x *Properties) UnmarshalJSON(data []byte) error

type PropertyElement

type PropertyElement struct {
	Type                *TypeDeclaration       `json:"@type,omitempty"`
	Const               interface{}            `json:"const,omitempty"`
	Default             interface{}            `json:"default,omitempty"`
	Description         *string                `json:"description,omitempty"`
	Descriptions        map[string]string      `json:"descriptions,omitempty"`
	Enum                []interface{}          `json:"enum,omitempty"`
	ExclusiveMaximum    *float64               `json:"exclusiveMaximum,omitempty"`
	ExclusiveMinimum    *float64               `json:"exclusiveMinimum,omitempty"`
	Format              *string                `json:"format,omitempty"`
	Forms               []FormElementProperty  `json:"forms"`
	Items               *Items                 `json:"items,omitempty"`
	Maximum             *float64               `json:"maximum,omitempty"`
	MaxItems            *int64                 `json:"maxItems,omitempty"`
	MaxLength           *int64                 `json:"maxLength,omitempty"`
	Minimum             *float64               `json:"minimum,omitempty"`
	MinItems            *int64                 `json:"minItems,omitempty"`
	MinLength           *int64                 `json:"minLength,omitempty"`
	MultipleOf          *MultipleOfDefinition  `json:"multipleOf,omitempty"`
	Observable          *bool                  `json:"observable,omitempty"`
	OneOf               []DataSchema           `json:"oneOf,omitempty"`
	Properties          *Properties            `json:"properties,omitempty"`
	ReadOnly            *bool                  `json:"readOnly,omitempty"`
	Required            []string               `json:"required,omitempty"`
	Title               *string                `json:"title,omitempty"`
	Titles              map[string]string      `json:"titles,omitempty"`
	PropertyElementType *DataSchemaType        `json:"type,omitempty"`
	Unit                *string                `json:"unit,omitempty"`
	URIVariables        map[string]DataSchema  `json:"uriVariables,omitempty"`
	WriteOnly           *bool                  `json:"writeOnly,omitempty"`
	AdditionalFields    map[string]interface{} `json:",unknown"`
}

func (*PropertyElement) ToDataSchema

func (pe *PropertyElement) ToDataSchema() DataSchema

type PurpleDescription

type PurpleDescription string
const (
	Cancelaction PurpleDescription = "cancelaction"
	Invokeaction PurpleDescription = "invokeaction"
	Queryaction  PurpleDescription = "queryaction"
)

type Qop

type Qop string
const (
	Auth    Qop = "auth"
	AuthInt Qop = "auth-int"
)

type SecurityScheme

type SecurityScheme struct {
	Type          *TypeDeclaration  `json:"@type,omitempty"`
	Description   *string           `json:"description,omitempty"`
	Descriptions  map[string]string `json:"descriptions,omitempty"`
	Proxy         *string           `json:"proxy,omitempty"`
	Scheme        string            `json:"scheme"`
	OneOf         []string          `json:"oneOf,omitempty"`
	AllOf         []string          `json:"allOf,omitempty"`
	In            *In               `json:"in,omitempty"`
	Name          *string           `json:"name,omitempty"`
	Qop           *Qop              `json:"qop,omitempty"`
	Alg           *string           `json:"alg,omitempty"`
	Authorization *string           `json:"authorization,omitempty"`
	Format        *string           `json:"format,omitempty"`
	Identity      *string           `json:"identity,omitempty"`
	Flow          *string           `json:"flow,omitempty"`
	Refresh       *string           `json:"refresh,omitempty"`
	Scopes        *TypeDeclaration  `json:"scopes,omitempty"`
	Token         *string           `json:"token,omitempty"`
}

Applies to additional SecuritySchemes not defined in the WoT TD specification.

type StickyDescription

type StickyDescription string
const (
	Observeproperty     StickyDescription = "observeproperty"
	Readproperty        StickyDescription = "readproperty"
	ReadpropertyHistory StickyDescription = "readpropertyhistory"
	Unobserveproperty   StickyDescription = "unobserveproperty"
	Writeproperty       StickyDescription = "writeproperty"
)

type TentacledDescription

type TentacledDescription string
const (
	Observeallproperties    TentacledDescription = "observeallproperties"
	Queryallactions         TentacledDescription = "queryallactions"
	Readallproperties       TentacledDescription = "readallproperties"
	Readmultipleproperties  TentacledDescription = "readmultipleproperties"
	Subscribeallevents      TentacledDescription = "subscribeallevents"
	Unobserveallproperties  TentacledDescription = "unobserveallproperties"
	Unsubscribeallevents    TentacledDescription = "unsubscribeallevents"
	Writeallproperties      TentacledDescription = "writeallproperties"
	Writemultipleproperties TentacledDescription = "writemultipleproperties"
)

type ThingContext

type ThingContext struct {
	AnythingArray []interface{}
	Enum          *ThingContextTdURIV1
}

func (*ThingContext) MarshalJSON

func (x *ThingContext) MarshalJSON() ([]byte, error)

func (*ThingContext) UnmarshalJSON

func (x *ThingContext) UnmarshalJSON(data []byte) error

type ThingContextTdURIV1

type ThingContextTdURIV1 string
const (
	HTTPSWWWW3Org2019WotTdV1  ThingContextTdURIV1 = "https://www.w3.org/2019/wot/td/v1"
	HTTPSWWWW3Org2022WotTdV11 ThingContextTdURIV1 = "https://www.w3.org/2022/wot/td/v1.1"
)

type ThingDescription

type ThingDescription struct {
	Context             *ThingContext              `json:"@context"`
	Type                *TypeDeclaration           `json:"@type,omitempty"`
	Actions             map[string]ActionElement   `json:"actions,omitempty"`
	Base                url.URL                    `json:"base,omitempty"`
	Created             string                     `json:"created,omitempty"`
	Description         string                     `json:"description,omitempty"`
	Descriptions        map[string]string          `json:"descriptions,omitempty"`
	Events              map[string]EventElement    `json:"events,omitempty"`
	Forms               []FormElementRoot          `json:"forms,omitempty"`
	ID                  uri.URI                    `json:"id,omitempty"`
	Links               []IconLinkElement          `json:"links,omitempty"`
	Modified            *string                    `json:"modified,omitempty"`
	Profile             *TypeDeclaration           `json:"profile,omitempty"`
	Properties          map[string]PropertyElement `json:"properties,omitempty"`
	SchemaDefinitions   map[string]DataSchema      `json:"schemaDefinitions,omitempty"`
	Security            *TypeDeclaration           `json:"security"`
	SecurityDefinitions map[string]SecurityScheme  `json:"securityDefinitions"`
	Support             string                     `json:"support,omitempty"`
	Title               string                     `json:"title"`
	Titles              map[string]string          `json:"titles,omitempty"`
	URIVariables        map[string]DataSchema      `json:"uriVariables,omitempty"`
	Version             *Version                   `json:"version,omitempty"`
	AdditionalFields    map[string]interface{}     `json:",unknown"`
}

JSON Schema for validating TD instances against the TD information model. TD instances can be with or without terms that have default values

func UnmarshalThingDescription

func UnmarshalThingDescription(data []byte) (ThingDescription, error)

func (*ThingDescription) HandleJSONData

func (c *ThingDescription) HandleJSONData(data map[string]interface{}) error

func (ThingDescription) MarshalJSON

func (r ThingDescription) MarshalJSON() ([]byte, error)

func (*ThingDescription) UnmarshalJSON

func (r *ThingDescription) UnmarshalJSON(data []byte) error

type TypeDeclaration

type TypeDeclaration struct {
	String      *string
	StringArray []string
}

func (*TypeDeclaration) MarshalJSON

func (x *TypeDeclaration) MarshalJSON() ([]byte, error)

func (*TypeDeclaration) UnmarshalJSON

func (x *TypeDeclaration) UnmarshalJSON(data []byte) error

type Version

type Version struct {
	Instance string `json:"instance"`
}

Jump to

Keyboard shortcuts

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