types

package
v0.0.0-...-5f4f256 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AggCampaignMedia = ResultType("agg-campaign-media", func() {
	Attributes(func() {
		Attribute("rejected", ArrayOf(Any))
		Attribute("invited", ArrayOf(Any))
		Attribute("applied", ArrayOf(Any))
		Attribute("shortlisted", ArrayOf(Any))
		Attribute("selected", ArrayOf(Any))
		Attribute("previous", ArrayOf(Any))
	})
})
View Source
var AggSocialMedia = ResultType("agg-social-media", func() {
	Attributes(func() {
		Attribute("instagram", InstagramMedia)
	})
})
View Source
var AllSessionsMedia = ResultType("all-sessions", func() {
	Description("All of the sessions associated with a user")
	Attributes(func() {
		Attribute("currentSession", SessionMedia)
		Attribute("otherSessions", CollectionOf(SessionMedia))
	})

	View("default", func() {
		Attribute("currentSession")
		Attribute("otherSessions")
	})
})
View Source
var AuthMedia = ResultType("auth-status-media", func() {
	Description("If other Oauths or Auths exists on account.")
	ContentType("application/json")
	Attributes(func() {
		Attribute("google", Boolean, "True if user has google Oauth signin")
		Attribute("facebook", Boolean, "True if user has facebook Oauth signin")
		Attribute("twitter", Boolean, "True if user has twitter Oauth signin")
		Attribute("linkedin", Boolean, "True if user has linkedin Oauth signin")
		Attribute("microsoft", Boolean, "True if user has microsoft Oauth signin")
		Attribute("standard", Boolean, "True if user has password signin")
		Required("google", "facebook", "twitter", "linkedin", "microsoft", "standard")
	})
	View("default", func() {
		Attribute("google")
		Attribute("facebook")
		Attribute("twitter")
		Attribute("linkedin")
		Attribute("microsoft")
		Attribute("standard")
	})
})
View Source
var ChangePasswordParams = Type("change-password-params", func() {
	Attribute("oldPassword", String, "The old password for the current user account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("newPassword", String, "The new password for the current user account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Token("Authorization")
	Token("X-Session")
	APIKey("api_key", "API-Key", String)
	Required("oldPassword", "newPassword", "Authorization", "X-Session")
})
View Source
var InstagramMedia = ResultType("agg-instagram-media", func() {
	Attributes(func() {
		Attribute("website", String)
		Attribute("selectedPlan", SelectedPlanMedia)
		Attribute("username", String)
		Attribute("profilePicture", String)
		Attribute("bio", String)
		Attribute("id", String)
		Attribute("isBusiness", Boolean)
		Attribute("fullName", String)
	})
})
View Source
var LocationMedia = ResultType("user-location-media", func() {
	Attributes(func() {
		Attribute("street", String)
		Attribute("line2", String)
		Attribute("locality", String)
		Attribute("city", String)
		Attribute("state", String)
		Attribute("country", String)
		Attribute("postcode", String)
		Attribute("text", String)
	})
})
View Source
var LoginParams = Type("login-params", func() {
	Attribute("email", String, "The email address of the account to login to", func() {
		Format("email")
	})
	Attribute("password", String, "The password of the account to login to", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("TwoFactor", String, "2 Factor Auth if user has enabled the feature", func() {
		MinLength(6)
		MaxLength(8)
	})
	Attribute("token", String)

	APIKey("api_key", "API-Key", String)
	Required("email", "password")
})
View Source
var OnboardedMedia = ResultType("user-onboarded-media", func() {
	Attributes(func() {
		Attribute("profile", Boolean)
		Attribute("signup", Boolean)
		Attribute("store", Boolean)
		Attribute("campaignDetails", Boolean)
	})
})
View Source
var RegisterParams = Type("register-params", func() {
	Attribute("email", String, "The email that will be attached to the account", func() {
		Format("email")
	})
	Attribute("firstName", String, "The user's given name", func() {
		MinLength(minNameLength)
		MaxLength(maxNameLength)
	})
	Attribute("lastName", String, "The user's family name", func() {
		MaxLength(maxNameLength)
	})
	Attribute("password", String, "The password associated with the new account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	Attribute("username", String, "The username chosen by this user")
	Attribute("phone", String, "The user's phone number")
	Attribute("gRecaptchaResponse", String, "The recaptcha response code")
	Attribute("Authorization", String)
	Attribute("X-Session", String)

	APIKey("api_key", "API-Key", String)
	Required("email", "password", "firstName", "lastName", "gRecaptchaResponse")
})
View Source
var ResetPasswordParams = Type("reset-password-params", func() {
	Attribute("resetCode", String, "The UUID of the password reset, send from the user's email")
	Attribute("userID", String, "The ID of the user to reset the password of")
	Attribute("newPassword", String, "The new password that will be used to login to the account", func() {
		Pattern(passwordPattern)
		MinLength(minPassLength)
		MaxLength(maxPassLength)
	})
	APIKey("api_key", "API-Key", String)
	Required("resetCode", "userID", "newPassword")
})
View Source
var SelectedPlanMedia = ResultType("selected-plan-media", func() {
	Attributes(func() {
		Attribute("ID", String, func() {
			Meta("struct:tag:json", "id")
		})
		Attribute("title", String, func() {
			Meta("struct:tag:json", "title")
		})
		Attribute("description", String, func() {
			Meta("struct:tag:json", "description")
		})
		Attribute("CPC", Int, func() {
			Meta("struct:tag:json", "CPC")
		})
		Attribute("Commission", Int, func() {
			Meta("struct:tag:json", "commission")
		})
		Attribute("OneP", Int, func() {
			Meta("struct:tag:json", "1P")
		})
		Attribute("TwoP", Int, func() {
			Meta("struct:tag:json", "2P")
		})
		Attribute("OneV", Int, func() {
			Meta("struct:tag:json", "1V")
		})
		Attribute("TwoV", Int, func() {
			Meta("struct:tag:json", "2V")
		})
		Attribute("OnePOneV", Int, func() {
			Meta("struct:tag:json", "1P + 1V")
		})
	})
})
View Source
var SessionMedia = ResultType("session", func() {
	Description("A session for a user, associated with a specific browser")
	Attributes(func() {
		Attribute("id", String, "Unique unchanging session ID")
		Attribute("userId", String, "ID of the user this session is for")
		Attribute("lastUsed", String, "Time that this session was last used", func() {
			Format(FormatDateTime)
		})
		Attribute("browser", String, "The browser and browser version connected with this session")
		Attribute("os", String, "The OS of the system where this session was used")
		Attribute("ip", String, "The last IP address where this session was used")
		Attribute("location", String, "A humanReadable string describing the last known location of the session")
		Attribute("coordinates", String, "The latitude and longitude of the last known location of the session", func() {
			Example("513452x54123")
		})
		Attribute("isMobile", Boolean, "Whether the session was from a mobile device")
		Attribute("mapUrl", String, "The URL of the Google map to show the location, suitable for using in an img tag")
		Required("id", "userId", "lastUsed", "browser", "os", "ip", "location", "coordinates", "isMobile", "mapUrl")
	})

	View("default", func() {
		Attribute("id")
		Attribute("userId")
		Attribute("lastUsed")
		Attribute("browser")
		Attribute("os")
		Attribute("ip")
		Attribute("location")
		Attribute("coordinates")
		Attribute("isMobile")
		Attribute("mapUrl")
	})
})
View Source
var UserMedia = ResultType("user-media", func() {
	Description("A user in the system")
	ContentType("application/json")
	Attributes(func() {
		Attribute("id", String, "Unique unchanging user ID")
		Attribute("firstName", String, "Given name for the user", func() {
			Example("Jeff")
		})
		Attribute("lastName", String, "Family name for the user", func() {
			Example("Newmann")
		})
		Attribute("email", String, "Email attached to the account of the user")
		Attribute("phone", String, "Phone Number Of the user")
		Attribute("category", String, "Category of the user generated by our algorithms")
		Attribute("username", String, "Phone Number Of the user")
		Attribute("changingEmail", String, "When the user attempts to change their email, this is what they will change it to after they verify that it belongs to them")
		Attribute("genres", ArrayOf(String))
		Attribute("verifiedEmail", Boolean, "Whether the user has verified their email")
		Attribute("isAdmin", Boolean, "Whether the user is an administrator on the site")
		Attribute("isBrandManager", Boolean, "Whether the user is a brand manager on the site")
		Attribute("uid", String)
		Attribute("updatedAt", String, func() {
			Format(FormatDateTime)
		})
		Attribute("isActive", Boolean)
		Attribute("aggCampaigns", AggCampaignMedia)
		Attribute("gender", String)
		Attribute("onboarded", OnboardedMedia)
		Attribute("location", LocationMedia)
		Attribute("dob", String)
		Attribute("createdAt", String, func() {
			Format(FormatDateTime)
		})
		Attribute("aggSocial", AggSocialMedia)
		Attribute("socialMediaRawData", Any)
		Attribute("Authorization", String)
		Attribute("X-Session", String)

		Required("id", "email", "phone", "username", "verifiedEmail", "isAdmin", "isBrandManager", "firstName", "lastName", "Authorization", "X-Session")
	})
	View("default", func() {
		Attribute("id")
		Attribute("phone")
		Attribute("lastName")
		Attribute("uid")
		Attribute("updatedAt")
		Attribute("email")
		Attribute("category")
		Attribute("isActive")
		Attribute("aggCampaigns")
		Attribute("genres")
		Attribute("username")
		Attribute("gender")
		Attribute("onboarded")
		Attribute("location")
		Attribute("dob")
		Attribute("createdAt")
		Attribute("aggSocial")
		Attribute("firstName")
		Attribute("socialMediaRawData")
		Attribute("changingEmail")
		Attribute("isAdmin")
		Attribute("isBrandManager")
		Attribute("verifiedEmail")
		Attribute("Authorization")
		Attribute("X-Session")
	})
})
View Source
var UserUpdateParams = Type("user-update-params", func() {
	Attribute("firstName", String, "Given name for the user", func() {
		Example("Jeff")
	})
	Attribute("lastName", String, "Family name for the user", func() {
		Example("Newmann")
	})
	Attribute("email", String, "Email attached to the account of the user")
	Attribute("phone", String, "Phone Number Of the user")
	Attribute("username", String, "Phone Number Of the user")
	Attribute("changingEmail", String, "When the user attempts to change their email, this is what they will change it to after they verify that it belongs to them")
	Attribute("genres", ArrayOf(String))
	Attribute("verifiedEmail", Boolean, "Whether the user has verified their email")
	Attribute("isAdmin", Boolean, "Whether the user is an administrator on the site")
	Attribute("isBrandManager", Boolean, "Whether the user is a brand manager on the site")
	Attribute("uid", String)
	Attribute("updatedAt", String, func() {
		Format(FormatDateTime)
	})
	Attribute("isActive", Boolean)
	Attribute("gender", String)
	Attribute("dob", String)
	Attribute("createdAt", String, func() {
		Format(FormatDateTime)
	})
	Token("Authorization")
	Token("X-Session")
	APIKey("api_key", "API-Key", String)
})

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