model

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllDatumNodeType = []DatumNodeType{
	DatumNodeTypeParticipant,
}
View Source
var AllProvider = []Provider{
	ProviderMturk,
}
View Source
var AllRole = []Role{
	RoleAdmin,
	RoleParticipant,
}

Functions

func MarshalUint32

func MarshalUint32(i uint32) graphql.Marshaler

MarshalUint32 helps marshalling a uint32 for the Uint32 Graphql scalar

func UnmarshalUint32

func UnmarshalUint32(v interface{}) (uint32, error)

UnmarshalUint32 helps unmarshal a uint32 for the Uint32 Graphql scalar

Types

type AddParticipantsInput

type AddParticipantsInput struct {
	Participants []*ImportedParticipant `json:"participants"`
	ProjectID    *string                `json:"projectID"`
}

type AuthInput

type AuthInput struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type AuthResp

type AuthResp struct {
	Token string `json:"token"`
}

type CancelRunInput

type CancelRunInput struct {
	ID string `json:"ID"`
}

type CompValue

type CompValue struct {
	Int     *int     `json:"int"`
	Float   *float64 `json:"float"`
	String  *string  `json:"string"`
	Boolean *bool    `json:"boolean"`
}

Possible Condition values. Only one of the fields in a CompValue should be defined.

type CompValueInput

type CompValueInput struct {
	Int     *int     `json:"int"`
	Float   *float64 `json:"float"`
	String  *string  `json:"string"`
	Boolean *bool    `json:"boolean"`
}

Possible Condition values. Only one of the fields in a CompValue should be defined.

type Comparator

type Comparator string

The kind of comparison to make against a value.

const (
	ComparatorLessThan             Comparator = "LESS_THAN"
	ComparatorLessThanOrEqualTo    Comparator = "LESS_THAN_OR_EQUAL_TO"
	ComparatorGreaterThan          Comparator = "GREATER_THAN"
	ComparatorGreaterThanOrEqualTo Comparator = "GREATER_THAN_OR_EQUAL_TO"
	ComparatorEqualTo              Comparator = "EQUAL_TO"
	ComparatorNotEqualTo           Comparator = "NOT_EQUAL_TO"
	ComparatorExists               Comparator = "EXISTS"
	ComparatorDoesNotExist         Comparator = "DOES_NOT_EXIST"
	ComparatorIn                   Comparator = "IN"
	ComparatorNotIn                Comparator = "NOT_IN"
)

func (Comparator) IsValid

func (e Comparator) IsValid() bool

func (Comparator) MarshalGQL

func (e Comparator) MarshalGQL(w io.Writer)

func (Comparator) String

func (e Comparator) String() string

func (*Comparator) UnmarshalGQL

func (e *Comparator) UnmarshalGQL(v interface{}) error

type Condition

type Condition struct {
	And        []*Condition `json:"and"`
	Or         []*Condition `json:"or"`
	Key        *string      `json:"key"`
	Comparator *Comparator  `json:"comparator"`
	Values     []*CompValue `json:"values"`
}

Condition for a filter. A condition must **either**: - have one or more `and` Conditions - have one or more `or` Conditions - have a comparator and one or more values When comparing against values, the first value is used for operands comparing single values (LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, NotEqualTo). When testing for existence an empty array is DoesNotExist and an array with one or more values Exists. For In and NotIn all values in the values array are used. If the condition is empty (no and, no or, no key), it will match any record.

func ConditionFromInput

func ConditionFromInput(condi *ConditionInput) *Condition

type ConditionInput

type ConditionInput struct {
	And        []*ConditionInput `json:"and"`
	Or         []*ConditionInput `json:"or"`
	Key        *string           `json:"key"`
	Comparator *Comparator       `json:"comparator"`
	Values     []*CompValueInput `json:"values"`
}

Condition for a filter. A condition must **either**: - have one or more `and` Conditions - have one or more `or` Conditions - have a comparator and one or more values When comparing against values, the first value is used for operands comparing single values (LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, NotEqualTo). When testing for existence an empty array is DoesNotExist and an array with one or more values Exists. For In and NotIn all values in the values array are used.

type ContentType

type ContentType string

ContentType is the type rendering used for a field.

const (
	// PLAIN uses plain text, no formatting. Templating uses Handlebars-style
	// interpolation (i.e. {{url}}).
	ContentTypePlain ContentType = "PLAIN"
	// MARKDOWN uses a Markdown renderer. Templating uses Handlebars-style
	// interpolation (i.e. {{url}}).
	ContentTypeMarkdown ContentType = "MARKDOWN"
	// HTML uses an HTML rendered. Templating uses Handlebars-style
	// interpolation (i.e. {{url}}).
	ContentTypeHTML ContentType = "HTML"
	// REACT uses a React renderer. Templating passes template arguments as props.
	// The root component should be the default ES6 export.
	ContentTypeReact ContentType = "REACT"
	// SVELTE uses a Svelte renderer. Templating passes template arguments as props.
	// The root component should be the default ES6 export.
	ContentTypeSvelte ContentType = "SVELTE"
)

func (ContentType) IsValid

func (e ContentType) IsValid() bool

func (ContentType) MarshalGQL

func (e ContentType) MarshalGQL(w io.Writer)

func (ContentType) String

func (e ContentType) String() string

func (*ContentType) UnmarshalGQL

func (e *ContentType) UnmarshalGQL(v interface{}) error

type CreateProjectInput

type CreateProjectInput struct {
	ProjectID string `json:"projectID"`
	Name      string `json:"name"`
}

type CreateRunInput

type CreateRunInput struct {
	ProjectID string         `json:"projectID"`
	Template  *TemplateInput `json:"template"`
}

type CreateTemplateInput

type CreateTemplateInput struct {
	// Project in which to create the Template.
	ProjectID string         `json:"projectID"`
	Template  *TemplateInput `json:"template"`
}

type DatumNodeType

type DatumNodeType string

Type of the object for Datum updates

const (
	DatumNodeTypeParticipant DatumNodeType = "PARTICIPANT"
)

func (DatumNodeType) IsValid

func (e DatumNodeType) IsValid() bool

func (DatumNodeType) MarshalGQL

func (e DatumNodeType) MarshalGQL(w io.Writer)

func (DatumNodeType) String

func (e DatumNodeType) String() string

func (*DatumNodeType) UnmarshalGQL

func (e *DatumNodeType) UnmarshalGQL(v interface{}) error

type DeleteDatumInput

type DeleteDatumInput struct {
	// key identifies the unique key of the Datum.
	Key string `json:"key"`
	// Type of object on which to delete the value. Defaults to PARTICIPANT
	NodeType *DatumNodeType `json:"nodeType"`
	// ID of object on which to delete the value.
	NodeID string `json:"nodeID"`
}

DeleteDatumInput deletes Data on a Node.

type DuplicateRunInput

type DuplicateRunInput struct {
	RunID       string  `json:"runID"`
	ToProjectID *string `json:"toProjectID"`
}

type FilterStepArgs

type FilterStepArgs struct {
	// Type is whether to use a predefined filter, JS code, or the Condition filter
	// mechanism.
	Type *ParticipantFilterType `json:"type"`
	// Filter should be the name of pre-defined filtering function.
	Filter *string `json:"filter"`
	// Javascript to execute as a participant filter step.
	// The code must contain a functinon exported using a default ES6 export.
	// The function should accept a single argument object. This object contains the
	// following fields:
	// - `participants`: the participants entering this step
	// - `step`: this step (contains the definition of this step: duration, etc.)
	// - `stepRun`: instance of this step (contains the execution of this step: start time, etc.)
	// - `template`: parent template of step (contains the definition of the Template)
	// - `run`: run this step is part of (contains the instance of the Template)
	// The functions should return an array of participants.
	// If the functions returns null or undefined, the participants are not filtered.
	// If the function throws an exception, the run will fail.
	Js *string `json:"js"`
	// Condition set the participant must meet to be allowed to participate.
	Condition *Condition `json:"condition"`
}

FilterStepArgs are arguments passed to a Pariticipant Filter Step. It must contains **either** JS code or the name of pre-defined filtering function. This is only valid for an PARTICIPANT_FILTER Step.

func FilterArgsFromInput

func FilterArgsFromInput(criti *FilterStepArgsInput) *FilterStepArgs

type FilterStepArgsInput

type FilterStepArgsInput struct {
	// Type is whether to use a predefined filter, JS code, or the Condition filter
	// mechanism.
	Type *ParticipantFilterType `json:"type"`
	// Javascript to execute as a participant filter step.
	// The code must contain a functinon exported using a default ES6 export.
	// The function should accept a single argument object. This object contains the
	// following fields:
	// - `participants`: the participants entering this step
	// - `step`: this step (contains the definition of this step: duration, etc.)
	// - `stepRun`: instance of this step (contains the execution of this step: start time, etc.)
	// - `template`: parent `template of step (contains the definition of the Template)
	// - `run`: run this step is part of (contains the instance of the Template)
	// The functions should return an array of participants.
	// If the functions returns null or undefined, the participants are not filtered.
	// If the function throws an exception, the run will fail.
	Js *string `json:"js"`
	// Filter should be the name of pre-defined filtering function.
	Filter *string `json:"filter"`
	// Condition set the participant must meet to be allowed to participate.
	Condition *ConditionInput `json:"condition"`
}

FilterStepArgs are arguments passed to a Pariticipant Filter Step. It must contains **either** JS code or the name of pre-defined filtering function. This is only valid for an PARTICIPANT_FILTER Step.

type HITStepArgs

type HITStepArgs struct {
	// Title of HIT.
	// From MTurk: Describe the task to Workers. Be as specific as possible,
	// e.g. "answer a survey about movies", instead of "short survey", so Workers
	// know what to expect.
	// Tasks that contain adult content are required to include the following phrase
	// in your task title: (WARNING: This HIT may contain adult content. Worker
	// discretion is advised.)
	Title string `json:"title"`
	// Description of HIT.
	// From MTurk: Give more detail about this task. This gives Workers a bit more
	// information before they decide to view your task.
	Description string `json:"description"`
	// Keywords of HIT. Comma-seratred.
	// From MTurk: Provide keywords that will help Workers search for your tasks.
	Keywords string `json:"keywords"`
	// DISABLED - Micro-batching is still TBD, probably needs more args.
	Microbatch bool `json:"microbatch"`
	// MTurk HIT reward for task in USD.
	Reward float64 `json:"reward"`
	// Timeout of a single accepted HIT in seconds.
	Timeout int `json:"timeout"`
	// Duration in seconds from start of Step before expiration of unconsumed HITs.
	Duration int `json:"duration"`
	// Number of HIT workers to accept.
	// Note: is this needed? The count is determined by the selection in the first
	// Step, then by the number of participants remaining at each Step.
	WorkersCount int `json:"workersCount"`
}

HITStepArgs are arguments passed to a HIT Step. This is only valid for an MTURK_HIT Step.

func HITStepArgsFromInput

func HITStepArgsFromInput(criti *HITStepArgsInput) *HITStepArgs

type HITStepArgsInput

type HITStepArgsInput struct {
	// Title of HIT.
	// From MTurk: Describe the task to Workers. Be as specific as possible,
	// e.g. "answer a survey about movies", instead of "short survey", so Workers
	// know what to expect.
	// Tasks that contain adult content are required to include the following phrase
	// in your task title: (WARNING: This HIT may contain adult content. Worker
	// discretion is advised.)
	Title *string `json:"title"`
	// Description of HIT.
	// From MTurk: Give more detail about this task. This gives Workers a bit more
	// information before they decide to view your task.
	Description *string `json:"description"`
	// Keywords of HIT. Comma-seratred.
	// From MTurk: Provide keywords that will help Workers search for your tasks.
	Keywords *string `json:"keywords"`
	// DISABLED - Micro-batching is still TBD, probably needs more args.
	Microbatch *bool `json:"microbatch"`
	// MTurk HIT reward for task in USD.
	Reward *float64 `json:"reward"`
	// Timeout of a single accepted HIT in seconds.
	Timeout *int `json:"timeout"`
	// Duration in seconds from start of Step before expiration of unconsumed HITs.
	Duration int `json:"duration"`
	// Number of HIT workers to accept.
	// Note: is this needed? The count is determined by the selection in the first
	// Step, then by the number of participants remaining at each Step.
	WorkersCount *int `json:"workersCount"`
}

HITStepArgs are arguments passed to a HIT Step. This is only valid for an MTURK_HIT Step.

type ImportedParticipant

type ImportedParticipant struct {
	ID            string             `json:"id"`
	CreatedAt     time.Time          `json:"createdAt"`
	MturkWorkerID string             `json:"mturkWorkerID"`
	Data          []*ParticipantData `json:"data"`
}

type InternalCriteria

type InternalCriteria struct {
	// All means use all participants and ignore the condition field below.
	All bool `json:"all"`
	// Condition set the participant must meet to be allowed to participate.
	Condition *Condition `json:"condition"`
}

InternalCriteria is the criteria for internal database participant selection.

func InternalCriteriaFromInput

func InternalCriteriaFromInput(criti *InternalCriteriaInput) *InternalCriteria

type InternalCriteriaInput

type InternalCriteriaInput struct {
	// All means use all participants and ignore the condition field below.
	All bool `json:"all"`
	// Condition set the participant must meet to be allowed to participate.
	Condition *ConditionInput `json:"condition"`
}

InternalCriteria is the criteria for internal database participant selection.

type MTurkCriteria

type MTurkCriteria struct {
	// MTurk Qualifications a Worker must meet before the Worker is allowed to accept
	// and complete the HIT.
	Qualifications []*MTurkQualificationCriteria `json:"qualifications"`
}

MTurkCriteria is the criteria for MTurk Qualifications participant selection.

func MturkCriteriaFromInput

func MturkCriteriaFromInput(criti *MTurkCriteriaInput) *MTurkCriteria

type MTurkCriteriaInput

type MTurkCriteriaInput struct {
	// MTurk Qualifications a Worker must meet before the Worker is allowed to accept
	// and complete the HIT.
	Qualifications []*MTurkQualificationCriteriaInput `json:"qualifications"`
}

MTurkCriteria is the criteria for MTurk Qualifications participant selection.

type MTurkLocale

type MTurkLocale struct {
	// The country of the locale.
	// Type: A valid ISO 3166 country code. For example, the code US refers to the
	// United States of America.
	Country string `json:"country"`
	// The state or subdivision of the locale.
	// Type: Type: A valid ISO 3166-2 subdivision code. For example, the code CA
	// refers to the state of California.
	// Subdivisions or states are only available for the United States of America.
	Subdivision *string `json:"subdivision"`
}

The Locale data structure represents a geographical region or location in MTurk.

type MTurkLocaleInput

type MTurkLocaleInput struct {
	// The country of the locale.
	// Type: A valid ISO 3166 country code. For example, the code US refers to the
	// United States of America.
	Country string `json:"country"`
	// The state or subdivision of the locale.
	// Type: Type: A valid ISO 3166-2 subdivision code. For example, the code CA
	// refers to the state of California.
	// Subdivisions or states are only available for the United States of America.
	Subdivision *string `json:"subdivision"`
}

The Locale data structure represents a geographical region or location in MTurk.

type MTurkQualificationCriteria

type MTurkQualificationCriteria struct {
	// The ID of the MTurk Qualification Type.
	ID string `json:"id"`
	// The kind of comparison to make against a Qualification's value.
	// You can compare a Qualification's value:
	// - To an IntegerValue to see if it is LessThan, LessThanOrEqualTo, GreaterThan,
	//   GreaterThanOrEqualTo, EqualTo, or NotEqualTo the IntegerValue.
	// - To a LocaleValue to see if it is EqualTo, or NotEqualTo the LocaleValue.
	// - To see if the value is In or NotIn a set of IntegerValue or LocaleValue
	//   values.
	// A Qualification requirement can also test if a Qualification Exists or
	// DoesNotExist in the user's profile, regardless of its value.
	Comparator Comparator `json:"comparator"`
	// Array of integer values to compare against the Qualification's value.
	// IntegerValue must not be present if Comparator is Exists or DoesNotExist.
	// IntegerValue can only be used if the Qualification type has an integer value;
	// it cannot be used with the Worker_Locale QualificationType ID, see
	// Qualification Type IDs.
	// When performing a set comparison by using the In or the NotIn comparator, you
	// can use up to 15 elements in this list.
	Values []int `json:"values"`
	// The locale value to compare against the Qualification's value. The local value
	// must be a valid ISO 3166 country code or supports ISO 3166-2 subdivisions.
	// LocaleValue can only be used with a Worker_Locale QualificationType ID, see
	// Qualification Type IDs.
	// LocaleValue can only be used with the EqualTo, NotEqualTo, In, and NotIn
	// comparators.
	// You must only use a single LocaleValue element when using the EqualTo or
	// NotEqualTo comparators.
	// When performing a set comparison by using the In or the NotIn comparator, you
	// can use up to 30 LocaleValue elements in a QualificationRequirement data
	// structure.
	Locales []*MTurkLocale `json:"locales"`
}

MTurkQualificationCriteria is an MTurk Qualification requirement. It is an MTurk Qualification that a Worker must have before the Worker is allowed to accept a HIT. See https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_QualificationRequirementDataStructureArticle.html

type MTurkQualificationCriteriaInput

type MTurkQualificationCriteriaInput struct {
	// The ID of the MTurk Qualification Type.
	ID string `json:"id"`
	// The kind of comparison to make against a Qualification's value.
	// You can compare a Qualification's value:
	// - To an IntegerValue to see if it is LessThan, LessThanOrEqualTo, GreaterThan,
	//   GreaterThanOrEqualTo, EqualTo, or NotEqualTo the IntegerValue.
	// - To a LocaleValue to see if it is EqualTo, or NotEqualTo the LocaleValue.
	// - To see if the value is In or NotIn a set of IntegerValue or LocaleValue
	//   values.
	// A Qualification requirement can also test if a Qualification Exists or
	// DoesNotExist in the user's profile, regardless of its value.
	Comparator *Comparator `json:"comparator"`
	// Array of integer values to compare against the Qualification's value.
	// IntegerValue must not be present if Comparator is Exists or DoesNotExist.
	// IntegerValue can only be used if the Qualification type has an integer value;
	// it cannot be used with the Worker_Locale QualificationType ID, see
	// Qualification Type IDs.
	// When performing a set comparison by using the In or the NotIn comparator, you
	// can use up to 15 elements in this list.
	Values []int `json:"values"`
	// The locale value to compare against the Qualification's value. The local value
	// must be a valid ISO 3166 country code or supports ISO 3166-2 subdivisions.
	// LocaleValue can only be used with a Worker_Locale QualificationType ID, see
	// Qualification Type IDs.
	// LocaleValue can only be used with the EqualTo, NotEqualTo, In, and NotIn
	// comparators.
	// You must only use a single LocaleValue element when using the EqualTo or
	// NotEqualTo comparators.
	// When performing a set comparison by using the In or the NotIn comparator, you
	// can use up to 30 LocaleValue elements in a QualificationRequirement data
	// structure.
	Locales []*MTurkLocaleInput `json:"locales"`
}

MTurkQualificationCriteria is an MTurk Qualification requirement. It is an MTurk Qualification that a Worker must have before the Worker is allowed to accept a HIT. See https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_QualificationRequirementDataStructureArticle.html

type MTurkQulificationType

type MTurkQulificationType struct {
	// A unique identifier for the Qualification type. A Qualification type is given a Qualification type ID when you call
	// the CreateQualificationType operation operation, and it retains that ID forever. Can be up to 255 bytes in length.
	ID string `json:"id"`
	// The name of the Qualification type. The type name is used to identify the type, and to find the type using a Qualification type search.
	Name string `json:"name"`
	// A long description for the Qualification type.
	Description string `json:"description"`
	// A type that is used to define the comparator.
	Type QualType `json:"type"`
}

The QualificationType data structure represents a Qualification type, a description of a property of a Worker that must match the requirements of a HIT for the Worker to be able to accept the HIT. The type also describes how a Worker can obtain a Qualification of that type, such as through a Qualification test. See https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_QualificationTypeDataStructureArticle.html

type MessageStepArgs

type MessageStepArgs struct {
	// The subject line of the email message to send.
	Subject *string `json:"subject"`
	// URL that will be transformed into a redirect (proxy URL) through the Empirica
	// Recruitment website and passed to the Message template. This URL is the final
	// destination the worker will land on. Empirica Recruitment redirects
	// through the app so we can add parameters to the proxy URL and hide the final
	// URL (to limit sharing of URLs).
	URL *string `json:"url"`
	// Message the content to display to the user.
	// Template variables:
	// - `url`: proxy URL if `url` exist on Step.
	// - `step`: this step (contains the definition of this step: duration, etc.)
	// - `stepRun`: instance of this step (contains the execution of this step: start time, etc.)
	// - `template`: parent Template of step (contains the definition of the Template)
	// - `run`: run this step is part of (contains the instance of the Template)
	// - `participant`: current participant
	Message string `json:"message"`
	// MessageType indicates the rendering language of the Message.
	MessageType ContentType `json:"messageType"`
	// Lobby enables to showing a lobby, and rich-text message to put in the lobby
	// Lobby can either expire (see expiration below) to produce the effect of a
	// precise start time, or must have a submit button.
	// Only available if URL is present.
	// Template variables are identical to message.
	Lobby *string `json:"lobby"`
	// LobbyType indicates the rendering language of the Lobby.
	LobbyType *ContentType `json:"lobbyType"`
	// LobbyExpirtation in seconds from the beginning of the step.
	LobbyExpiration *int `json:"lobbyExpiration"`
}

MessageStepArgs are arguments passed to a Step that has a message. This is only valid for MTURK_HIT and MTURK_MESSAGE Steps.

func MsgArgsFromInput

func MsgArgsFromInput(criti *MessageStepArgsInput) *MessageStepArgs

type MessageStepArgsInput

type MessageStepArgsInput struct {
	// The subject line of the email message to send.
	Subject *string `json:"subject"`
	// URL that will be transformed into a redirect (proxy URL) through the Empirica
	// Recruitment website and passed to the Message template. This URL is the final
	// destination the worker will land on. Empirica Recruitment redirects
	// through the app so we can add parameters to the proxy URL and hide the final
	// URL (to limit sharing of URLs).
	URL *string `json:"url"`
	// Message the content to display to the user.
	// Template variables:
	// - `url`: proxy URL if `url` exist on Step.
	// - `step`: this step (contains the definition of this step: duration, etc.)
	// - `stepRun`: instance of this step (contains the execution of this step: start time, etc.)
	// - “template`: parent Template of step (contains the definition of the Template)
	// - `run`: run this step is part of (contains the instance of the Template)
	// - `participant`: current participant
	Message *string `json:"message"`
	// MessageType indicates the rendering language of the Message.
	MessageType *ContentType `json:"messageType"`
	// Lobby enables to showing a lobby, and rich-text message to put in the lobby
	// Lobby can either expire (see expiration below) to produce the effect of a
	// precise start time, or must have a submit button.
	// Only available if URL is present.
	// Template variables are identical to message.
	Lobby *string `json:"lobby"`
	// LobbyType indicates the rendering language of the Lobby.
	LobbyType *ContentType `json:"lobbyType"`
	// LobbyExpirtation in seconds from the beginning of the step.
	LobbyExpiration *int `json:"lobbyExpiration"`
}

MessageStepArgs are arguments passed to a Step that has a message. This is only valid for MTURK_HIT and MTURK_MESSAGE Steps.

type Page

type Page struct {
	// Redirect is URL. If present, the page should just redirect to the given URL.
	// No other field should be present if the redirect is non-null.
	Redirect *string `json:"redirect"`
	// Props to be passed to the Content (if the Content is dynamic).
	Props map[string]interface{} `json:"props"`
	// The content to display to the Participant.
	Content *string `json:"content"`
	// The rendered for the content to display.
	ContentType ContentType `json:"contentType"`
}

Page returns everything needed to display a page to Participants or redirect them, depending on the Step, whether it's a message, or a lobby, and the token used to acquire the page.

type ParticipantData

type ParticipantData struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

type ParticipantFilterType

type ParticipantFilterType string

ParticipantFilterType is the type of user filtering to use.

const (
	// Predefined Filter is a server side defined filter.
	ParticipantFilterTypePredefinedFilter ParticipantFilterType = "PREDEFINED_FILTER"
	// JS is a piece of JAvascript code doing the filtering.
	ParticipantFilterTypeJs ParticipantFilterType = "JS"
	// CONDITION uses the Condition object to do the filtering.
	ParticipantFilterTypeCondition ParticipantFilterType = "CONDITION"
)

func (ParticipantFilterType) IsValid

func (e ParticipantFilterType) IsValid() bool

func (ParticipantFilterType) MarshalGQL

func (e ParticipantFilterType) MarshalGQL(w io.Writer)

func (ParticipantFilterType) String

func (e ParticipantFilterType) String() string

func (*ParticipantFilterType) UnmarshalGQL

func (e *ParticipantFilterType) UnmarshalGQL(v interface{}) error

type Provider

type Provider string

Supported 3rd party providers.

const (
	// MTURK represents AWS Mechanical Turk
	ProviderMturk Provider = "MTURK"
)

func (Provider) IsValid

func (e Provider) IsValid() bool

func (Provider) MarshalGQL

func (e Provider) MarshalGQL(w io.Writer)

func (Provider) String

func (e Provider) String() string

func (*Provider) UnmarshalGQL

func (e *Provider) UnmarshalGQL(v interface{}) error

type QualType

type QualType string

The kind of type used on MTurkQualificationType that later we be used to decide the comparator.

const (
	QualTypeBool       QualType = "BOOL"
	QualTypeComparison QualType = "COMPARISON"
	QualTypeLocation   QualType = "LOCATION"
	QualTypeCustom     QualType = "CUSTOM"
)

func (QualType) IsValid

func (e QualType) IsValid() bool

func (QualType) MarshalGQL

func (e QualType) MarshalGQL(w io.Writer)

func (QualType) String

func (e QualType) String() string

func (*QualType) UnmarshalGQL

func (e *QualType) UnmarshalGQL(v interface{}) error

type Role

type Role string
const (
	RoleAdmin       Role = "ADMIN"
	RoleParticipant Role = "PARTICIPANT"
)

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

func (e Role) MarshalGQL(w io.Writer)

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

func (e *Role) UnmarshalGQL(v interface{}) error

type ScheduleRunInput

type ScheduleRunInput struct {
	ID      string    `json:"ID"`
	StartAt time.Time `json:"startAt"`
}

type SelectionType

type SelectionType string

Participant selection type.

const (
	// INTERNAL_DB uses local participants database.
	SelectionTypeInternalDb SelectionType = "INTERNAL_DB"
	// MTURK_QUALIFICATIONS uses MTurk Qualitifications to select participants.
	SelectionTypeMturkQualifications SelectionType = "MTURK_QUALIFICATIONS"
)

func (SelectionType) IsValid

func (e SelectionType) IsValid() bool

func (SelectionType) MarshalGQL

func (e SelectionType) MarshalGQL(w io.Writer)

func (SelectionType) String

func (e SelectionType) String() string

func (*SelectionType) UnmarshalGQL

func (e *SelectionType) UnmarshalGQL(v interface{}) error

type StartRunInput

type StartRunInput struct {
	ID string `json:"ID"`
}

type Status

type Status string

Status of Runs.

const (
	// CREATED means the run has been created but hasn't started yet
	StatusCreated Status = "CREATED"
	// RUNNING means the run is currently in progress
	StatusRunning Status = "RUNNING"
	// PAUSED means the run has been paused by an admin
	StatusPaused Status = "PAUSED"
	// DONE means the run has finished `naturally`
	StatusDone Status = "DONE"
	// TERMINATED means the run has been manually cancelled
	StatusTerminated Status = "TERMINATED"
	// FAILED means the run has failed (due to an unrecoverable error)
	StatusFailed Status = "FAILED"
)

func (Status) IsValid

func (e Status) IsValid() bool

func (Status) MarshalGQL

func (e Status) MarshalGQL(w io.Writer)

func (Status) String

func (e Status) String() string

func (*Status) UnmarshalGQL

func (e *Status) UnmarshalGQL(v interface{}) error

type StepInput

type StepInput struct {
	// ID of the step to update, if updating
	ID *string `json:"id"`
	// Index is the position of the step in the Template.
	Index int `json:"index"`
	// The Type defines what kind of action this step represents.
	Type StepType `json:"type"`
	// Duration of Step in seconds. At the end of the duration, the next Step will
	// execute.
	// If set to 0, the Step executes and immediately moves onto the next Step. This
	// mostly works for PARTICIPANT_FILTER Steps and the last Step in a Template.
	Duration int `json:"duration"`
	// Arguments for Message type Step.
	MsgArgs *MessageStepArgsInput `json:"msgArgs"`
	// Arguments for HIT type Step.
	HitArgs *HITStepArgsInput `json:"hitArgs"`
	// Arguments for Filter type Step.
	FilterArgs *FilterStepArgsInput `json:"filterArgs"`
}

type StepType

type StepType string

Type of a Step.

const (
	// MTURK_HIT is a step where AWS Mechanical Turk HIT is published.
	StepTypeMturkHit StepType = "MTURK_HIT"
	// MTURK_MESSAGE is a step where a message sent to AWS Mechanical Turk Workers.
	StepTypeMturkMessage StepType = "MTURK_MESSAGE"
	// PARTICIPANT_FILTER is a participant filtering step.
	StepTypeParticipantFilter StepType = "PARTICIPANT_FILTER"
	// WAIT is a step that has duration before executing the next step.
	StepTypeWait StepType = "WAIT"
)

func (StepType) IsValid

func (e StepType) IsValid() bool

func (StepType) MarshalGQL

func (e StepType) MarshalGQL(w io.Writer)

func (StepType) String

func (e StepType) String() string

func (*StepType) UnmarshalGQL

func (e *StepType) UnmarshalGQL(v interface{}) error

type TemplateInput

type TemplateInput struct {
	// ID of Template to update, if updating
	ID *string `json:"id"`
	// Friendly name.
	Name string `json:"name"`
	// Ordered list of Steps for Template.
	Steps []*StepInput `json:"steps"`
	// Determines participant selection type.
	SelectionType SelectionType `json:"selectionType"`
	// Internal Selection criteria for participants
	InternalCriteria *InternalCriteriaInput `json:"internalCriteria"`
	// Mturk Selection criteria for participants
	MturkCriteria *MTurkCriteriaInput `json:"mturkCriteria"`
	// Number of participants desired.
	ParticipantCount int `json:"participantCount"`
	// Contains adult content.
	// From MTurk: This project may contain potentially explicit or offensive
	// content, for example, nudity.
	Adult bool `json:"adult"`
	// Use MTurk Sandbox.
	Sandbox bool `json:"sandbox"`
}

type UnscheduleRunInput

type UnscheduleRunInput struct {
	ID string `json:"ID"`
}

type UpdateDatumInput

type UpdateDatumInput struct {
	// key identifies the unique key of the Datum.
	Key string `json:"key"`
	// val is the value of the Datum. It can be any JSON encodable value.
	Val string `json:"val"`
	// If isAppend is true, the new datum is appended to the existin data for key.
	// If not provided, it is assumed to be false.
	IsAppend *bool `json:"isAppend"`
	// Type of object on which to update the value. Defaults to PARTICIPANT
	NodeType *DatumNodeType `json:"nodeType"`
	// ID of object on which to update the value.
	NodeID string `json:"nodeID"`
}

UpdateDatumInput sets or appends Data on a Node.

type UpdateRunInput

type UpdateRunInput struct {
	ID   string `json:"ID"`
	Name string `json:"name"`
}

type UpdateTemplateInput

type UpdateTemplateInput struct {
	RunID    string         `json:"runID"`
	Template *TemplateInput `json:"template"`
}

type User

type User interface {
	IsUser()
}

User is either an Admin or a Participant.

Jump to

Keyboard shortcuts

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