api_paths

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllPaths = map[string][]PathSpec{
	"group": GroupPaths,
	"team":  TeamPaths,
	"chat":  ChatPaths,
}
View Source
var ChatPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}",
		Get: &HttpSpec{
			Responce:    tdproto.Chat{},
			Description: "Get the chat information.",
		},
		Put: &HttpSpec{
			Request:     tdproto.Chat{},
			Responce:    tdproto.Chat{},
			Description: "Change chat settings.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}/messages",
		Post: &HttpSpec{
			Request:     tdproto.Message{},
			Description: "Send text message to chat.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/chats/{chat_id}/messages/{message_id}",
		Post: &HttpSpec{
			Request:     tdproto.Message{},
			Responce:    tdproto.Message{},
			Description: "Edit message.",
		},
		Delete: &HttpSpec{
			Responce:    tdproto.Message{},
			Description: "Delete message.",
		},
	},
}
View Source
var GroupPaths = []PathSpec{
	{
		Path: "/api/v4/teams/{team_id}/groups",
		Get: &HttpSpec{
			Responce:    []tdproto.Chat{},
			Description: "Get all groups in the team.",
		},
		Delete: &HttpSpec{
			Description: "Delete the group.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/groups/{group_id}/members",
		Get: &HttpSpec{
			Responce:    []tdproto.GroupMembership{},
			Description: "Get the list of group members.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/groups/{group_id}/members/{contact_id}",
		Delete: &HttpSpec{
			Responce:    tdproto.GroupMembership{},
			Description: "Remove member from the group.",
		},
	},
}
View Source
var PathTitles = map[string]string{
	"group": "Group related paths.",
	"team":  "Team related paths.",
	"chat":  "Chat related paths.",
}
View Source
var TeamPaths = []PathSpec{
	{
		Path: "/api/v4/teams",
		Get: &HttpSpec{
			Responce:    []tdproto.Team{},
			Description: "Get the list of teams on the server.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}",
		Get: &HttpSpec{
			Responce:    tdproto.Team{},
			Description: "Get team info.",
		},
		Put: &HttpSpec{
			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: &HttpSpec{
			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: &HttpSpec{
			Responce:    []tdproto.Chat{},
			Description: "Get the list of chats in the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts",
		Get: &HttpSpec{
			Responce:    []tdproto.Contact{},
			Description: "Get the list of contacts of the team.",
		},
	},
	{
		Path: "/api/v4/teams/{team_id}/contacts/{contact_id}",
		Get: &HttpSpec{
			Responce:    tdproto.Contact{},
			Description: "Get contact details.",
		},
		Post: &HttpSpec{
			Request:             tdproto.Contact{},
			Responce:            tdproto.Contact{},
			Description:         "Update contact details.",
			ResponceDescription: "Updated :ref:`tdproto-Contact` object.",
		},
		Delete: &HttpSpec{
			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 HttpSpec

type HttpSpec struct {
	Request             interface{}
	Responce            interface{}
	Description         interface{}
	ResponceDescription string
	RequestDescription  string
}

type PathSpec

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

Jump to

Keyboard shortcuts

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