api_paths

package
v1.33.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 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{
			Responce:    tdproto.Chat{},
			Description: "Get the chat information.",
		},
		Put: &OperationSpec{
			Request:     tdproto.Chat{},
			Responce:    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{},
			Responce:    tdproto.Message{},
			Description: "Edit message.",
		},
		Delete: &OperationSpec{
			Responce:    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{},
			Responce:    tdproto.Message{},
			Description: "Edit message in direct chat.",
		},
		Delete: &OperationSpec{
			Responce:    tdproto.Message{},
			Description: "Delete message in direct chat.",
		},
	},
}
View Source
var GroupPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/groups",
		Get: &OperationSpec{
			Responce:    []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{
			Responce:    []tdproto.GroupMembership{},
			Description: "Get the list of group members.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/groups/{group_id}/members/{contact_id}",
		Delete: &OperationSpec{
			Responce:    tdproto.GroupMembership{},
			Description: "Remove member from the group.",
		},
	},
}
View Source
var MiscPaths = []PathSpec{
	{
		Path: "/api/v4/addr",
		Get: &OperationSpec{
			Responce:            "",
			Description:         "Returns client address for debuging purposes.",
			ResponceDescription: "Address of the server.",
			SecurityIsOptional:  true,
		},
	},
	{
		Path: "/api/v4/ping",
		Get: &OperationSpec{
			Responce:            "",
			Description:         "Ping the server.",
			ResponceDescription: "Set to ``\"pong\"``.",
			SecurityIsOptional:  true,
		},
	},
	{
		Path: "/features.json",
		Get: &OperationSpec{
			Responce:           tdproto.Features{},
			Description:        "Get the server features information.",
			SecurityIsOptional: true,
		},
	},
}
View Source
var PathTitles = map[string]string{
	"group": "Group related paths",
	"team":  "Team related paths",
	"chat":  "Chat related paths",
	"misc":  "Miscelaneos paths",
	"task":  "Task related paths",
}
View Source
var TaskPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/tasks",
		Post: &OperationSpec{
			Request:     tdapi.Task{},
			Responce:    tdapi.Task{},
			Description: "Create new task",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/tasks/{task_id}",
		Get: &OperationSpec{
			Responce:    tdapi.Task{},
			Description: "Get task",
		},
		Post: &OperationSpec{
			Request:     tdapi.Task{},
			Responce:    tdapi.Task{},
			Description: "Update task",
		},
		Delete: &OperationSpec{
			Responce:    tdapi.Task{},
			Description: "Delete task",
		},
	},
}
View Source
var TeamPaths = []PathSpec{
	{
		Path: "/api/v4/teams",
		Get: &OperationSpec{
			Responce:    []tdproto.Team{},
			Description: "Get the list of teams on the server.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}",
		Get: &OperationSpec{
			Responce:    tdproto.Team{},
			Description: "Get team info.",
		},
		Put: &OperationSpec{
			Request:             tdproto.Team{},
			Responce:            tdproto.Team{},
			Description:         []string{"Update team settings.", "Must have admin rights."},
			RequestDescription:  ":ref:`tdproto-Team` object with updated fields.",
			ResponceDescription: "Updated :ref:`tdproto-Team` object of the team.",
		},
		Delete: &OperationSpec{
			Responce:            tdproto.Team{},
			ResponceDescription: ":ref:`tdproto-Team` object of deleted team.",
			Description:         []string{"Delete the team.", "Must have admin rights."},
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats",
		Get: &OperationSpec{
			Responce:    []tdproto.Chat{},
			Description: "Get the list of chats in the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts",
		Get: &OperationSpec{
			Responce:    []tdproto.Contact{},
			Description: "Get the list of contacts of the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts/{contact_id}",
		Get: &OperationSpec{
			Responce:    tdproto.Contact{},
			Description: "Get contact details.",
		},
		Post: &OperationSpec{
			Request:             tdproto.Contact{},
			Responce:            tdproto.Contact{},
			Description:         "Update contact details.",
			ResponceDescription: "Updated :ref:`tdproto-Contact` object.",
		},
		Delete: &OperationSpec{
			Responce:            tdproto.Contact{},
			Description:         []string{"Remove contact from the team.", "Must have admin rights."},
			ResponceDescription: "Removed :ref:`tdproto-Contact` object.",
		},
	},
}

Functions

This section is empty.

Types

type OperationSpec added in v1.32.0

type OperationSpec struct {
	Request             interface{}
	Responce            interface{}
	Description         interface{}
	ResponceDescription string
	RequestDescription  string
	SecurityIsOptional  bool
}

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