payload

package
v0.0.0-...-224a6a0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExcInvalidPhone = internal.NewException(http.StatusBadRequest, "ERR_INVALID_PHONE")
	ExcInvalidEmail = internal.NewException(http.StatusBadRequest, "ERR_INVALID_EMAIL")
)

Functions

This section is empty.

Types

type Community

type Community struct {
	ID         string    `json:"id"`
	Address    string    `json:"address"`
	Name       string    `json:"name"`
	Categories []string  `json:"categories"`
	PinnedIDs  []string  `json:"pinned_ids"`
	CreatedAt  time.Time `json:"created_at"`
}

type CommunityAndMembership

type CommunityAndMembership struct {
	Community  Community   `json:"community"`
	Membership *Membership `json:"membership,omitempty"`
}

type DeleteUserResponse

type DeleteUserResponse struct {
	class.Payload
}

type GetCommunityListResponse

type GetCommunityListResponse struct {
	class.Payload
	Communities []CommunityAndMembership `json:"communities"`
}

type GetCommunityRequest

type GetCommunityRequest struct {
	class.Payload
	ID string `param:"id" validate:"required"`
}

type GetCommunityResponse

type GetCommunityResponse struct {
	class.Payload
	CommunityAndMembership
}

type GetCommunityUserListRequest

type GetCommunityUserListRequest struct {
	class.Payload
	ID string `param:"id" validate:"required"`
}

type GetCommunityUserListResponse

type GetCommunityUserListResponse struct {
	class.Payload
	Users []UserAndMembership `json:"users"`
}

type GetCommunityUserRequest

type GetCommunityUserRequest struct {
	class.Payload
	CommunityID  string `param:"community_id" validate:"required"`
	MembershipID string `param:"membership_id" validate:"required"`
}

type GetCommunityUserResponse

type GetCommunityUserResponse struct {
	class.Payload
	UserAndMembership
}

type GetFileRequest

type GetFileRequest struct {
	class.Payload
	Name string `param:"name" validate:"required"`
}

type GetInvitationListResponse

type GetInvitationListResponse struct {
	class.Payload
	Invitations []Invitation `json:"invitations"`
}

type GetPostHistoryRequest

type GetPostHistoryRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type GetPostHistoryResponse

type GetPostHistoryResponse struct {
	class.Payload
	History []PostHistory `json:"history"`
}

type GetPostListRequest

type GetPostListRequest struct {
	class.Payload
	CommunityID string  `param:"id" validate:"required"`
	Type        *string `query:"type" validate:"omitempty,required"`
}

type GetPostListResponse

type GetPostListResponse struct {
	class.Payload
	Posts []Post `json:"posts"`
}

type GetPostRequest

type GetPostRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type GetPostResponse

type GetPostResponse struct {
	class.Payload
	Post
}

type GetPostThreadRequest

type GetPostThreadRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type GetPostThreadResponse

type GetPostThreadResponse struct {
	class.Payload
	Thread []Post `json:"thread"`
}

type GetUserProfileResponse

type GetUserProfileResponse struct {
	class.Payload
	User
}

type Invitation

type Invitation struct {
	ID          string    `json:"id"`
	Phone       string    `json:"phone"`
	CommunityID string    `json:"community_id"`
	Door        string    `json:"door"`
	Role        string    `json:"role"`
	CreatedAt   time.Time `json:"created_at"`
}

type Membership

type Membership struct {
	ID          string    `json:"id"`
	UserID      string    `json:"user_id"`
	CommunityID string    `json:"community_id"`
	Door        string    `json:"door"`
	Role        string    `json:"role"`
	CreatedAt   time.Time `json:"created_at"`
}

type Post

type Post struct {
	ID           string    `json:"id"`
	ThreadID     *string   `json:"thread_id"`
	CreatorID    string    `json:"creator_id"`
	Type         string    `json:"type"`
	Priority     *int      `json:"priority"`
	RecipientIDs *[]string `json:"recipient_ids"`
	VoterIDs     []string  `json:"voter_ids"`
	Subposts     int       `json:"subposts"`
	CreatedAt    time.Time `json:"created_at"`
	PostHistory
}

type PostCommunityInviteRequest

type PostCommunityInviteRequest struct {
	class.Payload
	ID    string `param:"id" validate:"required"`
	Phone string `json:"phone" validate:"required"`
	Door  string `json:"door"`
	Role  string `json:"role" validate:"required"`
}

func (*PostCommunityInviteRequest) Process

func (self *PostCommunityInviteRequest) Process() error

type PostCommunityInviteResponse

type PostCommunityInviteResponse struct {
	class.Payload
	Invitation
}

type PostCommunityLeaveRequest

type PostCommunityLeaveRequest struct {
	class.Payload
	ID string `param:"id" validate:"required"`
}

type PostCommunityLeaveResponse

type PostCommunityLeaveResponse struct {
	class.Payload
}

type PostCommunityRequest

type PostCommunityRequest struct {
	class.Payload
	Address    string    `json:"address" validate:"required"`
	Name       *string   `json:"name" validate:"omitempty,required"`
	Categories *[]string `json:"categories" validate:"omitempty,required"`
}

type PostCommunityResponse

type PostCommunityResponse struct {
	class.Payload
	CommunityAndMembership
}

type PostFileResponse

type PostFileResponse struct {
	class.Payload
	URL string `json:"url"`
}

type PostHistory

type PostHistory struct {
	UpdatorID  string      `json:"updator_id"`
	Message    string      `json:"message"`
	Categories []string    `json:"categories"`
	State      *string     `json:"state"`
	Media      []string    `json:"media"`
	Widgets    PostWidgets `json:"widgets"`
	CreatedAt  time.Time   `json:"created_at,omitempty"`
}

type PostInvitationAcceptRequest

type PostInvitationAcceptRequest struct {
	class.Payload
	ID string `param:"id" validate:"required"`
}

type PostInvitationAcceptResponse

type PostInvitationAcceptResponse struct {
	class.Payload
	Membership
}

type PostInvitationRejectRequest

type PostInvitationRejectRequest struct {
	class.Payload
	ID string `param:"id" validate:"required"`
}

type PostInvitationRejectResponse

type PostInvitationRejectResponse struct {
	class.Payload
}

type PostLoginEndRequest

type PostLoginEndRequest struct {
	class.Payload
	ID   string `json:"id" validate:"required"`
	Code string `json:"code" validate:"required"`
}

type PostLoginEndResponse

type PostLoginEndResponse struct {
	class.Payload
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	User         *User  `json:"user"`
}

type PostLoginStartRequest

type PostLoginStartRequest struct {
	class.Payload
	Phone string `json:"phone" validate:"required"`
}

func (*PostLoginStartRequest) Process

func (self *PostLoginStartRequest) Process() error

type PostLoginStartResponse

type PostLoginStartResponse struct {
	class.Payload
	ID string `json:"id"`
}

type PostLogoutResponse

type PostLogoutResponse struct {
	class.Payload
}

type PostPinPostRequest

type PostPinPostRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type PostPinPostResponse

type PostPinPostResponse struct {
	class.Payload
	Community
}

type PostPostRequest

type PostPostRequest struct {
	class.Payload
	CommunityID  string    `param:"id" validate:"required"`
	Type         string    `json:"type" validate:"required"`
	ThreadID     *string   `json:"thread_id" validate:"omitempty,required"`
	Priority     *int      `json:"priority" validate:"omitempty,required"`
	RecipientIDs *[]string `json:"recipient_ids" validate:"omitempty,required"`
	Message      string    `json:"message" validate:"required"`
	Categories   *[]string `json:"categories" validate:"omitempty,required"`
	State        *string   `json:"state" validate:"omitempty,required"`
	Media        *[]string `json:"media" validate:"omitempty,required"`
	Widgets      *struct {
		PollOptions *[]string `json:"poll_options" validate:"omitempty,required"`
	} `json:"widgets" validate:"omitempty,required"`
}

type PostPostResponse

type PostPostResponse struct {
	class.Payload
	Post
}

type PostUnpinPostRequest

type PostUnpinPostRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type PostUnpinPostResponse

type PostUnpinPostResponse struct {
	class.Payload
	Community
}

type PostUnvotePostRequest

type PostUnvotePostRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type PostUnvotePostResponse

type PostUnvotePostResponse struct {
	class.Payload
	Post
}

type PostUserEmailEndRequest

type PostUserEmailEndRequest struct {
	class.Payload
	ID   string `json:"id" validate:"required"`
	Code string `json:"code" validate:"required"`
}

type PostUserEmailEndResponse

type PostUserEmailEndResponse struct {
	class.Payload
	Email string `json:"email"`
}

type PostUserEmailStartRequest

type PostUserEmailStartRequest struct {
	class.Payload
	Email string `json:"email" validate:"required"`
}

func (*PostUserEmailStartRequest) Process

func (self *PostUserEmailStartRequest) Process() error

type PostUserEmailStartResponse

type PostUserEmailStartResponse struct {
	class.Payload
	ID string `json:"id"`
}

type PostUserPhoneEndRequest

type PostUserPhoneEndRequest struct {
	class.Payload
	ID   string `json:"id" validate:"required"`
	Code string `json:"code" validate:"required"`
}

type PostUserPhoneEndResponse

type PostUserPhoneEndResponse struct {
	class.Payload
	Phone string `json:"phone"`
}

type PostUserPhoneStartRequest

type PostUserPhoneStartRequest struct {
	class.Payload
	Phone string `json:"phone" validate:"required"`
}

func (*PostUserPhoneStartRequest) Process

func (self *PostUserPhoneStartRequest) Process() error

type PostUserPhoneStartResponse

type PostUserPhoneStartResponse struct {
	class.Payload
	ID string `json:"id"`
}

type PostUserProfileRequest

type PostUserProfileRequest struct {
	class.Payload
	Name     *string    `json:"name" validate:"omitempty,required"`
	LastName *string    `json:"last_name" validate:"omitempty,required"`
	Picture  *string    `json:"picture" validate:"omitempty,required"`
	Birthday *date.Date `json:"birthday" validate:"omitempty,required"`
}

type PostUserProfileResponse

type PostUserProfileResponse struct {
	class.Payload
	User
}

type PostVotePostPollRequest

type PostVotePostPollRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
	Option      string `json:"option" validate:"required"`
}

type PostVotePostPollResponse

type PostVotePostPollResponse struct {
	class.Payload
	Post
}

type PostVotePostRequest

type PostVotePostRequest struct {
	class.Payload
	CommunityID string `param:"community_id" validate:"required"`
	PostID      string `param:"post_id" validate:"required"`
}

type PostVotePostResponse

type PostVotePostResponse struct {
	class.Payload
	Post
}

type PostWidgets

type PostWidgets struct {
	Poll *map[string][]string `json:"poll,omitempty"`
}

type PutPostRequest

type PutPostRequest struct {
	class.Payload
	CommunityID string    `param:"community_id" validate:"required"`
	PostID      string    `param:"post_id" validate:"required"`
	Message     *string   `json:"message" validate:"omitempty,required"`
	Categories  *[]string `json:"categories" validate:"omitempty,required"`
	State       *string   `json:"state" validate:"omitempty,required"`
	Media       *[]string `json:"media" validate:"omitempty,required"`
	Widgets     *struct {
		PollOptions *[]string `json:"poll_options" validate:"omitempty,required"`
	} `json:"widgets" validate:"omitempty,required"`
}

type PutPostResponse

type PutPostResponse struct {
	class.Payload
	Post
}

type SeedArguments

type SeedArguments struct {
	class.Payload
	cli.Helper
}

type User

type User struct {
	ID       string    `json:"id"`
	Phone    string    `json:"phone"`
	Name     string    `json:"name"`
	Email    string    `json:"email"`
	Picture  string    `json:"picture"`
	Birthday date.Date `json:"birthday"`
}

type UserAndMembership

type UserAndMembership struct {
	User       User       `json:"user"`
	Membership Membership `json:"membership"`
}

Jump to

Keyboard shortcuts

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