Matrix/entities/user/user.go
2020-10-17 12:07:39 +02:00

94 lines
3 KiB
Go

package user
import (
"git.nutfactory.org/hoernschen/Matrix/entities/device"
)
type User struct {
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Password string `json:"password,omitempty"`
Devices map[string]*device.Device `json:"devices,omitempty"`
}
type availableRequest struct {
Username string `json:"username,omitempty"`
}
type availableResponse struct {
Available bool `json:"available,omitempty"`
}
type RegisterRequest struct {
Auth AuthentificationData `json:"auth,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
DeviceId string `json:"device_id,omitempty"`
DeviceName string `json:"initial_device_display_name,omitempty"`
InhibitLogin bool `json:"inhibit_login,omitempty"`
}
type RegisterResponse struct {
UserId string `json:"user_id,omitempty"`
AccessToken string `json:"access_token,omitempty"`
sqllite string `json:"home_server,omitempty"`
DeviceId string `json:"device_id,omitempty"`
}
type loginRequest struct {
LoginType string `json:"type,omitempty"`
Identifier identifier `json:"identifier,omitempty"`
Password string `json:"password,omitempty"`
Token string `json:"token,omitempty"`
DeviceId string `json:"device_id,omitempty"`
DeviceName string `json:"initial_device_display_name,omitempty"`
}
type loginResponse struct {
UserId string `json:"user_id,omitempty"`
AccessToken string `json:"access_token,omitempty"`
DeviceId string `json:"device_id,omitempty"`
DiscoveryInfo discoveryInformation `json:"well_known,omitempty"`
}
type deaktivateUserRequest struct {
Auth AuthentificationData `json:"auth,omitempty"`
IdentityServer string `json:"id_server,omitempty"`
}
type deaktivateUserResponse struct {
Unbind3PIDS string `json:"id_server_unbind_result,omitempty"` // success or no-support
}
type changePasswordRequest struct {
NewPassword string
LogoutDevices bool
Auth AuthentificationData
}
type identifier struct {
IdentifierType string `json:"type,omitempty"`
User string `json:"user,omitempty"`
Medium string `json:"medium,omitempty"`
Address string `json:"address,omitempty"`
Country string `json:"country,omitempty"`
Phone string `json:"phone,omitempty"`
}
type AuthentificationData struct {
LoginType string `json:"type,omitempty"`
Session string `json:"session,omitempty"`
}
type discoveryInformation struct {
Homeserver homeserverInformation `json:"m.homeserver,omitempty"`
IdentityServer identityServerInformation `json:"m.identity_server,omitempty"`
}
type homeserverInformation struct {
BaseUrl string `json:"base_url,omitempty"`
}
type identityServerInformation struct {
BaseUrl string `json:"base_url,omitempty"`
}