design

package
v0.0.0-...-bdb19bb Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Authorize = MediaType("application/vnd.authorize+json", func() {
	Description("Token authorization response")
	Attributes(func() {
		Attribute("access_token", String, "access token", func() {
		})
		Attribute("expires_in", Integer, "Time to expiration in seconds", func() {
		})
		Attribute("token_type", String, "type of token", func() {
		})

	})

	View("default", func() {
		Attribute("access_token")
		Attribute("expires_in")
		Attribute("token_type")
	})

})

Authorize is the authorize resource media type.

View Source
var Login = MediaType("application/vnd.login+json", func() {
	Description("")
	Attributes(func() {
		Attribute("email", String, "email", func() {
		})
		Attribute("password", String, "password", func() {
		})
		Attribute("application", String, "UUID of requesting application", func() {
		})

	})

	View("default", func() {
		Attribute("email")
		Attribute("password")
		Attribute("application")
	})

})

Login is the Login resource media type.

View Source
var Proposal = MediaType("application/vnd.proposal+json", func() {
	Description("A response to a CFP")
	Reference(ProposalPayload)
	Attributes(func() {
		Attribute("id", Integer, "ID of user")
		Attribute("href", String, "API href of user")
		Attribute("title", String, "Response title")
		Attribute("abstract", String, "Response abstract")
		Attribute("detail", String, "Response detail")
		Attribute("reviews", CollectionOf(Review), "Reviews")
	})

	Links(func() {
		Link("reviews")
	})
	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("title")
		Attribute("abstract")
		Attribute("detail")
		Attribute("reviews")
		Attribute("links")
	})
	View("link", func() {
		Attribute("id")
		Attribute("href")
		Attribute("title")
	})
})

Proposal is the proposal resource mediatype

View Source
var ProposalPayload = Type("ProposalPayload", func() {
	Attribute("title", func() {
		MinLength(10)
		MaxLength(200)
	})
	Attribute("abstract", func() {
		MinLength(50)
		MaxLength(500)
	})
	Attribute("detail", func() {
		MinLength(100)
		MaxLength(2000)
	})
	Attribute("withdrawn", Boolean)
})

ProposalModel defines the data structure used in the create proposal request body. It is also the base type for the proposal media type used to render users.

View Source
var Review = MediaType("application/vnd.review+json", func() {
	Description("A review is submitted by a reviewer")
	Reference(ReviewPayload)
	Attributes(func() {
		Attribute("id", Integer, "ID of user")
		Attribute("href", String, "API href of user")
		Attribute("comment", String, "Review comments")
		Attribute("rating", Integer, "Rating of proposal, from 1-5")
	})
	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("comment")
		Attribute("rating")
	})
	View("link", func() {
		Attribute("id")
		Attribute("href")
	})
})

Review is the review resource mediatype

View Source
var ReviewPayload = Type("ReviewPayload", func() {
	Attribute("comment", func() {
		MinLength(10)
		MaxLength(200)
	})
	Attribute("rating", Integer, func() {
		Minimum(1)
		Maximum(5)
	})
})

ReviewModel defines the data structure used to create a review request body It is also the base type for the review media type used to render reviews

View Source
var User = MediaType("application/vnd.user+json", func() {
	Description("A user belonging to a tenant account")
	Reference(UserPayload)
	Attributes(func() {
		Attribute("id", Integer, "ID of user")
		Attribute("href", String, "API href of user")
		Attribute("firstname", String, "First name of user")
		Attribute("lastname", String, "Last name of user")
		Attribute("city", String, "City of residence")
		Attribute("state", String, "State of residence")
		Attribute("country", String, "Country of residence")
		Attribute("bio", String, "Biography of user")
		Attribute("role", String, "Role of user")
		Attribute("email", String, "Email address of user", func() {
			Format("email")
		})
	})
	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("firstname")
		Attribute("lastname")
		Attribute("email")
		Attribute("city")
		Attribute("state")
		Attribute("country")
		Attribute("bio")
		Attribute("role")
	})
	View("link", func() {
		Attribute("id")
		Attribute("href")
		Attribute("email")
	})
})

User is the user resource media type.

View Source
var UserPayload = Type("UserPayload", func() {
	Attribute("firstname", func() {
	})
	Attribute("lastname", func() {
	})
	Attribute("city", func() {
	})
	Attribute("state", func() {
	})
	Attribute("country", func() {
	})
	Attribute("email", func() {
		Format("email")
	})
	Attribute("bio", func() {
		MaxLength(500)
	})

})

UserModel defines the data structure used in the create user request body. It is also the base type for the user media type used to render users.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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