package main

// RetrieveAPost from APIBlueprint Transition 'Retrieve a Post'
type RetrieveAPostResult struct {
	Id          string      `json:"id"`
	UserId      string      `json:"user_id"`
	CreatedAt   string      `json:"created_at"`
	Text        string      `json:"text"`
	MachineOnly bool        `json:"machine_only"`
	ReplyTo     interface{} `json:"reply_to"`
	ThreadId    string      `json:"thread_id"`
	NumReplies  int64       `json:"num_replies"`
	NumReposts  int64       `json:"num_reposts"`
	NumStars    int64       `json:"num_stars"`
	YouReposted bool        `json:"you_reposted"`
	YouStarred  bool        `json:"you_starred"`
}

func NewRetrieveAPostResult(id string, userId string, createdAt string, text string, machineOnly bool, replyTo interface{}, threadId string, numReplies int64, numReposts int64, numStars int64, youReposted bool, youStarred bool) *RetrieveAPostResult {
	return &RetrieveAPostResult{
		Id:          id,
		UserId:      userId,
		CreatedAt:   createdAt,
		Text:        text,
		MachineOnly: machineOnly,
		ReplyTo:     replyTo,
		ThreadId:    threadId,
		NumReplies:  numReplies,
		NumReposts:  numReposts,
		NumStars:    numStars,
		YouReposted: youReposted,
		YouStarred:  youStarred,
	}
}

// DeleteAPost from APIBlueprint Transition 'Delete a Post'
type DeleteAPostResult struct {
}

func NewDeleteAPostResult() *DeleteAPostResult {
	return &DeleteAPostResult{}
}

// PostResource from APIBlueprint Resource 'Post'
type PostResource interface {
	RetrieveAPost(postId string) (*RetrieveAPostResult, error)
	DeleteAPost(postId string) (*DeleteAPostResult, error)
}
type CreateAPostInput struct {
	Id          string      `json:"id"`
	UserId      string      `json:"user_id"`
	CreatedAt   string      `json:"created_at"`
	Text        string      `json:"text"`
	MachineOnly bool        `json:"machine_only"`
	ReplyTo     interface{} `json:"reply_to"`
	ThreadId    string      `json:"thread_id"`
	NumReplies  int64       `json:"num_replies"`
	NumReposts  int64       `json:"num_reposts"`
	NumStars    int64       `json:"num_stars"`
	YouReposted bool        `json:"you_reposted"`
	YouStarred  bool        `json:"you_starred"`
}

func NewCreateAPostInput(id string, userId string, createdAt string, text string, machineOnly bool, replyTo interface{}, threadId string, numReplies int64, numReposts int64, numStars int64, youReposted bool, youStarred bool) *CreateAPostInput {
	return &CreateAPostInput{
		Id:          id,
		UserId:      userId,
		CreatedAt:   createdAt,
		Text:        text,
		MachineOnly: machineOnly,
		ReplyTo:     replyTo,
		ThreadId:    threadId,
		NumReplies:  numReplies,
		NumReposts:  numReposts,
		NumStars:    numStars,
		YouReposted: youReposted,
		YouStarred:  youStarred,
	}
}

// CreateAPost from APIBlueprint Transition 'Create a Post'
type CreateAPostResult struct {
	Id          string      `json:"id"`
	UserId      string      `json:"user_id"`
	CreatedAt   string      `json:"created_at"`
	Text        string      `json:"text"`
	MachineOnly bool        `json:"machine_only"`
	ReplyTo     interface{} `json:"reply_to"`
	ThreadId    string      `json:"thread_id"`
	NumReplies  int64       `json:"num_replies"`
	NumReposts  int64       `json:"num_reposts"`
	NumStars    int64       `json:"num_stars"`
	YouReposted bool        `json:"you_reposted"`
	YouStarred  bool        `json:"you_starred"`
}

func NewCreateAPostResult(id string, userId string, createdAt string, text string, machineOnly bool, replyTo interface{}, threadId string, numReplies int64, numReposts int64, numStars int64, youReposted bool, youStarred bool) *CreateAPostResult {
	return &CreateAPostResult{
		Id:          id,
		UserId:      userId,
		CreatedAt:   createdAt,
		Text:        text,
		MachineOnly: machineOnly,
		ReplyTo:     replyTo,
		ThreadId:    threadId,
		NumReplies:  numReplies,
		NumReposts:  numReposts,
		NumStars:    numStars,
		YouReposted: youReposted,
		YouStarred:  youStarred,
	}
}

// RetrieveAllPosts from APIBlueprint Transition 'Retrieve all Posts'
type RetrieveAllPostsResult struct {
	Data interface{} `json:"data"`
	Meta interface{} `json:"meta"`
}

func NewRetrieveAllPostsResult(data interface{}, meta interface{}) *RetrieveAllPostsResult {
	return &RetrieveAllPostsResult{
		Data: data,
		Meta: meta,
	}
}

// PostsCollectionResource from APIBlueprint Resource 'Posts Collection'
type PostsCollectionResource interface {
	CreateAPost(postData *CreateAPostInput) (*CreateAPostResult, error)
	RetrieveAllPosts() (*RetrieveAllPostsResult, error)
}

// StarAPost from APIBlueprint Transition 'Star a Post'
type StarAPostResult struct {
	Id          string      `json:"id"`
	UserId      string      `json:"user_id"`
	CreatedAt   string      `json:"created_at"`
	Text        string      `json:"text"`
	MachineOnly bool        `json:"machine_only"`
	ReplyTo     interface{} `json:"reply_to"`
	ThreadId    string      `json:"thread_id"`
	NumReplies  int64       `json:"num_replies"`
	NumReposts  int64       `json:"num_reposts"`
	NumStars    int64       `json:"num_stars"`
	YouReposted bool        `json:"you_reposted"`
	YouStarred  bool        `json:"you_starred"`
}

func NewStarAPostResult(id string, userId string, createdAt string, text string, machineOnly bool, replyTo interface{}, threadId string, numReplies int64, numReposts int64, numStars int64, youReposted bool, youStarred bool) *StarAPostResult {
	return &StarAPostResult{
		Id:          id,
		UserId:      userId,
		CreatedAt:   createdAt,
		Text:        text,
		MachineOnly: machineOnly,
		ReplyTo:     replyTo,
		ThreadId:    threadId,
		NumReplies:  numReplies,
		NumReposts:  numReposts,
		NumStars:    numStars,
		YouReposted: youReposted,
		YouStarred:  youStarred,
	}
}

// UnstarAPost from APIBlueprint Transition 'Unstar a Post'
type UnstarAPostResult struct {
	Id          string      `json:"id"`
	UserId      string      `json:"user_id"`
	CreatedAt   string      `json:"created_at"`
	Text        string      `json:"text"`
	MachineOnly bool        `json:"machine_only"`
	ReplyTo     interface{} `json:"reply_to"`
	ThreadId    string      `json:"thread_id"`
	NumReplies  int64       `json:"num_replies"`
	NumReposts  int64       `json:"num_reposts"`
	NumStars    int64       `json:"num_stars"`
	YouReposted bool        `json:"you_reposted"`
	YouStarred  bool        `json:"you_starred"`
}

func NewUnstarAPostResult(id string, userId string, createdAt string, text string, machineOnly bool, replyTo interface{}, threadId string, numReplies int64, numReposts int64, numStars int64, youReposted bool, youStarred bool) *UnstarAPostResult {
	return &UnstarAPostResult{
		Id:          id,
		UserId:      userId,
		CreatedAt:   createdAt,
		Text:        text,
		MachineOnly: machineOnly,
		ReplyTo:     replyTo,
		ThreadId:    threadId,
		NumReplies:  numReplies,
		NumReposts:  numReposts,
		NumStars:    numStars,
		YouReposted: youReposted,
		YouStarred:  youStarred,
	}
}

// StarsResource from APIBlueprint Resource 'Stars'
type StarsResource interface {
	StarAPost(postId int64) (*StarAPostResult, error)
	UnstarAPost(postId int64) (*UnstarAPostResult, error)
}
