Documentation ¶
Index ¶
- type API
- type Client
- func (c *Client) CreateProject(workspaceID string, project model.Project) (*CreateProjectResponse, error)
- func (c *Client) CreateStudy(study model.CreateStudy) (*model.Study, error)
- func (c *Client) CreateWorkspace(workspace model.Workspace) (*CreateWorkspacesResponse, error)
- func (c *Client) DuplicateStudy(ID string) (*model.Study, error)
- func (c *Client) Execute(method, url string, body interface{}, response interface{}) (*http.Response, error)
- func (c *Client) GetEligibilityRequirements() (*ListRequirementsResponse, error)
- func (c *Client) GetEvents(subscriptionID string) (*ListHookEventsResponse, error)
- func (c *Client) GetHookEventTypes() (*ListHookEventTypesResponse, error)
- func (c *Client) GetHookSecrets(workspaceID string) (*ListSecretsResponse, error)
- func (c *Client) GetHooks(enabled bool) (*ListHooksResponse, error)
- func (c *Client) GetMe() (*MeResponse, error)
- func (c *Client) GetParticipantGroup(groupID string) (*ViewParticipantGroupResponse, error)
- func (c *Client) GetParticipantGroups(projectID string) (*ListParticipantGroupsResponse, error)
- func (c *Client) GetProjects(workspaceID string) (*ListProjectsResponse, error)
- func (c *Client) GetStudies(status, projectID string) (*ListStudiesResponse, error)
- func (c *Client) GetStudy(ID string) (*model.Study, error)
- func (c *Client) GetSubmissions(ID string) (*ListSubmissionsResponse, error)
- func (c *Client) GetWorkspaces() (*ListWorkspacesResponse, error)
- func (c *Client) TransitionStudy(ID, action string) (*TransitionStudyResponse, error)
- type CreateProjectResponse
- type CreateWorkspacesResponse
- type JSONAPILinks
- type JSONAPIMeta
- type ListHookEventTypesResponse
- type ListHookEventsResponse
- type ListHooksResponse
- type ListParticipantGroupsResponse
- type ListProjectsResponse
- type ListRequirementsResponse
- type ListSecretsResponse
- type ListStudiesResponse
- type ListSubmissionsResponse
- type ListWorkspacesResponse
- type MeResponse
- type TransitionStudyResponse
- type ViewParticipantGroupResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetMe() (*MeResponse, error) CreateStudy(model.CreateStudy) (*model.Study, error) DuplicateStudy(ID string) (*model.Study, error) GetEligibilityRequirements() (*ListRequirementsResponse, error) GetStudies(status, projectID string) (*ListStudiesResponse, error) GetStudy(ID string) (*model.Study, error) GetSubmissions(ID string) (*ListSubmissionsResponse, error) TransitionStudy(ID, action string) (*TransitionStudyResponse, error) GetHooks(enabled bool) (*ListHooksResponse, error) GetHookEventTypes() (*ListHookEventTypesResponse, error) GetHookSecrets(workspaceID string) (*ListSecretsResponse, error) GetEvents(subscriptionID string) (*ListHookEventsResponse, error) GetWorkspaces() (*ListWorkspacesResponse, error) CreateWorkspace(workspace model.Workspace) (*CreateWorkspacesResponse, error) GetProjects(workspaceID string) (*ListProjectsResponse, error) CreateProject(workspaceID string, project model.Project) (*CreateProjectResponse, error) GetParticipantGroups(projectID string) (*ListParticipantGroupsResponse, error) GetParticipantGroup(groupID string) (*ViewParticipantGroupResponse, error) }
API represents what is allowed to be called on the Prolific client.
type Client ¶
Client is responsible for interacting with the Prolific API.
func (*Client) CreateProject ¶ added in v0.0.13
func (c *Client) CreateProject(workspaceID string, project model.Project) (*CreateProjectResponse, error)
CreateProject will create you a project
func (*Client) CreateStudy ¶ added in v0.0.2
CreateStudy is responsible for hitting the Prolific API to create a study.
func (*Client) CreateWorkspace ¶ added in v0.0.13
func (c *Client) CreateWorkspace(workspace model.Workspace) (*CreateWorkspacesResponse, error)
CreateWorkspace will create you a workspace
func (*Client) DuplicateStudy ¶ added in v0.0.15
DuplicateStudy will duplicate an existing study.
func (*Client) Execute ¶ added in v0.0.2
func (c *Client) Execute(method, url string, body interface{}, response interface{}) (*http.Response, error)
Execute runs an HTTP request.
func (*Client) GetEligibilityRequirements ¶ added in v0.0.2
func (c *Client) GetEligibilityRequirements() (*ListRequirementsResponse, error)
GetEligibilityRequirements will return requirement data.
func (*Client) GetEvents ¶ added in v0.0.17
func (c *Client) GetEvents(subscriptionID string) (*ListHookEventsResponse, error)
GetEvents will return events created for a subscription
func (*Client) GetHookEventTypes ¶ added in v0.0.11
func (c *Client) GetHookEventTypes() (*ListHookEventTypesResponse, error)
GetHookEventTypes will return all of the event types you can subscribe a hook for.
func (*Client) GetHookSecrets ¶ added in v0.0.13
func (c *Client) GetHookSecrets(workspaceID string) (*ListSecretsResponse, error)
GetHookSecrets will return the secrets for a Workspace
func (*Client) GetHooks ¶ added in v0.0.10
func (c *Client) GetHooks(enabled bool) (*ListHooksResponse, error)
GetHooks will return the subscriptions to event types for current user.
func (*Client) GetMe ¶
func (c *Client) GetMe() (*MeResponse, error)
GetMe will return your user account details.
func (*Client) GetParticipantGroup ¶ added in v0.0.18
func (c *Client) GetParticipantGroup(groupID string) (*ViewParticipantGroupResponse, error)
GetParticipantGroup will return the membership in the group
func (*Client) GetParticipantGroups ¶ added in v0.0.18
func (c *Client) GetParticipantGroups(projectID string) (*ListParticipantGroupsResponse, error)
GetParticipantGroups will return all the participant groups you have access to for a given ProjectID
func (*Client) GetProjects ¶ added in v0.0.12
func (c *Client) GetProjects(workspaceID string) (*ListProjectsResponse, error)
GetProjects will return the projects for the given workspace ID
func (*Client) GetStudies ¶
func (c *Client) GetStudies(status, projectID string) (*ListStudiesResponse, error)
GetStudies will return you a list of Study objects.
func (*Client) GetSubmissions ¶
func (c *Client) GetSubmissions(ID string) (*ListSubmissionsResponse, error)
GetSubmissions will return submission data for a given study.
func (*Client) GetWorkspaces ¶ added in v0.0.12
func (c *Client) GetWorkspaces() (*ListWorkspacesResponse, error)
GetWorkspaces will return you the workspaces you can see
func (*Client) TransitionStudy ¶ added in v0.0.3
func (c *Client) TransitionStudy(ID, action string) (*TransitionStudyResponse, error)
TransitionStudy will move the study status to a desired state.
type CreateProjectResponse ¶ added in v0.0.13
CreateProjectResponse is the response for creating a project.
type CreateWorkspacesResponse ¶ added in v0.0.13
CreateWorkspacesResponse is the response for creating a workspace.
type JSONAPILinks ¶ added in v0.0.13
type JSONAPILinks struct { Links struct { Self struct { Href string `json:"href"` Title string `json:"title"` } `json:"self"` Next struct { Href interface{} `json:"href"` Title string `json:"title"` } `json:"next"` Previous struct { Href interface{} `json:"href"` Title string `json:"title"` } `json:"previous"` Last struct { Href string `json:"href"` Title string `json:"title"` } `json:"last"` } `json:"_links"` }
JSONAPILinks is the standard pagination data structure.
type JSONAPIMeta ¶ added in v0.0.13
type JSONAPIMeta struct { Meta struct { Count int `json:"count"` } `json:"meta"` }
JSONAPIMeta is the standard meta data structure.
type ListHookEventTypesResponse ¶ added in v0.0.11
type ListHookEventTypesResponse struct {
Results []model.HookEventType `json:"results"`
}
ListHookEventTypesResponse is the response for the event types hook API.
type ListHookEventsResponse ¶ added in v0.0.17
ListHookEventsResponse is the response for the hook events API.
type ListHooksResponse ¶ added in v0.0.10
ListHooksResponse is the response for the hook subscriptions.
type ListParticipantGroupsResponse ¶ added in v0.0.18
type ListParticipantGroupsResponse struct {
Results []model.ParticipantGroup `json:"results"`
}
ListParticipantGroupsResponse is the list of participant groups response.
type ListProjectsResponse ¶ added in v0.0.12
ListProjectsResponse is the response for the list projects endpoint.
type ListRequirementsResponse ¶ added in v0.0.2
type ListRequirementsResponse struct { Results []model.Requirement `json:"results"` *JSONAPILinks *JSONAPIMeta }
ListRequirementsResponse is the response for the requirements request.
type ListSecretsResponse ¶ added in v0.0.13
ListSecretsResponse is the list secrets response.
type ListStudiesResponse ¶
type ListStudiesResponse struct { Results []model.Study `json:"results"` *JSONAPILinks *JSONAPIMeta }
ListStudiesResponse is the response for the /studies API response.
type ListSubmissionsResponse ¶
type ListSubmissionsResponse struct { Results []model.Submission `json:"results"` *JSONAPILinks *JSONAPIMeta }
ListSubmissionsResponse is the response for the submissions request.
type ListWorkspacesResponse ¶ added in v0.0.12
ListWorkspacesResponse is the response for the list workspaces endpoint.
type MeResponse ¶ added in v0.0.13
type MeResponse struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Name string `json:"name"` Username string `json:"username"` UserType string `json:"user_type"` CurrencyCode string `json:"currency_code"` Balance int `json:"balance"` AvailableBalance int `json:"available_balance"` }
MeResponse is a struct that represents your account.
type TransitionStudyResponse ¶ added in v0.0.3
type TransitionStudyResponse struct { ID string `json:"id"` Name string `json:"name"` InternalName string `json:"internal_name"` Description string `json:"description"` ExternalStudyURL string `json:"external_study_url"` ProlificIDOption string `json:"prolific_id_option"` CompletionCode string `json:"completion_code"` CompletionOption string `json:"completion_option"` TotalAvailablePlaces int `json:"total_available_places"` EstimatedCompletionTime int `json:"estimated_completion_time"` MaximumAllowedTime int `json:"maximum_allowed_time"` Reward int `json:"reward"` DeviceCompatibility []string `json:"device_compatibility"` PeripheralRequirements []interface{} `json:"peripheral_requirements"` EligibilityRequirements []interface{} `json:"eligibility_requirements"` Status string `json:"status"` }
TransitionStudyResponse is the response for transitioning a study to another status.
type ViewParticipantGroupResponse ¶ added in v0.0.18
type ViewParticipantGroupResponse struct {
Results []model.ParticipantGroupMembership `json:"results"`
}
ViewParticipantGroupResponse is the list of members in a group.