api_paths

package
v1.51.57 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllPaths = map[string][]PathSpec{
	"group": GroupPaths,
	"team":  TeamPaths,
	"chat":  ChatPaths,
	"misc":  MiscPaths,
	"task":  TaskPaths,
}
View Source
var ChatPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}",
		Get: &OperationSpec{
			Response:    tdproto.Chat{},
			Description: "Get the chat information.",
		},
		Put: &OperationSpec{
			Request:     tdproto.Chat{},
			Response:    tdproto.Chat{},
			Description: "Change chat settings.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}/messages",

		Post: &OperationSpec{
			Request:     tdproto.Message{},
			Description: "Send text message to chat.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}/messages/{message_id}",
		Post: &OperationSpec{
			Request:     tdproto.Message{},
			Response:    tdproto.Message{},
			Description: "Edit message.",
		},
		Delete: &OperationSpec{
			Response:    tdproto.Message{},
			Description: "Delete message.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{contact_id}/messages",
		Post: &OperationSpec{
			Request:     tdproto.Message{},
			Description: "Send text message to direct chat.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{contact_id}/messages/{message_id}",
		Post: &OperationSpec{
			Request:     tdproto.Message{},
			Response:    tdproto.Message{},
			Description: "Edit message in direct chat.",
		},
		Delete: &OperationSpec{
			Response:    tdproto.Message{},
			Description: "Delete message in direct chat.",
		},
	},
}
View Source
var GroupPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/groups",
		Get: &OperationSpec{
			Response:    []tdproto.Chat{},
			Description: "Get all groups in the team.",
		},
		Delete: &OperationSpec{
			Description: "Delete the group.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/groups/{group_id}/members",
		Get: &OperationSpec{
			Response:    []tdproto.GroupMembership{},
			Description: "Get the list of group members.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/groups/{group_id}/members/{contact_id}",
		Delete: &OperationSpec{
			Response:    tdproto.GroupMembership{},
			Description: "Remove member from the group.",
		},
	},
}
View Source
var MiscPaths = []PathSpec{
	{
		Path: "/api/v4/addr",
		Get: &OperationSpec{
			Response:            "",
			Description:         "Returns client address for debuging purposes.",
			ResponseDescription: "Address of the server.",
			SecurityIsOptional:  true,
		},
	},
	{
		Path: "/api/v4/ping",
		Get: &OperationSpec{
			Response:            "",
			Description:         "Ping the server.",
			ResponseDescription: "Set to ``\"pong\"``.",
			SecurityIsOptional:  true,
		},
	},
	{
		Path: "/features.json",
		Get: &OperationSpec{
			Response:           tdproto.Features{},
			Description:        "Get the server features information.",
			SecurityIsOptional: true,
		},
	},
	{
		Path: "/api/v4/badge",
		Get: &OperationSpec{
			Response:            0,
			Description:         "Return number of unread messages.",
			ResponseDescription: "Number of unread messages",
		},
	},
}
View Source
var PathTitles = map[string]string{
	"group": "Group related paths",
	"team":  "Team related paths",
	"chat":  "Chat related paths",
	"misc":  "Miscellaneous paths",
	"task":  "Task related paths",
}
View Source
var TaskPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/tasks",
		Post: &OperationSpec{
			Request:     tdapi.Task{},
			Response:    tdapi.Task{},
			Description: "Create new task",
		},
		Get: &OperationSpec{
			QueryStruct: tdapi.TaskFilter{},
			Response:    []tdapi.Task{},
			Description: "Get the list of tasks",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/tasks/{task_id}",
		Get: &OperationSpec{
			Response:    tdapi.Task{},
			Description: "Get task",
		},
		Post: &OperationSpec{
			Request:     tdapi.Task{},
			Response:    tdapi.Task{},
			Description: "Update task",
		},
		Delete: &OperationSpec{
			Response:    tdapi.Task{},
			Description: "Delete task",
		},
	},
}
View Source
var TeamPaths = []PathSpec{
	{
		Path: "/api/v4/teams",
		Get: &OperationSpec{
			Response:    []tdproto.Team{},
			Description: "Get the list of teams on the server.",
		},
		Post: &OperationSpec{
			Request:             tdproto.Team{},
			Response:            tdproto.Team{},
			Description:         "Create new team.",
			RequestDescription:  ":tdproto:ref:`Team` object with fields of new team.",
			ResponseDescription: ":tdproto:ref:`Team` of new team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}",
		Get: &OperationSpec{
			Response:    tdproto.Team{},
			Description: "Get team info.",
		},
		Put: &OperationSpec{
			Request:             tdproto.Team{},
			Response:            tdproto.Team{},
			Description:         []string{"Update team settings.", "Must have admin rights."},
			RequestDescription:  ":tdproto:ref:`Team` object with updated fields.",
			ResponseDescription: "Updated :tdproto:ref:`Team` object of the team.",
		},
		Delete: &OperationSpec{
			Response:            tdproto.Team{},
			ResponseDescription: ":tdproto:ref:`Team` object of deleted team.",
			Description:         []string{"Delete the team.", "Must have admin rights."},
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats",
		Get: &OperationSpec{
			Response:    []tdproto.Chat{},
			Description: "Get the list of chats in the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts",
		Get: &OperationSpec{
			Response:    []tdproto.Contact{},
			Description: "Get the list of contacts of the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts/{contact_id}",
		Get: &OperationSpec{
			Response:    tdproto.Contact{},
			Description: "Get contact details.",
		},
		Post: &OperationSpec{
			Request:             tdproto.Contact{},
			Response:            tdproto.Contact{},
			Description:         "Update contact details.",
			ResponseDescription: "Updated :tdproto:ref:`Contact` object.",
		},
		Delete: &OperationSpec{
			Response:            tdproto.Contact{},
			Description:         []string{"Remove contact from the team.", "Must have admin rights."},
			ResponseDescription: "Removed :tdproto:ref:`Contact` object.",
		},
	},
}

Functions

This section is empty.

Types

type OperationSpec added in v1.32.0

type OperationSpec struct {
	Request             interface{}
	Response            interface{}
	Description         interface{}
	ResponseDescription string
	RequestDescription  string
	SecurityIsOptional  bool
	QueryStruct         interface{}
}

type PathSpec

type PathSpec struct {
	Path   string
	Get    *OperationSpec
	Put    *OperationSpec
	Delete *OperationSpec
	Post   *OperationSpec
}

Jump to

Keyboard shortcuts

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