design

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateUserPayload = Type("CreateUserPayload", func() {
	Description("CreateUserPayload")

	Attribute("email", String, "Email of user", func() {
		Format("email")
	})
	Attribute("password", String, "Password of user", func() {
		MinLength(6)
		MaxLength(30)
	})
	Attribute("roles", ArrayOf(String), "Roles of user")
	Attribute("organizations", ArrayOf(String), "List of organizations to which this user belongs to")
	Attribute("namespaces", ArrayOf(String), "List of namespaces this user belongs to")
	Attribute("externalId", String, "External id of user")
	Attribute("active", Boolean, "Status of user account", func() {
		Default(false)
	})
	Attribute("token", String, "Token for email verification")

	Required("email")
})

CreateUserPayload defines the payload for the user.

View Source
var CredentialsPayload = Type("Credentials", func() {
	Description("Email and password credentials")
	Attribute("email", String, "Email of user", func() {
		Format("email")
	})
	Attribute("password", String, "Password of user", func() {
		MinLength(6)
		MaxLength(30)
	})
	Required("email", "password")
})

CredentialsPayload defines the payload for the credentials.

View Source
var EmailPayload = Type("EmailPayload", func() {
	Description("Email payload")
	Attribute("email", String, "Email of user", func() {
		Format("email")
	})
	Required("email")
})

EmailPayload defines the payload for the email.

View Source
var FilterPayload = Type("FilterPayload", func() {
	Attribute("page", Integer, "Page number (1-based).")
	Attribute("pageSize", Integer, "Items per page.")
	Attribute("filter", ArrayOf(FilterProperty), "Users filter.")
	Attribute("sort", OrderSpec, "Sort specification.")
	Required("page", "pageSize")
})

FilterPayload Users filter request payload.

View Source
var FilterProperty = Type("FilterProperty", func() {
	Attribute("property", String, "Property name")
	Attribute("value", String, "Property value to match")
	Required("property", "value")
})

FilterProperty Single property filter. Holds the property name and the value to be matched for that property.

View Source
var ForgotPasswordPayload = Type("ForgotPasswordPayload", func() {
	Description("Password Reset payload")
	Attribute("email", String, "Email of the user", func() {
		Format("email")
	})
	Attribute("password", String, "New password", func() {
		MinLength(6)
		MaxLength(30)
	})
	Attribute("token", String, "Forgot password token")
	Required("password", "token")
})

ForgotPasswordPayload defines the payload for the password/forgot.

View Source
var OrderSpec = Type("OrderSpec", func() {
	Attribute("property", String, "Sort by property")
	Attribute("direction", String, "Sort order. Can be 'asc' or 'desc'.")
	Required("property", "direction")
})

OrderSpec specifies the sorting - by which property and the direction, either 'asc' (ascending) or 'desc' (descending).

View Source
var ResetTokenMedia = MediaType("ResetTokenMedia", func() {
	TypeName("ResetToken")
	Attributes(func() {
		Attribute("id", String, "User ID")
		Attribute("email", String, "User email")
		Attribute("token", String, "New token")
		Required("id", "email", "token")
	})
	View("default", func() {
		Attribute("id")
		Attribute("email")
		Attribute("token")
	})
})

ResetTokenMedia is returned after successful reset of the verification token

View Source
var UpdateUserPayload = Type("UpdateUserPayload", func() {
	Description("UpdateUserPayload")

	Attribute("email", String, "Email of user", func() {
		Format("email")
	})
	Attribute("password", String, "Password of user", func() {
		MinLength(6)
		MaxLength(30)
	})
	Attribute("roles", ArrayOf(String), "Roles of user")
	Attribute("organizations", ArrayOf(String), "List of organizations to which this user belongs to")
	Attribute("namespaces", ArrayOf(String), "List of namespaces this user belongs to")
	Attribute("externalId", String, "External id of user")
	Attribute("active", Boolean, "Status of user account", func() {
		Default(false)
	})
	Attribute("token", String, "Token for email verification")
})

UpdateUserPayload defines the payload for the user.

View Source
var UserMedia = MediaType("application/vnd.goa.user+json", func() {
	TypeName("users")
	Reference(CreateUserPayload)

	Attributes(func() {
		Attribute("id", String, "Unique user ID")
		Attribute("email")
		Attribute("roles")
		Attribute("externalId")
		Attribute("active")
		Attribute("organizations")
		Attribute("namespaces")
		Required("id", "email", "roles", "externalId", "active")
	})

	View("default", func() {
		Attribute("id")
		Attribute("email")
		Attribute("roles")
		Attribute("externalId")
		Attribute("active")
		Attribute("organizations")
		Attribute("namespaces")
	})
})

UserMedia defines the media type used to render user.

View Source
var UsersPageMedia = MediaType("application/mt.ckan.users-page+json", func() {
	TypeName("UsersPage")
	Attributes(func() {
		Attribute("page", Integer, "Page number (1-based).")
		Attribute("pageSize", Integer, "Items per page.")
		Attribute("items", ArrayOf(UserMedia), "Users list")
	})
	View("default", func() {
		Attribute("page")
		Attribute("pageSize")
		Attribute("items")
	})
})

UsersPageMedia result of filter-by. One result page along with items (array of 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