twicmdproto

package
v0.0.0-...-15ca262 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CommandArgumentHint_name = map[int32]string{
		0: "COMMAND_ARGUMENT_HINT_UNSPECIFIED",
		1: "COMMAND_ARGUMENT_HINT_STRING",
		2: "COMMAND_ARGUMENT_HINT_NUMBER",
		3: "COMMAND_ARGUMENT_HINT_INTEGER",
		4: "COMMAND_ARGUMENT_HINT_PERSON",
		5: "COMMAND_ARGUMENT_HINT_EMAIL",
		6: "COMMAND_ARGUMENT_HINT_PHONE_NUMBER",
		7: "COMMAND_ARGUMENT_HINT_ADDRESS",
		8: "COMMAND_ARGUMENT_HINT_DURATION",
		9: "COMMAND_ARGUMENT_HINT_DATE",
	}
	CommandArgumentHint_value = map[string]int32{
		"COMMAND_ARGUMENT_HINT_UNSPECIFIED":  0,
		"COMMAND_ARGUMENT_HINT_STRING":       1,
		"COMMAND_ARGUMENT_HINT_NUMBER":       2,
		"COMMAND_ARGUMENT_HINT_INTEGER":      3,
		"COMMAND_ARGUMENT_HINT_PERSON":       4,
		"COMMAND_ARGUMENT_HINT_EMAIL":        5,
		"COMMAND_ARGUMENT_HINT_PHONE_NUMBER": 6,
		"COMMAND_ARGUMENT_HINT_ADDRESS":      7,
		"COMMAND_ARGUMENT_HINT_DURATION":     8,
		"COMMAND_ARGUMENT_HINT_DATE":         9,
	}
)

Enum value maps for CommandArgumentHint.

View Source
var File_twicmd_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ArgumentAutocompleteRequest

type ArgumentAutocompleteRequest struct {

	// The name of the service.
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// The name of the command.
	Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
	// The name of the argument within the command.
	Argument string `protobuf:"bytes,3,opt,name=argument,proto3" json:"argument,omitempty"`
	// The input to autocomplete.
	// If empty, list as many suggestions as possible.
	Input string `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

A request to autocomplete an argument. It returns a list of possible values for the given argument sorted by relevance.

func (*ArgumentAutocompleteRequest) Descriptor deprecated

func (*ArgumentAutocompleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use ArgumentAutocompleteRequest.ProtoReflect.Descriptor instead.

func (*ArgumentAutocompleteRequest) GetArgument

func (x *ArgumentAutocompleteRequest) GetArgument() string

func (*ArgumentAutocompleteRequest) GetCommand

func (x *ArgumentAutocompleteRequest) GetCommand() string

func (*ArgumentAutocompleteRequest) GetInput

func (x *ArgumentAutocompleteRequest) GetInput() string

func (*ArgumentAutocompleteRequest) GetService

func (x *ArgumentAutocompleteRequest) GetService() string

func (*ArgumentAutocompleteRequest) ProtoMessage

func (*ArgumentAutocompleteRequest) ProtoMessage()

func (*ArgumentAutocompleteRequest) ProtoReflect

func (*ArgumentAutocompleteRequest) Reset

func (x *ArgumentAutocompleteRequest) Reset()

func (*ArgumentAutocompleteRequest) String

func (x *ArgumentAutocompleteRequest) String() string

type ArgumentAutocompleteResponse

type ArgumentAutocompleteResponse struct {
	Suggestions []string `protobuf:"bytes,1,rep,name=suggestions,proto3" json:"suggestions,omitempty"`
	// contains filtered or unexported fields
}

The response to an argument autocompletion request.

func (*ArgumentAutocompleteResponse) Descriptor deprecated

func (*ArgumentAutocompleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use ArgumentAutocompleteResponse.ProtoReflect.Descriptor instead.

func (*ArgumentAutocompleteResponse) GetSuggestions

func (x *ArgumentAutocompleteResponse) GetSuggestions() []string

func (*ArgumentAutocompleteResponse) ProtoMessage

func (*ArgumentAutocompleteResponse) ProtoMessage()

func (*ArgumentAutocompleteResponse) ProtoReflect

func (*ArgumentAutocompleteResponse) Reset

func (x *ArgumentAutocompleteResponse) Reset()

func (*ArgumentAutocompleteResponse) String

type Command

type Command struct {
	Service   string             `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	Command   string             `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
	Arguments []*CommandArgument `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"`
	// contains filtered or unexported fields
}

A command to be executed sent by the user.

func (*Command) Descriptor deprecated

func (*Command) Descriptor() ([]byte, []int)

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetArguments

func (x *Command) GetArguments() []*CommandArgument

func (*Command) GetCommand

func (x *Command) GetCommand() string

func (*Command) GetService

func (x *Command) GetService() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type CommandArgument

type CommandArgument struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

A command argument.

func (*CommandArgument) Descriptor deprecated

func (*CommandArgument) Descriptor() ([]byte, []int)

Deprecated: Use CommandArgument.ProtoReflect.Descriptor instead.

func (*CommandArgument) GetName

func (x *CommandArgument) GetName() string

func (*CommandArgument) GetValue

func (x *CommandArgument) GetValue() string

func (*CommandArgument) ProtoMessage

func (*CommandArgument) ProtoMessage()

func (*CommandArgument) ProtoReflect

func (x *CommandArgument) ProtoReflect() protoreflect.Message

func (*CommandArgument) Reset

func (x *CommandArgument) Reset()

func (*CommandArgument) String

func (x *CommandArgument) String() string

type CommandArgumentDescription

type CommandArgumentDescription struct {

	// Whether the argument is required.
	Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
	// The human-readable description of the argument.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// The hint that the parser will use.
	// The NLP will also use it to determine the argument's context.
	Hint CommandArgumentHint `protobuf:"varint,3,opt,name=hint,proto3,enum=twicmd.CommandArgumentHint" json:"hint,omitempty"`
	// contains filtered or unexported fields
}

A description of a command argument within a command.

func (*CommandArgumentDescription) Descriptor deprecated

func (*CommandArgumentDescription) Descriptor() ([]byte, []int)

Deprecated: Use CommandArgumentDescription.ProtoReflect.Descriptor instead.

func (*CommandArgumentDescription) GetDescription

func (x *CommandArgumentDescription) GetDescription() string

func (*CommandArgumentDescription) GetHint

func (*CommandArgumentDescription) GetRequired

func (x *CommandArgumentDescription) GetRequired() bool

func (*CommandArgumentDescription) ProtoMessage

func (*CommandArgumentDescription) ProtoMessage()

func (*CommandArgumentDescription) ProtoReflect

func (*CommandArgumentDescription) Reset

func (x *CommandArgumentDescription) Reset()

func (*CommandArgumentDescription) String

func (x *CommandArgumentDescription) String() string

type CommandArgumentHint

type CommandArgumentHint int32
const (
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_UNSPECIFIED  CommandArgumentHint = 0
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_STRING       CommandArgumentHint = 1
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_NUMBER       CommandArgumentHint = 2
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_INTEGER      CommandArgumentHint = 3
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_PERSON       CommandArgumentHint = 4
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_EMAIL        CommandArgumentHint = 5
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_PHONE_NUMBER CommandArgumentHint = 6
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_ADDRESS      CommandArgumentHint = 7
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_DURATION     CommandArgumentHint = 8
	CommandArgumentHint_COMMAND_ARGUMENT_HINT_DATE         CommandArgumentHint = 9 // ...
)

func (CommandArgumentHint) Descriptor

func (CommandArgumentHint) Enum

func (CommandArgumentHint) EnumDescriptor deprecated

func (CommandArgumentHint) EnumDescriptor() ([]byte, []int)

Deprecated: Use CommandArgumentHint.Descriptor instead.

func (CommandArgumentHint) Number

func (CommandArgumentHint) String

func (x CommandArgumentHint) String() string

func (CommandArgumentHint) Type

type CommandDescription

type CommandDescription struct {

	// The name of the slash command.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The human-readable description of the command.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// The map of named arguments that the command accepts.
	Arguments map[string]*CommandArgumentDescription `` /* 159-byte string literal not displayed */
	// The order in which the named arguments are expected.
	// This is only useful for positional parsing.
	// Such a parser must also implement a fallback name=value parser.
	ArgumentPositions []string `protobuf:"bytes,3,rep,name=argument_positions,json=argumentPositions,proto3" json:"argument_positions,omitempty"`
	// Whether the command accepts a trailing argument at the end.
	// The last argument in the positions list is considered trailing.
	// This is only meaningful if argument_positions is set.
	ArgumentTrailing bool `protobuf:"varint,4,opt,name=argument_trailing,json=argumentTrailing,proto3" json:"argument_trailing,omitempty"`
	// contains filtered or unexported fields
}

A description of a command that the service provides. It mostly contains human-readable information about the command, but some data may be used by the natural language processor.

func (*CommandDescription) Descriptor deprecated

func (*CommandDescription) Descriptor() ([]byte, []int)

Deprecated: Use CommandDescription.ProtoReflect.Descriptor instead.

func (*CommandDescription) GetArgumentPositions

func (x *CommandDescription) GetArgumentPositions() []string

func (*CommandDescription) GetArgumentTrailing

func (x *CommandDescription) GetArgumentTrailing() bool

func (*CommandDescription) GetArguments

func (x *CommandDescription) GetArguments() map[string]*CommandArgumentDescription

func (*CommandDescription) GetDescription

func (x *CommandDescription) GetDescription() string

func (*CommandDescription) GetName

func (x *CommandDescription) GetName() string

func (*CommandDescription) ProtoMessage

func (*CommandDescription) ProtoMessage()

func (*CommandDescription) ProtoReflect

func (x *CommandDescription) ProtoReflect() protoreflect.Message

func (*CommandDescription) Reset

func (x *CommandDescription) Reset()

func (*CommandDescription) String

func (x *CommandDescription) String() string

type ExecuteRequest

type ExecuteRequest struct {
	Command *Command             `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	Message *twismsproto.Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

The request sent on the POST /execute endpoint.

func (*ExecuteRequest) Descriptor deprecated

func (*ExecuteRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.

func (*ExecuteRequest) GetCommand

func (x *ExecuteRequest) GetCommand() *Command

func (*ExecuteRequest) GetMessage

func (x *ExecuteRequest) GetMessage() *twismsproto.Message

func (*ExecuteRequest) ProtoMessage

func (*ExecuteRequest) ProtoMessage()

func (*ExecuteRequest) ProtoReflect

func (x *ExecuteRequest) ProtoReflect() protoreflect.Message

func (*ExecuteRequest) Reset

func (x *ExecuteRequest) Reset()

func (*ExecuteRequest) String

func (x *ExecuteRequest) String() string

type ExecuteResponse

type ExecuteResponse struct {

	// Types that are assignable to Response:
	//
	//	*ExecuteResponse_Text
	//	*ExecuteResponse_Body
	//	*ExecuteResponse_Status
	Response isExecuteResponse_Response `protobuf_oneof:"response"`
	// contains filtered or unexported fields
}

The response sent back to the user after executing a command.

func (*ExecuteResponse) Descriptor deprecated

func (*ExecuteResponse) Descriptor() ([]byte, []int)

Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.

func (*ExecuteResponse) GetBody

func (x *ExecuteResponse) GetBody() *twismsproto.MessageBody

func (*ExecuteResponse) GetResponse

func (m *ExecuteResponse) GetResponse() isExecuteResponse_Response

func (*ExecuteResponse) GetStatus

func (x *ExecuteResponse) GetStatus() string

func (*ExecuteResponse) GetText

func (x *ExecuteResponse) GetText() string

func (*ExecuteResponse) ProtoMessage

func (*ExecuteResponse) ProtoMessage()

func (*ExecuteResponse) ProtoReflect

func (x *ExecuteResponse) ProtoReflect() protoreflect.Message

func (*ExecuteResponse) Reset

func (x *ExecuteResponse) Reset()

func (*ExecuteResponse) String

func (x *ExecuteResponse) String() string

type ExecuteResponse_Body

type ExecuteResponse_Body struct {
	// A response with a message body.
	Body *twismsproto.MessageBody `protobuf:"bytes,2,opt,name=body,proto3,oneof"`
}

type ExecuteResponse_Status

type ExecuteResponse_Status struct {
	// A system response, including errors.
	// These responses may be localized or transformed.
	Status string `protobuf:"bytes,3,opt,name=status,proto3,oneof"`
}

type ExecuteResponse_Text

type ExecuteResponse_Text struct {
	// A plain text response.
	// This is the same as the Text field in MessageBody.
	Text string `protobuf:"bytes,1,opt,name=text,proto3,oneof"`
}

type Service

type Service struct {

	// The name of the service. Each service registers its own single-word name,
	// usually the brand name, to be used in this.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The human-readable description of the service.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The list of descriptions of commands that the service provides.
	Commands []*CommandDescription `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"`
	// The human-readable name of the service.
	// This name can be the full and properly captalized name of the service.
	HumanName *string `protobuf:"bytes,7,opt,name=human_name,json=humanName,proto3,oneof" json:"human_name,omitempty"`
	// The URL to the service's official website, if any.
	WebsiteUrl *string `protobuf:"bytes,8,opt,name=website_url,json=websiteUrl,proto3,oneof" json:"website_url,omitempty"`
	// The URL of the service's icon.
	IconUrl *string `protobuf:"bytes,4,opt,name=icon_url,json=iconUrl,proto3,oneof" json:"icon_url,omitempty"`
	// The optional brand color of the service.
	Color *string `protobuf:"bytes,5,opt,name=color,proto3,oneof" json:"color,omitempty"`
	// The optional control panel schema of the service.
	OptionsSchema *twicmdcfgpb.Schema `protobuf:"bytes,6,opt,name=options_schema,json=optionsSchema,proto3,oneof" json:"options_schema,omitempty"`
	// contains filtered or unexported fields
}

A service that provides commands to be executed.

func (*Service) Descriptor deprecated

func (*Service) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetColor

func (x *Service) GetColor() string

func (*Service) GetCommands

func (x *Service) GetCommands() []*CommandDescription

func (*Service) GetDescription

func (x *Service) GetDescription() string

func (*Service) GetHumanName

func (x *Service) GetHumanName() string

func (*Service) GetIconUrl

func (x *Service) GetIconUrl() string

func (*Service) GetName

func (x *Service) GetName() string

func (*Service) GetOptionsSchema

func (x *Service) GetOptionsSchema() *twicmdcfgpb.Schema

func (*Service) GetWebsiteUrl

func (x *Service) GetWebsiteUrl() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

Jump to

Keyboard shortcuts

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