Documentation ¶
Index ¶
- Constants
- Variables
- func AppendURLScheme(baseURL string) string
- func IsCountryCodeOrEmpty(countryCode string) error
- func IsLanguageCodeOrEmpty(languageCode string) error
- func RemoveWhiteSpace(obj struct{})
- func Validate(obj interface{}) error
- func ValidateAction(action Action) error
- func ValidateDeviceType(val DeviceType) error
- func ValidateEmail(email ...string) error
- func ValidateExclusionType(val ExclusionType) error
- func ValidateLanguageISOCode(val string) error
- func ValidateNotEmpty(values ...string) error
- func ValidateNotNull(obj interface{}) error
- func ValidateQuotaPlan(val *QuotaPlan) error
- func ValidateSchedule(daysInField *int64, fieldSchedule *Schedule) error
- func ValidateStruct(obj interface{}) error
- func ValidateSurveyLink(baseURL string) error
- func ValidateSurveyURL(val string) error
- type APIResponse
- type Action
- type Allocation
- type AllowedAction
- type AppError
- type Application
- type AttrCategory
- type Attribute
- type AttributeCategory
- type AttributeOption
- type AttributeState
- type Author
- type Billing
- type BillingType
- type BuyProjectCriteria
- type BuyProjectLineItem
- type BuyProjectResponse
- type Category
- type CategoryMetadata
- type CheckOrderNumber
- type CheckOrderNumberResponse
- type Client
- func (c *Client) AcceptEvent(event *Event) error
- func (c *Client) AcceptEventWithContext(ctx context.Context, event *Event) error
- func (c *Client) AddLineItem(extProjectID string, lineItem *CreateLineItemCriteria) (*LineItemResponse, error)
- func (c *Client) AddLineItemWithContext(ctx context.Context, extProjectID string, lineItem *CreateLineItemCriteria) (*LineItemResponse, error)
- func (c *Client) BuyProject(extProjectID string, buy []*BuyProjectCriteria) (*BuyProjectResponse, error)
- func (c *Client) BuyProjectWithContext(ctx context.Context, extProjectID string, buy []*BuyProjectCriteria) (*BuyProjectResponse, error)
- func (c *Client) CheckOrderNumber(ordNumber string) (bool, error)
- func (c *Client) CheckOrderNumberWithContext(ctx context.Context, ordNumber string) (bool, error)
- func (c *Client) CloseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) CloseLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) CloseProject(extProjectID string) (*CloseProjectResponse, error)
- func (c *Client) CloseProjectWithContext(ctx context.Context, extProjectID string) (*CloseProjectResponse, error)
- func (c *Client) CompanyUsers() (*CompanyUsersResponse, error)
- func (c *Client) CompanyUsersWithContext(ctx context.Context) (*CompanyUsersResponse, error)
- func (c *Client) CreateProject(project *CreateProjectCriteria) (*ProjectResponse, error)
- func (c *Client) CreateProjectWithContext(ctx context.Context, project *CreateProjectCriteria) (*ProjectResponse, error)
- func (c *Client) CreateTemplate(template *TemplateCriteria) (*TemplateResponse, error)
- func (c *Client) CreateTemplateWithContext(ctx context.Context, template *TemplateCriteria) (*TemplateResponse, error)
- func (c *Client) DeleteTemplate(id int) (*AppError, error)
- func (c *Client) DeleteTemplateWithContext(ctx context.Context, id int) (*AppError, error)
- func (c *Client) GetAllLineItems(extProjectID string, options *QueryOptions) (*GetAllLineItemsResponse, error)
- func (c *Client) GetAllLineItemsWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*GetAllLineItemsResponse, error)
- func (c *Client) GetAllProjects(options *QueryOptions) (*GetAllProjectsResponse, error)
- func (c *Client) GetAllProjectsWithContext(ctx context.Context, options *QueryOptions) (*GetAllProjectsResponse, error)
- func (c *Client) GetAttributes(countryCode, languageCode string, options *QueryOptions) (*GetAttributesResponse, error)
- func (c *Client) GetAttributesWithContext(ctx context.Context, countryCode, languageCode string, options *QueryOptions) (*GetAttributesResponse, error)
- func (c *Client) GetAuth() (TokenResponse, error)
- func (c *Client) GetAuthWithContext(ctx context.Context) (TokenResponse, error)
- func (c *Client) GetCountries(options *QueryOptions) (*GetCountriesResponse, error)
- func (c *Client) GetCountriesWithContext(ctx context.Context, options *QueryOptions) (*GetCountriesResponse, error)
- func (c *Client) GetDetailedLineItemReport(extProjectID, extLineItemID string) (*DetailedLineItemReportResponse, error)
- func (c *Client) GetDetailedLineItemReportWithContext(ctx context.Context, extProjectID, extLineItemID string) (*DetailedLineItemReportResponse, error)
- func (c *Client) GetDetailedProjectReport(extProjectID string) (*DetailedProjectReportResponse, error)
- func (c *Client) GetDetailedProjectReportWithContext(ctx context.Context, extProjectID string) (*DetailedProjectReportResponse, error)
- func (c *Client) GetEventBy(eventID string) (*GetEventResponse, error)
- func (c *Client) GetEventByWithContext(ctx context.Context, eventID string) (*GetEventResponse, error)
- func (c *Client) GetEvents(options *QueryOptions) (*GetEventListResponse, error)
- func (c *Client) GetEventsWithContext(ctx context.Context, options *QueryOptions) (*GetEventListResponse, error)
- func (c *Client) GetFeasibility(extProjectID string, options *QueryOptions) (*GetFeasibilityResponse, error)
- func (c *Client) GetFeasibilityWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*GetFeasibilityResponse, error)
- func (c *Client) GetHealthyStatus() (*APIResponse, error)
- func (c *Client) GetHealthyStatusWithContext(ctx context.Context) (*APIResponse, error)
- func (c *Client) GetInvoice(extProjectID string, options *QueryOptions) (*APIResponse, error)
- func (c *Client) GetInvoiceWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*APIResponse, error)
- func (c *Client) GetInvoicesSummary(options *QueryOptions) (*APIResponse, error)
- func (c *Client) GetInvoicesSummaryWithContext(ctx context.Context, options *QueryOptions) (*APIResponse, error)
- func (c *Client) GetLineItemBy(extProjectID, extLineItemID string) (*LineItemResponse, error)
- func (c *Client) GetLineItemByWithContext(ctx context.Context, extProjectID, extLineItemID string) (*LineItemResponse, error)
- func (c *Client) GetOrderDetails(ordNumber string) (*OrderDetailResponse, error)
- func (c *Client) GetOrderDetailsWithContext(ctx context.Context, ordNumber string) (*OrderDetailResponse, error)
- func (c *Client) GetProjectBy(extProjectID string) (*ProjectResponse, error)
- func (c *Client) GetProjectByWithContext(ctx context.Context, extProjectID string) (*ProjectResponse, error)
- func (c *Client) GetProjectReport(extProjectID string) (*ProjectReportResponse, error)
- func (c *Client) GetProjectReportWithContext(ctx context.Context, extProjectID string) (*ProjectReportResponse, error)
- func (c *Client) GetSources(options *QueryOptions) (*GetSampleSourceResponse, error)
- func (c *Client) GetSourcesWithContext(ctx context.Context, options *QueryOptions) (*GetSampleSourceResponse, error)
- func (c *Client) GetStudyMetadata() (*StudyMetadataResponse, error)
- func (c *Client) GetStudyMetadataWithContext(ctx context.Context) (*StudyMetadataResponse, error)
- func (c *Client) GetSurveyTopics(options *QueryOptions) (*GetSurveyTopicsResponse, error)
- func (c *Client) GetSurveyTopicsWithContext(ctx context.Context, options *QueryOptions) (*GetSurveyTopicsResponse, error)
- func (c *Client) GetTemplateList(country string, lang string, options *QueryOptions) (*TemplatesResponse, error)
- func (c *Client) GetTemplateListWithContext(ctx context.Context, country string, lang string, options *QueryOptions) (*TemplatesResponse, error)
- func (c *Client) GetUserDetails() (*UserDetailsResponse, error)
- func (c *Client) GetUserDetailsWithContext(ctx context.Context) (*UserDetailsResponse, error)
- func (c *Client) GetUserInfo() (*UserResponse, error)
- func (c *Client) GetUserInfoWithContext(ctx context.Context) (*UserResponse, error)
- func (c *Client) LaunchLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) LaunchLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) Logout() error
- func (c *Client) LogoutWithContext(ctx context.Context) error
- func (c *Client) PauseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) PauseLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
- func (c *Client) ProjectPermissions(extProjectID string) (*ProjectPermissionsResponse, error)
- func (c *Client) ProjectPermissionsWithContext(ctx context.Context, extProjectID string) (*ProjectPermissionsResponse, error)
- func (c *Client) RefreshToken() error
- func (c *Client) RefreshTokenWithContext(ctx context.Context) error
- func (c *Client) RejectEvent(event *Event) error
- func (c *Client) RejectEventWithContext(ctx context.Context, event *Event) error
- func (c *Client) Roles(options *QueryOptions) (*RolesResponse, error)
- func (c *Client) RolesWithContext(ctx context.Context, options *QueryOptions) (*RolesResponse, error)
- func (c *Client) SetOptions(env string, timeout int) error
- func (c *Client) SetQuotaCellStatus(extProjectID, extLineItemID string, quotaCellID string, action Action) (*QuotaCellResponse, error)
- func (c *Client) SetQuotaCellStatusWithContext(ctx context.Context, extProjectID, extLineItemID string, quotaCellID string, ...) (*QuotaCellResponse, error)
- func (c *Client) SwitchCompany(criteria *SwitchCompanyCriteria) error
- func (c *Client) SwitchCompanyWithContext(ctx context.Context, criteria *SwitchCompanyCriteria) error
- func (c *Client) TeamsInfo() (*TeamsResponse, error)
- func (c *Client) TeamsInfoWithContext(ctx context.Context) (*TeamsResponse, error)
- func (c *Client) UpdateLineItem(extProjectID, extLineItemID string, lineItem *UpdateLineItemCriteria) (*LineItemResponse, error)
- func (c *Client) UpdateLineItemState(extProjectID, extLineItemID string, action Action) (*UpdateLineItemStateResponse, error)
- func (c *Client) UpdateLineItemStateWithContext(ctx context.Context, extProjectID, extLineItemID string, action Action) (*UpdateLineItemStateResponse, error)
- func (c *Client) UpdateLineItemWithContext(ctx context.Context, extProjectID, extLineItemID string, ...) (*LineItemResponse, error)
- func (c *Client) UpdateProject(project *UpdateProjectCriteria) (*ProjectResponse, error)
- func (c *Client) UpdateProjectWithContext(ctx context.Context, project *UpdateProjectCriteria) (*ProjectResponse, error)
- func (c *Client) UpdateTemplate(id int, template *TemplateCriteria) (*TemplateResponse, error)
- func (c *Client) UpdateTemplateWithContext(ctx context.Context, id int, template *TemplateCriteria) (*TemplateResponse, error)
- func (c *Client) UploadReconcile(extProjectID string, file multipart.File, fileName string, message string, ...) (*APIResponse, error)
- func (c *Client) UploadReconcileWithContext(ctx context.Context, extProjectID string, file multipart.File, fileName string, ...) (*APIResponse, error)
- func (c *Client) UpsertProjectPermissions(permissions *UpsertPermissionsCriteria) (*ProjectPermissionsResponse, error)
- func (c *Client) UpsertProjectPermissionsWithContext(ctx context.Context, permissions *UpsertPermissionsCriteria) (*ProjectPermissionsResponse, error)
- type ClientOptions
- type CloseProjectResponse
- type Company
- type CompanyTeam
- type CompanyUser
- type CompanyUsersResponse
- type Cost
- type CostType
- type Country
- type CreateLineItemCriteria
- type CreateProjectCriteria
- type CurrentUser
- type CustomTime
- type DateFilterValue
- type DetailedCost
- type DetailedLineItemReport
- type DetailedLineItemReportResponse
- type DetailedProjectReport
- type DetailedProjectReportResponse
- type DetailedQuotaCellReport
- type DetailedQuotaGroupReport
- type DetailedQuote
- type DetailedStats
- type DeviceType
- type EndLinks
- type Error
- type ErrorInfo
- type ErrorResponse
- type ErrorType
- type Event
- type EventActions
- type EventDetails
- type EventReason
- type EventResource
- type EventStatus
- type EventStatusValues
- type EventType
- type EventValues
- type ExclusionType
- type Exclusions
- type Feasibility
- type FeasibilityQuotaCell
- type FeasibilityStatus
- type Filter
- type FilterValue
- type GetAllLineItemsResponse
- type GetAllProjectsResponse
- type GetAttributesResponse
- type GetCountriesResponse
- type GetEventListResponse
- type GetEventResponse
- type GetFeasibilityResponse
- type GetSampleSourceResponse
- type GetSurveyTopicsResponse
- type IntSlice
- type Invoice
- type Language
- type LineItem
- type LineItemHeader
- type LineItemListItem
- type LineItemReport
- type LineItemResponse
- type LineItemSource
- type LineItemTarget
- type Links
- type Meta
- type MetadataItem
- type Model
- type Operator
- type OrderDetail
- type OrderDetailResponse
- type Project
- type ProjectHeader
- type ProjectPermissions
- type ProjectPermissionsResponse
- type ProjectReport
- type ProjectReportResponse
- type ProjectResponse
- type QCellStatusType
- type QueryField
- type QueryOptions
- type QuotaCell
- type QuotaCellResponse
- type QuotaFilters
- type QuotaGroup
- type QuotaNode
- type QuotaPlan
- type Quote
- type QuoteType
- type Reconcile
- type RelativeType
- type Resource
- type RespondentFilter
- type RespondentFilterSchedule
- type RespondentFilterType
- type RespondentScheduleType
- type RespondentStatus
- type ResponseStatus
- type Role
- type RolesResponse
- type SalesOrder
- type SalesOrderDetails
- type SampleSource
- type SampleSourceCategory
- type Schedule
- type Sort
- type SortDirection
- type Sources
- type State
- type Status
- type StatusType
- type StringSlice
- type StudyMetadata
- type StudyMetadataResponse
- type SurveyTopic
- type SwitchCompanyCriteria
- type TargetType
- type Team
- type TeamData
- type TeamPermission
- type TeamsResponse
- type TemplateCriteria
- type TemplateData
- type TemplateResponse
- type TemplatesResponse
- type TokenRequest
- type TokenResponse
- type URLParameter
- type UpdateLineItemCriteria
- type UpdateLineItemStateResponse
- type UpdateProjectCriteria
- type UpsertPermissionsCriteria
- type User
- type UserData
- type UserDetails
- type UserDetailsResponse
- type UserPermission
- type UserResponse
- type Value
- type ValueCount
Constants ¶
const ( ActionLaunched Action = "launch" ActionPaused Action = "pause" ActionClosed Action = "close" QCellStatusTypeLaunch QCellStatusType = "LAUNCHED" QCellStatusTypePause QCellStatusType = "PAUSED" )
Action values for changing LineItem state
const ( TimeLayout = "2006/01/02 15:04:05" // DateLayout ... DateLayout = "2006/01/02" )
const ( URLMaxLength = 2000 URLMinLength = 3 )
Constants ...
const (
// TierStandard is the constant defined for Standard Tier in Attribute
TierStandard = "Standard"
)
Variables ¶
var ( LocalClientOptions = &ClientOptions{ APIBaseURL: "http://localhost:8090/sample/v1", AuthURL: "http://localhost:8090/auth/v1", InternalURL: "http://localhost:8090/internal/v1", StatusURL: "http://localhost:8090/status", GatewayURL: "http://localhost:8090/status/gateway", } DevClientOptions = &ClientOptions{ APIBaseURL: "https://api.dev.pe.dynata.com/sample/v1", AuthURL: "https://api.dev.pe.dynata.com/auth/v1", InternalURL: "https://api.dev.pe.dynata.com/internal/v1", StatusURL: "https://api.dev.pe.dynata.com/status", GatewayURL: "https://api.dev.pe.dynata.com/status/gateway", } UATClientOptions = &ClientOptions{ APIBaseURL: "https://api.uat.pe.dynata.com/sample/v1", AuthURL: "https://api.uat.pe.dynata.com/auth/v1", InternalURL: "https://api.uat.pe.dynata.com/internal/v1", StatusURL: "https://api.uat.pe.dynata.com/status", GatewayURL: "https://api.uat.pe.dynata.com/status/gateway", } ProdClientOptions = &ClientOptions{ APIBaseURL: "https://api.researchnow.com/sample/v1", AuthURL: "https://api.researchnow.com/auth/v1", InternalURL: "https://api.researchnow.com/internal/v1", StatusURL: "https://api.researchnow.com/status", GatewayURL: "https://api.researchnow.com/status/gateway", } )
ClientOptions to use while creating a new Client
var ( // ErrInvalidRespondentFilterStartDate ... ErrInvalidRespondentFilterStartDate = errors.New("respondent filter start date cannot be empty") // ErrInvalidRespondentFilterEndDate ... ErrInvalidRespondentFilterEndDate = errors.New("respondent filter end date cannot be empty") // ErrInvalidRespondentFilterDateRanges ... ErrInvalidRespondentFilterDateRanges = errors.New("respondent filter date ranges are invalid") ErrInvalidRelativeType = errors.New("relative type is invalid") ErrInvalidRelativeValue = errors.New("relative value is invalid") )
var ( ErrRequiredFieldEmpty = errors.New("required field is empty") ErrInvalidFieldValue = errors.New("invalid field value") ErrInvalidQuotaCellValue = errors.New("invalid quota cell value, perc or count must be specified") ErrAllocationNotProvided = errors.New("allocation is not specified for the cell") ErrAmbigiuosAllocation = errors.New("either percentage or count must be present in the quotacell") ErrInconsistentAllocationType = errors.New("allocation type with in the quota group should be consistent") ErrMissingQuotaCells = errors.New("at least one quota cell should be provided") ErrInvalidScheduleEmpty = errors.New("both days in field and scheduled times cannot be empty") // URL validation errors ErrURLBlank = errors.New("the URL cannot be blank") ErrURLMaxLength = errors.New("the URL length cannot exceed " + strconv.Itoa(URLMaxLength) + " characters") ErrURLMinLength = errors.New("the URL length cannot be less than " + strconv.Itoa(URLMinLength) + " characters") ErrURLPrefix = errors.New("the URL cannot have a prefix '.'") ErrURLHostPrefix = errors.New("the URL host cannot have a prefix '.'") ErrURLHost = errors.New("the URL host is not present") ErrURLFragment = errors.New("the URL has a fragment(#) which is not supported") ErrURLInvalid = errors.New("the URL is invalid") )
Validation Errors
var (
ErrEventActionNotApplicable = errors.New("requested action is not applicable for this event")
)
Event errors
var ErrIncorrectEnvironemt = errors.New("one of local/dev/uat/prod only are allowed")
ErrIncorrectEnvironemt ...
var ErrSessionExpired = errors.New("session expired")
ErrSessionExpired ... Returns if both Access and Refresh tokens are expired
var RespondentFilterTypes = []RespondentFilterType{ RespondentFilterTypeProject, RespondentFilterTypeTag, RespondentFilterTypeCategory, }
RespondentFilterTypes ...
var RespondentScheduleTypes = []RespondentScheduleType{ RespondentScheduleTypeAllDates, RespondentScheduleTypeThisMonth, RespondentScheduleTypeLastDays, RespondentScheduleTypeLastMonths, RespondentScheduleTypeCustom, }
RespondentScheduleTypes ...
var RespondentStatuses = []RespondentStatus{ RespondentStatusCompleted, RespondentStatusOverQuota, RespondentStatusScreenOut, RespondentStatusInComplete, }
RespondentStatuses ...
Functions ¶
func AppendURLScheme ¶
AppendURLScheme appends URL scheme
func IsCountryCodeOrEmpty ¶
IsCountryCodeOrEmpty ...
func IsLanguageCodeOrEmpty ¶
IsLanguageCodeOrEmpty ...
func RemoveWhiteSpace ¶
func RemoveWhiteSpace(obj struct{})
RemoveWhiteSpace function is trimming the object
func ValidateExclusionType ¶
func ValidateExclusionType(val ExclusionType) error
ValidateExclusionType ...
func ValidateLanguageISOCode ¶
ValidateLanguageISOCode ...
func ValidateSchedule ¶
Types ¶
type APIResponse ¶
type APIResponse struct { Body json.RawMessage RequestID string }
APIResponse ...
func SendRequest ¶
func SendRequest(host, method, url, accessToken string, body interface{}, timeout int) (*APIResponse, error)
SendRequest exposing sendrequest to enable custom requests
func SendRequestWithContext ¶ added in v0.0.2
func SendRequestWithContext(ctx context.Context, host, method, url, accessToken string, body interface{}, timeout int) (*APIResponse, error)
SendRequestWithContext exposing sendrequest to enable custom requests
type Allocation ¶
type Allocation string
Allocation enum for allocation type.
const ( // AllocationPercentage percentage allocation AllocationPercentage Allocation = "perc" // AllocationCount count allocation AllocationCount Allocation = "count" )
type AllowedAction ¶
type AllowedAction struct { ID string `json:"id"` Action string `json:"action"` Description string `json:"description"` }
AllowedAction ...
type AppError ¶
type AppError struct { Data interface{} `json:"data"` Meta *Meta `json:"meta"` Status *Status `json:"status"` }
AppError ...
type Application ¶ added in v0.0.5
type Application struct { ID int32 `json:"appId"` Current bool `json:"current"` Default bool `json:"default"` Name string `json:"name"` }
Application to hold the app level information of the user.
type AttrCategory ¶
type AttrCategory struct { ID string `json:"id"` Text string `json:"text"` LocalizedText *string `json:"localizedText,omitempty"` }
AttrCategory ...
type Attribute ¶
type Attribute struct { ID string `json:"id"` Name string `json:"name"` Text string `json:"text"` IsAllowedInFilters bool `json:"isAllowedInFilters"` IsAllowedInQuotas bool `json:"isAllowedInQuotas"` Type string `json:"type"` Options []*AttributeOption `json:"options"` Format *string `json:"format,omitempty"` LocalizedText *string `json:"localizedText,omitempty"` State AttributeState `json:"state"` Tier string `json:"tier"` AttributeCategory AttributeCategory `json:"category"` Exclusions []*string `json:"exclusions,omitempty"` }
Attribute ... Supported attribute for a country and language. Required to build up the Quota Plan
type AttributeCategory ¶
type AttributeCategory struct { MainCategory AttrCategory `json:"mainCategory"` SubCategory AttrCategory `json:"subCategory"` }
AttributeCategory ...
type AttributeOption ¶
type AttributeOption struct { ID string `json:"id"` Text string `json:"text"` LocalizedText *string `json:"localizedText,omitempty"` }
AttributeOption ...
type AttributeState ¶
type AttributeState string
AttributeState defines the state of an attribute
const ( // StateActive is the active state for attribute StateActive AttributeState = "ACTIVE" // StateDeprecated is the deprecated state for attribute StateDeprecated AttributeState = "DEPRECATED" // StateInactive is the inactive state for attribute StateInactive AttributeState = "INACTIVE" )
type Author ¶
type Author struct { Name string `json:"name"` Type string `json:"type"` Username string `json:"username"` }
Author ...
type Billing ¶
type Billing struct { ID string `json:"billingID"` Type BillingType `json:"type"` Date *CustomTime `json:"billingDate"` }
Billing ...
type BillingType ¶
type BillingType string
BillingType determines whether the invoiced project is monthly or single project
const ( // BillingTypeMonthly determines that the projects are being billed Monthly BillingTypeMonthly BillingType = "AGGREGATED_MONTHLY" // BillingTypePerProject determines the project is billed per project BillingTypePerProject BillingType = "PER_PROJECT" )
type BuyProjectCriteria ¶
type BuyProjectCriteria struct { ExtLineItemID string `json:"extLineItemId" valid:"required"` SurveyURL string `json:"surveyURL" valid:"required,surveyURL"` SurveyTestURL string `json:"surveyTestURL" valid:"required"` SurveyTestingNotes *string `json:"surveyTestingNotes,omitempty" valid:"optional"` }
BuyProjectCriteria ...
type BuyProjectLineItem ¶
type BuyProjectLineItem struct { ExtLineItemID string `json:"extLineItemId"` State State `json:"state"` }
BuyProjectLineItem ...
type BuyProjectResponse ¶
type BuyProjectResponse struct { List []*BuyProjectLineItem `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
BuyProjectResponse represents the response from Buy Project request
type Category ¶
type Category struct { SurveyTopic []string `json:"surveyTopic" valid:"required"` StudyType *[]string `json:"studyType" valid:"optional"` StudyRequirements *[]string `json:"StudyRequirements" valid:"optional"` }
Category is a Project's category
type CategoryMetadata ¶
type CategoryMetadata struct { StudyRequirements []MetadataItem `json:"studyRequirements"` StudyTypes []MetadataItem `json:"studyTypes"` SurveyTopics []MetadataItem `json:"surveyTopics"` }
CategoryMetadata ...
type CheckOrderNumber ¶ added in v0.0.5
type CheckOrderNumber struct {
Availability bool `json:"availability"`
}
type CheckOrderNumberResponse ¶ added in v0.0.5
type CheckOrderNumberResponse struct { CheckOrderNumber CheckOrderNumber `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
CheckOrderNumber ...
type Client ¶
type Client struct { Credentials TokenRequest Auth TokenResponse Options *ClientOptions HTTPClient httpClient }
Client is used to make API requests to the Samplify API.
func NewClient ¶
func NewClient(clientID, username, passsword string, options *ClientOptions) *Client
NewClient returns an API client. If options is nil, UATClientOptions will be used.
func NewClientFromEnv ¶
func NewClientFromEnv(clientID, username, passsword string, env string, timeout int) (*Client, error)
NewClientFromEnv returns an API client.
func (*Client) AcceptEventWithContext ¶ added in v0.0.2
AcceptEventWithContext ...
func (*Client) AddLineItem ¶
func (c *Client) AddLineItem(extProjectID string, lineItem *CreateLineItemCriteria) (*LineItemResponse, error)
AddLineItem ...
func (*Client) AddLineItemWithContext ¶ added in v0.0.2
func (c *Client) AddLineItemWithContext(ctx context.Context, extProjectID string, lineItem *CreateLineItemCriteria) (*LineItemResponse, error)
AddLineItemWithContext ...
func (*Client) BuyProject ¶
func (c *Client) BuyProject(extProjectID string, buy []*BuyProjectCriteria) (*BuyProjectResponse, error)
BuyProject ...
func (*Client) BuyProjectWithContext ¶ added in v0.0.2
func (c *Client) BuyProjectWithContext(ctx context.Context, extProjectID string, buy []*BuyProjectCriteria) (*BuyProjectResponse, error)
BuyProjectWithContext ...
func (*Client) CheckOrderNumber ¶ added in v0.0.5
CheckOrderNumber ...
func (*Client) CheckOrderNumberWithContext ¶ added in v0.0.5
CheckOrderNumberWithContext ...
func (*Client) CloseLineItem ¶
func (c *Client) CloseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
CloseLineItem utility function to close a lineitem
func (*Client) CloseLineItemWithContext ¶ added in v0.0.2
func (c *Client) CloseLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
CloseLineItemWithContext utility function to close a lineitem
func (*Client) CloseProject ¶
func (c *Client) CloseProject(extProjectID string) (*CloseProjectResponse, error)
CloseProject ...
func (*Client) CloseProjectWithContext ¶ added in v0.0.2
func (c *Client) CloseProjectWithContext(ctx context.Context, extProjectID string) (*CloseProjectResponse, error)
CloseProjectWithContext ...
func (*Client) CompanyUsers ¶
func (c *Client) CompanyUsers() (*CompanyUsersResponse, error)
CompanyUsers gives information about the user that is currently logged in.
func (*Client) CompanyUsersWithContext ¶ added in v0.0.2
func (c *Client) CompanyUsersWithContext(ctx context.Context) (*CompanyUsersResponse, error)
CompanyUsersWithContext gives information about the user that is currently logged in.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(project *CreateProjectCriteria) (*ProjectResponse, error)
CreateProject ...
func (*Client) CreateProjectWithContext ¶ added in v0.0.2
func (c *Client) CreateProjectWithContext(ctx context.Context, project *CreateProjectCriteria) (*ProjectResponse, error)
CreateProjectWithContext ...
func (*Client) CreateTemplate ¶
func (c *Client) CreateTemplate(template *TemplateCriteria) (*TemplateResponse, error)
CreateTemplate ...
func (*Client) CreateTemplateWithContext ¶ added in v0.0.2
func (c *Client) CreateTemplateWithContext(ctx context.Context, template *TemplateCriteria) (*TemplateResponse, error)
CreateTemplateWithContext ...
func (*Client) DeleteTemplate ¶
DeleteTemplate ...
func (*Client) DeleteTemplateWithContext ¶ added in v0.0.2
DeleteTemplateWithContext ...
func (*Client) GetAllLineItems ¶
func (c *Client) GetAllLineItems(extProjectID string, options *QueryOptions) (*GetAllLineItemsResponse, error)
GetAllLineItems ...
func (*Client) GetAllLineItemsWithContext ¶ added in v0.0.2
func (c *Client) GetAllLineItemsWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*GetAllLineItemsResponse, error)
GetAllLineItemsWithContext ...
func (*Client) GetAllProjects ¶
func (c *Client) GetAllProjects(options *QueryOptions) (*GetAllProjectsResponse, error)
GetAllProjects ...
func (*Client) GetAllProjectsWithContext ¶ added in v0.0.2
func (c *Client) GetAllProjectsWithContext(ctx context.Context, options *QueryOptions) (*GetAllProjectsResponse, error)
GetAllProjectsWithContext ...
func (*Client) GetAttributes ¶
func (c *Client) GetAttributes(countryCode, languageCode string, options *QueryOptions) (*GetAttributesResponse, error)
GetAttributes ... Get the list of supported attributes for a country and language. This data is required to build up the Quota Plan.
func (*Client) GetAttributesWithContext ¶ added in v0.0.2
func (c *Client) GetAttributesWithContext(ctx context.Context, countryCode, languageCode string, options *QueryOptions) (*GetAttributesResponse, error)
GetAttributesWithContext ... Get the list of supported attributes for a country and language. This data is required to build up the Quota Plan.
func (*Client) GetAuthWithContext ¶ added in v0.0.2
func (c *Client) GetAuthWithContext(ctx context.Context) (TokenResponse, error)
GetAuthWithContext ...
func (*Client) GetCountries ¶
func (c *Client) GetCountries(options *QueryOptions) (*GetCountriesResponse, error)
GetCountries ... Get the list of supported countries and languages in each country.
func (*Client) GetCountriesWithContext ¶ added in v0.0.2
func (c *Client) GetCountriesWithContext(ctx context.Context, options *QueryOptions) (*GetCountriesResponse, error)
GetCountriesWithContext ... Get the list of supported countries and languages in each country.
func (*Client) GetDetailedLineItemReport ¶
func (c *Client) GetDetailedLineItemReport(extProjectID, extLineItemID string) (*DetailedLineItemReportResponse, error)
GetDetailedLineItemReport returns a lineitems's report with quota cell level stats based on observed data from actual panelists.
func (*Client) GetDetailedLineItemReportWithContext ¶ added in v0.0.2
func (c *Client) GetDetailedLineItemReportWithContext(ctx context.Context, extProjectID, extLineItemID string) (*DetailedLineItemReportResponse, error)
GetDetailedLineItemReportWithContext returns a lineitems's report with quota cell level stats based on observed data from actual panelists.
func (*Client) GetDetailedProjectReport ¶
func (c *Client) GetDetailedProjectReport(extProjectID string) (*DetailedProjectReportResponse, error)
GetDetailedProjectReport returns a project's detailed report based on observed data from actual panelists.
func (*Client) GetDetailedProjectReportWithContext ¶ added in v0.0.2
func (c *Client) GetDetailedProjectReportWithContext(ctx context.Context, extProjectID string) (*DetailedProjectReportResponse, error)
GetDetailedProjectReportWithContext returns a project's detailed report based on observed data from actual panelists.
func (*Client) GetEventBy ¶
func (c *Client) GetEventBy(eventID string) (*GetEventResponse, error)
GetEventBy ... Returns the requested event based on the eventID
func (*Client) GetEventByWithContext ¶ added in v0.0.2
func (c *Client) GetEventByWithContext(ctx context.Context, eventID string) (*GetEventResponse, error)
GetEventByWithContext ... Returns the requested event based on the eventID
func (*Client) GetEvents ¶
func (c *Client) GetEvents(options *QueryOptions) (*GetEventListResponse, error)
GetEvents ... Returns the list of all events that have occurred for your company account. Most recent events occur at the top of the list.
func (*Client) GetEventsWithContext ¶ added in v0.0.2
func (c *Client) GetEventsWithContext(ctx context.Context, options *QueryOptions) (*GetEventListResponse, error)
GetEventsWithContext ... Returns the list of all events that have occurred for your company account. Most recent events occur at the top of the list.
func (*Client) GetFeasibility ¶
func (c *Client) GetFeasibility(extProjectID string, options *QueryOptions) (*GetFeasibilityResponse, error)
GetFeasibility ... Returns the feasibility for all the line items of the requested project. Takes 20 - 120 seconds to execute. Check the `GetFeasibilityResponse.Feasibility.Status` field value to see if it is FeasibilityStatusReady ("READY") or FeasibilityStatusProcessing ("PROCESSING") If GetFeasibilityResponse.Feasibility.Status == FeasibilityStatusProcessing, call this function again in 2 mins.
func (*Client) GetFeasibilityWithContext ¶ added in v0.0.2
func (c *Client) GetFeasibilityWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*GetFeasibilityResponse, error)
GetFeasibilityWithContext ... Returns the feasibility for all the line items of the requested project. Takes 20 - 120 seconds to execute. Check the `GetFeasibilityResponse.Feasibility.Status` field value to see if it is FeasibilityStatusReady ("READY") or FeasibilityStatusProcessing ("PROCESSING") If GetFeasibilityResponse.Feasibility.Status == FeasibilityStatusProcessing, call this function again in 2 mins.
func (*Client) GetHealthyStatus ¶
func (c *Client) GetHealthyStatus() (*APIResponse, error)
GetHealthyStatus ... Get the healthy status on API
func (*Client) GetHealthyStatusWithContext ¶ added in v0.0.2
func (c *Client) GetHealthyStatusWithContext(ctx context.Context) (*APIResponse, error)
func (*Client) GetInvoice ¶
func (c *Client) GetInvoice(extProjectID string, options *QueryOptions) (*APIResponse, error)
GetInvoice ... Get the invoice of the requested project
func (*Client) GetInvoiceWithContext ¶ added in v0.0.2
func (c *Client) GetInvoiceWithContext(ctx context.Context, extProjectID string, options *QueryOptions) (*APIResponse, error)
GetInvoiceWithContext ... Get the invoice of the requested project
func (*Client) GetInvoicesSummary ¶
func (c *Client) GetInvoicesSummary(options *QueryOptions) (*APIResponse, error)
GetInvoicesSummary ...
func (*Client) GetInvoicesSummaryWithContext ¶ added in v0.0.2
func (c *Client) GetInvoicesSummaryWithContext(ctx context.Context, options *QueryOptions) (*APIResponse, error)
GetInvoicesSummaryWithContext ...
func (*Client) GetLineItemBy ¶
func (c *Client) GetLineItemBy(extProjectID, extLineItemID string) (*LineItemResponse, error)
GetLineItemBy ...
func (*Client) GetLineItemByWithContext ¶ added in v0.0.2
func (c *Client) GetLineItemByWithContext(ctx context.Context, extProjectID, extLineItemID string) (*LineItemResponse, error)
GetLineItemByWithContext ...
func (*Client) GetOrderDetails ¶ added in v0.0.5
func (c *Client) GetOrderDetails(ordNumber string) (*OrderDetailResponse, error)
GetOrderDetails ...
func (*Client) GetOrderDetailsWithContext ¶ added in v0.0.5
func (c *Client) GetOrderDetailsWithContext(ctx context.Context, ordNumber string) (*OrderDetailResponse, error)
GetOrderDetailsWithContext ...
func (*Client) GetProjectBy ¶
func (c *Client) GetProjectBy(extProjectID string) (*ProjectResponse, error)
GetProjectBy returns project by id
func (*Client) GetProjectByWithContext ¶ added in v0.0.2
func (c *Client) GetProjectByWithContext(ctx context.Context, extProjectID string) (*ProjectResponse, error)
GetProjectByWithContext returns project by id
func (*Client) GetProjectReport ¶
func (c *Client) GetProjectReport(extProjectID string) (*ProjectReportResponse, error)
GetProjectReport returns a project's report based on observed data from actual panelists.
func (*Client) GetProjectReportWithContext ¶ added in v0.0.2
func (c *Client) GetProjectReportWithContext(ctx context.Context, extProjectID string) (*ProjectReportResponse, error)
GetProjectReportWithContext returns a project's report based on observed data from actual panelists.
func (*Client) GetSources ¶
func (c *Client) GetSources(options *QueryOptions) (*GetSampleSourceResponse, error)
GetSources ... Get the list of all the Sample sources
func (*Client) GetSourcesWithContext ¶ added in v0.0.2
func (c *Client) GetSourcesWithContext(ctx context.Context, options *QueryOptions) (*GetSampleSourceResponse, error)
GetSourcesWithContext ... Get the list of all the Sample sources
func (*Client) GetStudyMetadata ¶
func (c *Client) GetStudyMetadata() (*StudyMetadataResponse, error)
GetStudyMetadata returns study metadata property info
func (*Client) GetStudyMetadataWithContext ¶ added in v0.0.2
func (c *Client) GetStudyMetadataWithContext(ctx context.Context) (*StudyMetadataResponse, error)
GetStudyMetadataWithContext returns study metadata property info
func (*Client) GetSurveyTopics ¶
func (c *Client) GetSurveyTopics(options *QueryOptions) (*GetSurveyTopicsResponse, error)
GetSurveyTopics ... Get the list of supported Survey Topics for a project. This data is required to setup a project.
func (*Client) GetSurveyTopicsWithContext ¶ added in v0.0.2
func (c *Client) GetSurveyTopicsWithContext(ctx context.Context, options *QueryOptions) (*GetSurveyTopicsResponse, error)
GetSurveyTopicsWithContext ... Get the list of supported Survey Topics for a project. This data is required to setup a project.
func (*Client) GetTemplateList ¶
func (c *Client) GetTemplateList(country string, lang string, options *QueryOptions) (*TemplatesResponse, error)
GetTemplateList ...
func (*Client) GetTemplateListWithContext ¶ added in v0.0.2
func (c *Client) GetTemplateListWithContext(ctx context.Context, country string, lang string, options *QueryOptions) (*TemplatesResponse, error)
GetTemplateListWithContext ...
func (*Client) GetUserDetails ¶ added in v0.0.5
func (c *Client) GetUserDetails() (*UserDetailsResponse, error)
GetUserDetails ...
func (*Client) GetUserDetailsWithContext ¶ added in v0.0.5
func (c *Client) GetUserDetailsWithContext(ctx context.Context) (*UserDetailsResponse, error)
GetUserDetailsWithContext ...
func (*Client) GetUserInfo ¶
func (c *Client) GetUserInfo() (*UserResponse, error)
GetUserInfo gives information about the user that is currently logged in.
func (*Client) GetUserInfoWithContext ¶ added in v0.0.2
func (c *Client) GetUserInfoWithContext(ctx context.Context) (*UserResponse, error)
GetUserInfoWithContext gives information about the user that is currently logged in.
func (*Client) LaunchLineItem ¶
func (c *Client) LaunchLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
LaunchLineItem utility function to launch a line item
func (*Client) LaunchLineItemWithContext ¶ added in v0.0.2
func (c *Client) LaunchLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
LaunchLineItemWithContext utility function to launch a line item
func (*Client) LogoutWithContext ¶ added in v0.0.2
LogoutWithContext ...
func (*Client) PauseLineItem ¶
func (c *Client) PauseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)
PauseLineItem utility function to pause a lineitem
func (*Client) PauseLineItemWithContext ¶ added in v0.0.2
func (c *Client) PauseLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)
PauseLineItemWithContext utility function to pause a lineitem
func (*Client) ProjectPermissions ¶
func (c *Client) ProjectPermissions(extProjectID string) (*ProjectPermissionsResponse, error)
ProjectPermissions gives information about the user that is currently logged in.
func (*Client) ProjectPermissionsWithContext ¶ added in v0.0.2
func (c *Client) ProjectPermissionsWithContext(ctx context.Context, extProjectID string) (*ProjectPermissionsResponse, error)
ProjectPermissionsWithContext gives information about the user that is currently logged in.
func (*Client) RefreshTokenWithContext ¶ added in v0.0.2
RefreshTokenWithContext ...
func (*Client) RejectEventWithContext ¶ added in v0.0.2
RejectEventWithContext ...
func (*Client) Roles ¶
func (c *Client) Roles(options *QueryOptions) (*RolesResponse, error)
Roles returns the roles specified in the filter.
func (*Client) RolesWithContext ¶ added in v0.0.2
func (c *Client) RolesWithContext(ctx context.Context, options *QueryOptions) (*RolesResponse, error)
RolesWithContext returns the roles specified in the filter.
func (*Client) SetOptions ¶
SetOptions ...
func (*Client) SetQuotaCellStatus ¶
func (c *Client) SetQuotaCellStatus(extProjectID, extLineItemID string, quotaCellID string, action Action) ( *QuotaCellResponse, error)
SetQuotaCellStatus ... Changes the state of the line item based on provided action.
func (*Client) SetQuotaCellStatusWithContext ¶ added in v0.0.2
func (c *Client) SetQuotaCellStatusWithContext(ctx context.Context, extProjectID, extLineItemID string, quotaCellID string, action Action) ( *QuotaCellResponse, error)
SetQuotaCellStatusWithContext ... Changes the state of the line item based on provided action.
func (*Client) SwitchCompany ¶ added in v0.0.5
func (c *Client) SwitchCompany(criteria *SwitchCompanyCriteria) error
SwitchCompany ...
func (*Client) SwitchCompanyWithContext ¶ added in v0.0.5
func (c *Client) SwitchCompanyWithContext(ctx context.Context, criteria *SwitchCompanyCriteria) error
SwitchCompanyWithContext ...
func (*Client) TeamsInfo ¶
func (c *Client) TeamsInfo() (*TeamsResponse, error)
TeamsInfo gives information about the user that is currently logged in.
func (*Client) TeamsInfoWithContext ¶ added in v0.0.2
func (c *Client) TeamsInfoWithContext(ctx context.Context) (*TeamsResponse, error)
TeamsInfoWithContext gives information about the user that is currently logged in.
func (*Client) UpdateLineItem ¶
func (c *Client) UpdateLineItem(extProjectID, extLineItemID string, lineItem *UpdateLineItemCriteria) (*LineItemResponse, error)
UpdateLineItem ...
func (*Client) UpdateLineItemState ¶
func (c *Client) UpdateLineItemState(extProjectID, extLineItemID string, action Action) ( *UpdateLineItemStateResponse, error)
UpdateLineItemState ... Changes the state of the line item based on provided action.
func (*Client) UpdateLineItemStateWithContext ¶ added in v0.0.2
func (c *Client) UpdateLineItemStateWithContext(ctx context.Context, extProjectID, extLineItemID string, action Action) ( *UpdateLineItemStateResponse, error)
UpdateLineItemStateWithContext ... Changes the state of the line item based on provided action.
func (*Client) UpdateLineItemWithContext ¶ added in v0.0.2
func (c *Client) UpdateLineItemWithContext(ctx context.Context, extProjectID, extLineItemID string, lineItem *UpdateLineItemCriteria) (*LineItemResponse, error)
UpdateLineItemWithContext ...
func (*Client) UpdateProject ¶
func (c *Client) UpdateProject(project *UpdateProjectCriteria) (*ProjectResponse, error)
UpdateProject ...
func (*Client) UpdateProjectWithContext ¶ added in v0.0.2
func (c *Client) UpdateProjectWithContext(ctx context.Context, project *UpdateProjectCriteria) (*ProjectResponse, error)
UpdateProjectWithContext ...
func (*Client) UpdateTemplate ¶
func (c *Client) UpdateTemplate(id int, template *TemplateCriteria) (*TemplateResponse, error)
UpdateTemplate ...
func (*Client) UpdateTemplateWithContext ¶ added in v0.0.2
func (c *Client) UpdateTemplateWithContext(ctx context.Context, id int, template *TemplateCriteria) (*TemplateResponse, error)
UpdateTemplateWithContext ...
func (*Client) UploadReconcile ¶
func (c *Client) UploadReconcile(extProjectID string, file multipart.File, fileName string, message string, options *QueryOptions) (*APIResponse, error)
UploadReconcile ... Upload the Request correction file
func (*Client) UploadReconcileWithContext ¶ added in v0.0.2
func (c *Client) UploadReconcileWithContext(ctx context.Context, extProjectID string, file multipart.File, fileName string, message string, options *QueryOptions) (*APIResponse, error)
UploadReconcileWithContext ... Upload the Request correction file
func (*Client) UpsertProjectPermissions ¶
func (c *Client) UpsertProjectPermissions(permissions *UpsertPermissionsCriteria) (*ProjectPermissionsResponse, error)
UpsertProjectPermissions gives information about the user that is currently logged in.
func (*Client) UpsertProjectPermissionsWithContext ¶ added in v0.0.2
func (c *Client) UpsertProjectPermissionsWithContext(ctx context.Context, permissions *UpsertPermissionsCriteria) (*ProjectPermissionsResponse, error)
UpsertProjectPermissionsWithContext gives information about the user that is currently logged in.
type ClientOptions ¶
type ClientOptions struct { APIBaseURL string `conform:"trim"` AuthURL string `conform:"trim"` StatusURL string `conform:"trim"` InternalURL string `conform:"trim"` GatewayURL string `conform:"trim"` Timeout *int HTTPClient httpClient }
ClientOptions ... If an HTTPClient is provided then the Timeout will be ignored
type CloseProjectResponse ¶
type CloseProjectResponse struct { Project *struct { ProjectHeader LineItems []*LineItemHeader `json:"lineItems"` } `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
CloseProjectResponse ...
type Company ¶
type Company struct { ID int32 `json:"id"` Name string `json:"name"` DefaultRole string `json:"defaultRole"` Default bool `json:"default"` Teams []Team `json:"teams"` }
Company holds the information of a company associated to the user.
type CompanyTeam ¶
type CompanyTeam struct { ID int32 `json:"id"` Name string `json:"name"` Status string `json:"status"` Default bool `json:"default"` Description string `json:"description"` CreatedAt *CustomTime `json:"createdAt"` UpdatedAt *CustomTime `json:"updatedAt"` }
CompanyTeam holds info about a company team
type CompanyUser ¶
type CompanyUser struct { Email string `json:"email"` Username string `json:"userName"` FullName string `json:"name"` }
CompanyUser holds the information of users associated to a company.
type CompanyUsersResponse ¶
type CompanyUsersResponse struct { List []*CompanyUser `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
CompanyUsersResponse holds api response object and returns a list of company users.
type Cost ¶
type Cost struct { // CostPerUnit and DetailedCost are only applicable at lineitem level, not applicable at project level CostPerUnit float64 `json:"costPerUnit,omitempty"` Currency string `json:"currency"` EstimatedCost float64 `json:"estimatedCost"` IncurredCost float64 `json:"incurredCost"` DetailedCost []*DetailedCost `json:"detailedCost,omitempty"` }
Cost ...
type Country ¶
type Country struct { ID string `json:"id"` IsoCode string `json:"isoCode"` CountryName string `json:"countryName"` SupportedLanguages []*Language `json:"supportedLanguages"` }
Country ...
type CreateLineItemCriteria ¶
type CreateLineItemCriteria struct { ExtLineItemID string `json:"extLineItemId" valid:"required"` Title string `json:"title" valid:"required"` CountryISOCode string `json:"countryISOCode" valid:"required,ISO3166Alpha2"` LanguageISOCode string `json:"languageISOCode" valid:"required,languageISOCode"` SurveyURL *string `json:"surveyURL,omitempty" valid:"optional,surveyURL"` SurveyTestURL *string `json:"surveyTestURL,omitempty" valid:"optional"` IndicativeIncidence float64 `json:"indicativeIncidence" valid:"required"` DaysInField int64 `json:"daysInField" valid:"optional"` FieldSchedule *Schedule `json:"fieldSchedule" valid:"optional"` LengthOfInterview int64 `json:"lengthOfInterview" valid:"required"` DeliveryType *string `json:"deliveryType" valid:"optional"` QuotaPlan *QuotaPlan `json:"quotaPlan,omitempty" valid:"optional,quotaPlan"` SurveyURLParams []*URLParameter `json:"surveyURLParams" valid:"optional"` SurveyTestURLParams []*URLParameter `json:"surveyTestURLParams" valid:"optional"` Sources []*LineItemSource `json:"sources,omitempty" valid:"optional"` Targets []*LineItemTarget `json:"targets"` SurveyTestingNotes *string `json:"surveyTestingNotes,omitempty" valid:"optional"` }
CreateLineItemCriteria has the fields to create a LineItem
type CreateProjectCriteria ¶
type CreateProjectCriteria struct { ExtProjectID string `json:"extProjectId" valid:"required"` Title string `json:"title" valid:"required"` NotificationEmails []string `json:"notificationEmails" valid:"email,required"` JobNumber string `json:"jobNumber,omitempty" valid:"optional"` Devices []DeviceType `json:"devices" valid:"optional,DeviceType"` Category *Category `json:"category" valid:"required"` LineItems []*CreateLineItemCriteria `json:"lineItems" valid:"required"` Exclusions *Exclusions `json:"exclusions,omitempty" valid:"optional"` RespondentFilters *[]RespondentFilter `json:"respondentFilters,omitempty" valid:"optional"` }
CreateProjectCriteria has the fields to create a project
type CurrentUser ¶
type CurrentUser struct {
Roles []string `json:"roles"`
}
CurrentUser holds a list of roles of the current user
type CustomTime ¶
CustomTime ...
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON ...
type DateFilterValue ¶
DateFilterValue ...
func (DateFilterValue) String ¶
func (datefilter DateFilterValue) String() string
type DetailedCost ¶
type DetailedCost struct { Title string `json:"title"` Type CostType `json:"type"` CostPerUnit float64 `json:"costPerUnit"` EstimatedCost float64 `json:"estimatedCost"` IncurredCost float64 `json:"incurredCost"` DeliveredUnits int64 `json:"deliveredUnits"` RequestedUnits int64 `json:"requestedUnits"` }
DetailedCost ...
type DetailedLineItemReport ¶
type DetailedLineItemReport struct { ExtLineItemID string `json:"extLineItemId"` Title string `json:"title"` State State `json:"state"` StateReason string `json:"stateReason"` CountryISOCode *string `json:"countryISOCode"` LanguageISOCode *string `json:"languageISOCode"` Sources []*LineItemSource `json:"sources"` Cost Cost `json:"cost"` Stats DetailedStats `json:"stats"` // QuotaGroups is applicable only for detailed lineitem report, not applicable for lineitems in detailed project report QuotaGroups []*DetailedQuotaGroupReport `json:"quotaGroups,omitempty"` }
DetailedLineItemReport ...
type DetailedLineItemReportResponse ¶
type DetailedLineItemReportResponse struct { Report DetailedLineItemReport `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
DetailedLineItemReportResponse ...
type DetailedProjectReport ¶
type DetailedProjectReport struct { ExtProjectID string `json:"extProjectId"` JobNumber string `json:"jobNumber"` Title string `json:"title"` State State `json:"state"` Stats DetailedStats `json:"stats"` Cost Cost `json:"cost"` LineItems []*DetailedLineItemReport `json:"lineItems"` }
DetailedProjectReport ...
type DetailedProjectReportResponse ¶
type DetailedProjectReportResponse struct { Report DetailedProjectReport `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
DetailedProjectReportResponse ...
type DetailedQuotaCellReport ¶
type DetailedQuotaCellReport struct { QuotaCellID string `json:"quotaCellId"` QuotaNodes []*QuotaNode `json:"quotaNodes"` Stats DetailedStats `json:"stats"` }
DetailedQuotaCellReport ...
type DetailedQuotaGroupReport ¶
type DetailedQuotaGroupReport struct { QuotaGroupID string `json:"quotaGroupId"` Stats DetailedStats `json:"stats"` QuotaCells []*DetailedQuotaCellReport `json:"quotaCells"` }
DetailedQuotaGroupReport ...
type DetailedQuote ¶
type DetailedQuote struct { CostPerUnit float64 `json:"costPerUnit"` EstimatedCost float64 `json:"estimatedCost"` Title string `json:"title"` Type QuoteType `json:"type"` Units int64 `json:"units"` }
DetailedQuote ...
type DetailedStats ¶
type DetailedStats struct { Attempts int64 `json:"attempts"` Completes int64 `json:"completes"` CompletesRefused int64 `json:"completesRefused"` CompletesRefusedPercentage float64 `json:"completesRefusedPercentage"` Screenouts int64 `json:"screenouts"` ScreenoutsPercentage float64 `json:"screenoutsPercentage"` Overquotas int64 `json:"overquotas"` OverquotasPercentage float64 `json:"overquotasPercentage"` Incompletes int64 `json:"incompletes"` IncompletesPercentage float64 `json:"incompletesPercentage"` IncidenceRate float64 `json:"incidenceRate"` // LastAcceptedIncidenceRate, LastAcceptedLOI and ActualMedianLOI are applicable for lineitem stats, not applicable for quota group level or quota cell level or project level stats. LastAcceptedIncidenceRate float64 `json:"lastAcceptedIncidenceRate,omitempty"` LastAcceptedLOI float64 `json:"lastAcceptedLOI,omitempty"` RemainingCompletes int64 `json:"remainingCompletes"` ActualMedianLOI int64 `json:"actualMedianLOI,omitempty"` Conversion float64 `json:"conversion"` }
DetailedStats ...
type DeviceType ¶
type DeviceType string
DeviceType ...
const ( DeviceTypeMobile DeviceType = "mobile" DeviceTypeDesktop DeviceType = "desktop" DeviceTypeTablet DeviceType = "tablet" )
DeviceType values
type EndLinks ¶
type EndLinks struct { Complete string `json:"complete"` Screenout string `json:"screenout"` OverQuota string `json:"overquota"` SecurityKey1 string `json:"securityKey1"` SecurityKey2 string `json:"securityKey2"` SecurityLevel string `json:"securityLevel"` }
EndLinks ...
type ErrorInfo ¶
type ErrorInfo struct { Code string `json:"code"` Message string `json:"message"` Resource Resource `json:"resource"` }
ErrorInfo ... Custom API errors
type ErrorResponse ¶
type ErrorResponse struct { Timestamp *time.Time `json:"timestamp"` RequestID string `json:"requestId"` Path string `json:"path"` HTTPCode int `json:"httpCode"` HTTPPhrase string `json:"httpPhrase"` Errors []*Error `json:"errors"` }
ErrorResponse ...
type ErrorType ¶
type ErrorType struct { Code string `json:"code"` Message string `json:"message"` Resource *Resource `json:"resource"` }
ErrorType user type.
type Event ¶
type Event struct { EventID int64 `json:"eventId"` EventType EventType `json:"eventType"` ExtProjectID string `json:"extProjectId"` ExtLineItemID string `json:"extLineItemId"` Resource *EventResource `json:"resource"` Actions *EventActions `json:"actions"` Details *EventDetails `json:"details"` CreatedAt CustomTime `json:"createdAt"` ParentEventID *int64 `json:"parentEventId,omitempty"` }
Event ...
type EventActions ¶
type EventActions struct { AcceptURL string `json:"acceptURL"` RejectURL string `json:"rejectURL"` }
EventActions ...
type EventDetails ¶
type EventDetails struct { Comments string `json:"comments"` Reasons []*EventReason `json:"reasons"` }
EventDetails ...
type EventReason ¶
EventReason ...
type EventResource ¶
type EventResource struct { CostPerInterview *EventValues `json:"costPerInterview"` EstimatedCost *EventValues `json:"estimatedCost"` LengthOfInterview *EventValues `json:"lengthOfInterview"` IndicativeIncidence *EventValues `json:"incidenceRate"` Currency string `json:"currency"` Status *EventStatusValues `json:"status"` Reason string `json:"reason"` }
EventResource ...
type EventStatus ¶
type EventStatus string
EventStatus ...
const ( EventStatusLaunched EventStatus = "LAUNCHED" EventStatusPaused EventStatus = "PAUSED" EventStatusAwaitingApproval EventStatus = "AWAITING_CLIENT_APPROVAL" EventStatusClosed EventStatus = "CLOSED" )
EventStatus values
type EventStatusValues ¶
type EventStatusValues struct { NewValue EventStatus `json:"newValue"` PreviousValue EventStatus `json:"previousValue"` }
EventStatusValues ...
type EventValues ¶
type EventValues struct { NewValue float64 `json:"newValue"` PreviousValue float64 `json:"previousValue"` }
EventValues ...
type ExclusionType ¶
type ExclusionType string
ExclusionType ...
const ( ExclusionTypeProject ExclusionType = "PROJECT" ExclusionTypeTag ExclusionType = "TAG" )
ExclusionType values
type Exclusions ¶
type Exclusions struct { Type ExclusionType `json:"type" valid:"ExclusionType"` List []string `json:"list"` }
Exclusions ... Project's exclusions
type Feasibility ¶
type Feasibility struct { Status FeasibilityStatus `json:"status"` CostPerInterview float64 `json:"costPerInterview"` Currency string `json:"currency"` Feasible bool `json:"feasible"` TotalCount int64 `json:"totalCount"` ValueCounts []*ValueCount `json:"valueCounts"` }
Feasibility ...
type FeasibilityQuotaCell ¶
type FeasibilityQuotaCell struct { FeasibilityCount int64 `json:"feasibilityCount"` QuotaNodes []*QuotaNode `json:"quotaNodes"` }
FeasibilityQuotaCell ...
type FeasibilityStatus ¶
type FeasibilityStatus string
FeasibilityStatus ...
const ( FeasibilityStatusReady FeasibilityStatus = "READY" FeasibilityStatusProcessing FeasibilityStatus = "PROCESSING" FeasibilityStatusNotSupported FeasibilityStatus = "NOT_SUPPORTED" FeasibilityStatusFailed FeasibilityStatus = "FAILED" )
FeasibilityStatus values
type Filter ¶
type Filter struct { Field QueryField Value Value }
Filter by top level fields only. Nested fields are not supported for filtering.
type FilterValue ¶
type FilterValue struct {
Value interface{}
}
FilterValue ...
func (FilterValue) String ¶
func (filtervalue FilterValue) String() string
type GetAllLineItemsResponse ¶
type GetAllLineItemsResponse struct { List []*LineItemListItem `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetAllLineItemsResponse ...
type GetAllProjectsResponse ¶
type GetAllProjectsResponse struct { Projects []*ProjectHeader `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetAllProjectsResponse ...
type GetAttributesResponse ¶
type GetAttributesResponse struct { List []*Attribute `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetAttributesResponse ...
type GetCountriesResponse ¶
type GetCountriesResponse struct { List []*Country `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetCountriesResponse ...
type GetEventListResponse ¶
type GetEventListResponse struct { List []*Event `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetEventListResponse ...
type GetEventResponse ¶
type GetEventResponse struct { Event *Event `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
GetEventResponse ...
type GetFeasibilityResponse ¶
type GetFeasibilityResponse struct { List []*struct { ExtLineItemID string `json:"extLineItemId"` Feasibility *Feasibility `json:"feasibility"` Quote Quote `json:"quote"` } `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
GetFeasibilityResponse ...
type GetSampleSourceResponse ¶
type GetSampleSourceResponse struct { List []*SampleSource `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetSampleSourceResponse ...
type GetSurveyTopicsResponse ¶
type GetSurveyTopicsResponse struct { List []*SurveyTopic `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
GetSurveyTopicsResponse ...
type Invoice ¶
type Invoice struct {
File []byte `json:"data"`
}
Invoice ... Represents Invoice for a project.
type Language ¶
type Language struct { ID string `json:"id"` IsoCode string `json:"isoCode"` LanguageName string `json:"languageName"` }
Language ...
type LineItem ¶
type LineItem struct { LineItemHeader Title string `json:"title"` CountryISOCode string `json:"countryISOCode"` LanguageISOCode string `json:"languageISOCode"` SurveyURL string `json:"surveyURL"` SurveyTestURL string `json:"surveyTestURL"` IndicativeIncidence float64 `json:"indicativeIncidence"` DaysInField int64 `json:"daysInField"` FieldSchedule *Schedule `json:"fieldSchedule"` LengthOfInterview int64 `json:"lengthOfInterview"` DeliveryType *string `json:"deliveryType"` QuotaPlan *QuotaPlan `json:"quotaPlan"` EndLinks *EndLinks `json:"endLinks"` SurveyURLParams []*URLParameter `json:"surveyURLParams"` Sources []*LineItemSource `json:"sources"` Targets []*LineItemTarget `json:"targets"` SurveyTestingNotes string `json:"surveyTestingNotes"` }
LineItem ...
func (*LineItem) IsCloseable ¶
IsCloseable returns false if the line item cannot be updated.
func (*LineItem) IsRebalanceable ¶
IsRebalanceable returns false if the line item cannot be updated.
func (*LineItem) IsUpdateable ¶
IsUpdateable returns false if the line item cannot be updated.
type LineItemHeader ¶
type LineItemHeader struct { Model ExtLineItemID string `json:"extLineItemId"` State State `json:"state"` StateReason string `json:"stateReason"` LaunchedAt *CustomTime `json:"launchedAt"` }
LineItemHeader ...
type LineItemListItem ¶
type LineItemListItem struct { Model ExtLineItemID string `json:"extLineItemId"` State State `json:"state"` StateReason string `json:"stateReason"` LaunchedAt *CustomTime `json:"launchedAt"` Title string `json:"title"` CountryISOCode string `json:"countryISOCode"` LanguageISOCode string `json:"languageISOCode"` }
LineItemListItem ...
type LineItemReport ¶
type LineItemReport struct { ExtLineItemID string `json:"extLineItemId"` Title string `json:"title"` CountryISOCode string `json:"countryISOCode"` LanguageISOCode string `json:"languageISOCode"` State State `json:"state"` StateReason string `json:"stateReason"` Attempts int64 `json:"attempts"` Completes int64 `json:"completes"` Overquotas int64 `json:"overquotas"` Screenouts int64 `json:"screenouts"` Incompletes int64 `json:"incompletes"` Conversion float64 `json:"conversion"` CurrencyCode string `json:"currency"` RemainingCompletes int64 `json:"remainingCompletes"` ActualMedianLOI int64 `json:"actualMedianLOI"` IncurredCost float64 `json:"incurredCost"` EstimatedCost float64 `json:"estimatedCost"` LastAcceptedIncidence float64 `json:"lastAcceptedIncidenceRate"` LastAcceptedLOI int64 `json:"lastAcceptedLOI"` CompletesRefused int64 `json:"completesRefused"` }
LineItemReport ...
type LineItemResponse ¶
type LineItemResponse struct { Item *LineItem `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
LineItemResponse ... Response returned by Add, Update and Get LineItem requests
type LineItemSource ¶
LineItemSource source associated with the lineitem.
type LineItemTarget ¶ added in v0.0.2
type LineItemTarget struct { Count *uint32 `json:"count,omitempty"` DailyLimit *uint32 `json:"dailyLimit,omitempty"` Type TargetType `json:"type,omitempty"` }
LineItemTarget target associated with the line item.
type Links ¶
type Links struct { First string `json:"first"` Last string `json:"last"` Next string `json:"next"` Prev string `json:"prev"` Self string `json:"self"` }
Links for page navigation
type Meta ¶
type Meta struct { Links `json:"links"` Total int64 `json:"total"` PageSize int64 `json:"pageSize"` }
Meta ...
type MetadataItem ¶
type MetadataItem struct { Allowed bool `json:"allowed"` Description string `json:"description"` ID string `json:"id"` Name string `json:"name"` }
MetadataItem ...
type Model ¶
type Model struct { StateLastUpdatedAt *CustomTime `json:"stateLastUpdatedAt"` CreatedAt CustomTime `json:"createdAt"` UpdatedAt CustomTime `json:"updatedAt"` }
Model ...
type OrderDetail ¶ added in v0.0.5
type OrderDetail struct { // sales order SalesOrder *SalesOrder `form:"salesOrder" json:"salesOrder" yaml:"salesOrder" xml:"salesOrder"` // sales details SalesOrderDetails []*SalesOrderDetails `form:"salesOrderDetails" json:"salesOrderDetails" yaml:"salesOrderDetails" xml:"salesOrderDetails"` }
type OrderDetailResponse ¶ added in v0.0.5
type OrderDetailResponse struct { OrderDetail OrderDetail `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
OrderDetailResponseData ...
type Project ¶
type Project struct { ProjectHeader NotificationEmails []string `json:"notificationEmails"` Devices []DeviceType `json:"devices"` Category *Category `json:"category"` LineItems []*LineItem `json:"lineItems"` Exclusions *Exclusions `json:"exclusions"` Invoice os.File `json:"invoice"` RespondentFilters *[]RespondentFilter `json:"respondentFilters"` }
Project ...
func (*Project) IsUserSubscribed ¶
IsUserSubscribed tells you if an given user (email) is subscribed to the project.
type ProjectHeader ¶
type ProjectHeader struct { Model ExtProjectID string `json:"extProjectId"` Title string `json:"title"` JobNumber string `json:"jobNumber"` State State `json:"state"` Author *Author `json:"author"` Billing *Billing `json:"billing"` LaunchedAt *CustomTime `json:"launchedAt"` ClosedAt *CustomTime `json:"closedAt"` }
ProjectHeader ...
type ProjectPermissions ¶
type ProjectPermissions struct { ExtProjectID string `json:"extProjectId"` CurrentUser CurrentUser `json:"currentUser"` Users []UserData `json:"users"` Teams []TeamData `json:"teams"` }
ProjectPermissions ...
type ProjectPermissionsResponse ¶
type ProjectPermissionsResponse struct { ProjectPermissions *ProjectPermissions `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
ProjectPermissionsResponse returns the permissions that a user has on a resource. Here the resource is Project.
type ProjectReport ¶
type ProjectReport struct { ExtProjectID string `json:"extProjectId"` Title string `json:"title"` JobNumber string `json:"jobNumber"` State State `json:"state"` Attempts int64 `json:"attempts"` Completes int64 `json:"completes"` Screenouts int64 `json:"screenouts"` Overquotas int64 `json:"overquotas"` Incompletes int64 `json:"incompletes"` Conversion float64 `json:"conversion"` CurrencyCode string `json:"currency"` RemainingCompletes int64 `json:"remainingCompletes"` ActualMedianLOI int64 `json:"actualMedianLOI"` IncurredCost float64 `json:"incurredCost"` EstimatedCost float64 `json:"estimatedCost"` LineItems []*LineItemReport `json:"lineItems"` CompletesRefused int64 `json:"completesRefused"` }
ProjectReport ...
type ProjectReportResponse ¶
type ProjectReportResponse struct { Report *ProjectReport `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
ProjectReportResponse ...
type ProjectResponse ¶
type ProjectResponse struct { Project *Project `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
ProjectResponse ...
type QueryField ¶
type QueryField string
QueryField ... Supported fields for filtering and sorting
const ( QueryFieldID QueryField = "id" QueryFieldExtProjectID QueryField = "extProjectId" QueryFieldExtLineItemID QueryField = "extLineItemId" QueryFieldCreatedAt QueryField = "createdAt" QueryFieldUpdatedAt QueryField = "updatedAt" QueryFieldTitle QueryField = "title" QueryFieldJobNumber QueryField = "jobNumber" QueryFieldName QueryField = "name" QueryFieldText QueryField = "text" QueryFieldType QueryField = "type" QueryFieldState QueryField = "state" QueryFieldStateReason QueryField = "stateReason" QueryFieldStateLastUpdatedAt QueryField = "stateLastUpdatedAt" QueryFieldIsoCode QueryField = "isoCode" QueryFieldCountryName QueryField = "countryName" QueryFieldCountryISOCode QueryField = "countryISOCode" QueryFieldLanguageISOCode QueryField = "languageISOCode" QueryFieldLaunchedAt QueryField = "launchedAt" QueryFieldSurveyTopic QueryField = "surveyTopic" QueryFieldStartDate QueryField = "startDate" QueryFieldEndDate QueryField = "endDate" QueryFieldBillingDate QueryField = "billingDate" QueryFieldIsAllowedInSurveyAppends QueryField = "isAllowedInSurveyAppends" )
QueryField values
type QueryOptions ¶
type QueryOptions struct { FilterBy []*Filter SortBy []*Sort Offset uint Limit uint Scope string `conform:"trim"` ExtProjectId *string ExtLineItemId *string EventType *string `conform:"trim"` }
QueryOptions ... Filtering/Sorting and pagination params for GET endpoints that return an object list Default limit = 10, maximum limit value = 1000
type QuotaCell ¶
type QuotaCell struct { QuotaCellID *string `json:"quotaCellId,omitempty" valid:"optional"` QuotaNodes []*QuotaNode `json:"quotaNodes"` Perc *float64 `json:"perc,omitempty" valid:"optional"` Count *uint32 `json:"count,omitempty" valid:"optional"` Status *QCellStatusType `json:"status,omitempty" valid:"optional"` }
QuotaCell ...
func (*QuotaCell) AllocationType ¶
func (c *QuotaCell) AllocationType() Allocation
AllocationType retuns the type of allocation in the quota cell.
type QuotaCellResponse ¶
type QuotaCellResponse struct { QuotaCell QuotaCell `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
QuotaCellResponse ...
type QuotaFilters ¶
type QuotaFilters struct { AttributeID string `json:"attributeId,omitempty"` Options []string `json:"options,omitempty"` Operator *Operator `json:"operator"` }
QuotaFilters ...
type QuotaGroup ¶
type QuotaGroup struct { QuotaGroupID *string `json:"quotaGroupId,omitempty" valid:"optional"` Name *string `json:"name"` QuotaCells []*QuotaCell `json:"quotaCells"` }
QuotaGroup ...
type QuotaPlan ¶
type QuotaPlan struct { Filters []*QuotaFilters `json:"filters,omitempty" valid:"optional"` QuotaGroups []*QuotaGroup `json:"quotaGroups,omitempty" valid:"optional"` }
QuotaPlan ...
type Quote ¶
type Quote struct { CostPerUnit float64 `json:"costPerUnit"` Currency string `json:"currency"` DetailedQuote []DetailedQuote `json:"detailedQuote"` EstimatedCost float64 `json:"estimatedCost"` }
Quote holds the information for premium pricing
type RelativeType ¶ added in v0.0.5
type RelativeType int
RelativeType ...
const ( RelativeTypeDays RelativeType = 1 RelativeTypeWeeks RelativeType = 7 RelativeTypeMonths RelativeType = 30 )
RelativeType values
type RespondentFilter ¶ added in v0.0.5
type RespondentFilter struct { Type string `json:"type"` List []string `json:"list"` Dispositions []string `json:"dispositions"` Schedule RespondentFilterSchedule `json:"schedule"` }
RespondentFilter ... Project's respondent filter
func (*RespondentFilter) ComputeDates ¶ added in v0.0.5
func (rf *RespondentFilter) ComputeDates()
ComputeDates for Respondent Schedule Types Last 2 days (start date: now - 2 days before, end date: now) Last 2 weeks (start date: now - 14 days before, end date: now) Last 2 months (start date: now - 60 days before, end date: now) This month (start date: beginning of month, end date - now)
func (*RespondentFilter) ExclusionList ¶ added in v0.0.5
func (rf *RespondentFilter) ExclusionList() []string
ExclusionList checks if the list in respondent filter object is nil or not. If the list is nil then the function returns an empty array of string so that we do not pass nil to the API which causes an error.
func (*RespondentFilter) PopulateProjects ¶ added in v0.0.5
func (rf *RespondentFilter) PopulateProjects(extProjectIDs []string) error
PopulateProjects is appending projects to the respondent filter list, existing projects are ignored
func (*RespondentFilter) SetDates ¶ added in v0.0.5
func (rf *RespondentFilter) SetDates(start *time.Time, end *time.Time)
SetDates sets start and end dates
func (*RespondentFilter) ValidateDates ¶ added in v0.0.5
func (rf *RespondentFilter) ValidateDates() error
ValidateDates ranges when user provides start and end dates. (valid start date, valid end date, valid relation between start and end date)
type RespondentFilterSchedule ¶ added in v0.0.5
type RespondentFilterType ¶ added in v0.0.5
type RespondentFilterType string
RespondentFilterType ...
const ( RespondentFilterTypeProject RespondentFilterType = "PROJECT" RespondentFilterTypeTag RespondentFilterType = "TAG" RespondentFilterTypeCategory RespondentFilterType = "CATEGORY" )
RespondentFilterType values
type RespondentScheduleType ¶ added in v0.0.5
type RespondentScheduleType string
RespondentScheduleType ...
const ( RespondentScheduleTypeAllDates RespondentScheduleType = "ALL_DATES" RespondentScheduleTypeThisMonth RespondentScheduleType = "THIS_MONTH" RespondentScheduleTypeLastDays RespondentScheduleType = "LAST_DAYS" RespondentScheduleTypeLastMonths RespondentScheduleType = "LAST_MONTHS" RespondentScheduleTypeCustom RespondentScheduleType = "CUSTOM" )
RespondentScheduleType values
type RespondentStatus ¶ added in v0.0.5
type RespondentStatus string
const ( RespondentStatusCompleted RespondentStatus = "COMPLETED" RespondentStatusOverQuota RespondentStatus = "OVERQUOTA" RespondentStatusScreenOut RespondentStatus = "SCREENOUT" RespondentStatusInComplete RespondentStatus = "INCOMPLETE" )
type ResponseStatus ¶
ResponseStatus is the custom status part in API response. (Optional in some endpoints)
func (*ResponseStatus) Get ¶
func (s *ResponseStatus) Get() StatusType
Get ... Reads "message" from API's custom success/error response and interprets the status
type Role ¶
type Role struct { ID string `json:"id"` Name string `json:"name"` AssignableRoles []string `json:"assignableRoles"` Description string `json:"description"` AllowedActions []AllowedAction `json:"allowedActions"` }
Role holds the information about a user role and the actions that can be performed for that role
type RolesResponse ¶
RolesResponse ...
type SalesOrder ¶ added in v0.0.5
type SalesOrder struct { // basicSecurityKey BasicSecurityKey string `form:"basicSecurityKey" json:"basicSecurityKey" yaml:"basicSecurityKey" xml:"basicSecurityKey"` // Unique guid GUID string `form:"guid" json:"guid" yaml:"guid" xml:"guid"` // highSecurityKey HighSecurityKey string `form:"highSecurityKey" json:"highSecurityKey" yaml:"highSecurityKey" xml:"highSecurityKey"` // name Name string `form:"name" json:"name" yaml:"name" xml:"name"` // noCharge NoCharge bool `form:"noCharge" json:"noCharge" yaml:"noCharge" xml:"noCharge"` // orderType OrderType string `form:"orderType" json:"orderType" yaml:"orderType" xml:"orderType"` // ordernumber Ordernumber string `form:"ordernumber" json:"ordernumber" yaml:"ordernumber" xml:"ordernumber"` // relatedOrderCpi RelatedOrderCpi float64 `form:"relatedOrderCpi" json:"relatedOrderCpi" yaml:"relatedOrderCpi" xml:"relatedOrderCpi"` // secureEndLinkLevel SecureEndLinkLevel int `form:"secureEndLinkLevel" json:"secureEndLinkLevel" yaml:"secureEndLinkLevel" xml:"secureEndLinkLevel"` // secureEndLinkLevelName SecureEndLinkLevelName string `form:"secureEndLinkLevelName" json:"secureEndLinkLevelName" yaml:"secureEndLinkLevelName" xml:"secureEndLinkLevelName"` }
SalesOrder user type.
type SalesOrderDetails ¶ added in v0.0.5
type SalesOrderDetails struct { // costPerInterview CostPerInterview float64 `form:"costPerInterview" json:"costPerInterview" yaml:"costPerInterview" xml:"costPerInterview"` // costPerInterviewWithCurrency CostPerInterviewWithCurrency string `` /* 142-byte string literal not displayed */ // countryIsoCode CountryIsoCode string `form:"countryIsoCode" json:"countryIsoCode" yaml:"countryIsoCode" xml:"countryIsoCode"` // extendedamount Extendedamount string `form:"extendedamount" json:"extendedamount" yaml:"extendedamount" xml:"extendedamount"` // guid GUID string `form:"guid" json:"guid" yaml:"guid" xml:"guid"` // labelForMobile LabelForMobile string `form:"labelForMobile" json:"labelForMobile" yaml:"labelForMobile" xml:"labelForMobile"` // productIdGuid ProductIDGUID string `form:"productIdGuid" json:"productIdGuid" yaml:"productIdGuid" xml:"productIdGuid"` // productIdName ProductIDName string `form:"productIdName" json:"productIdName" yaml:"productIdName" xml:"productIdName"` // quantity Quantity int `form:"quantity" json:"quantity" yaml:"quantity" xml:"quantity"` // ssiAdditionalPoints SsiAdditionalPoints int `form:"ssiAdditionalPoints" json:"ssiAdditionalPoints" yaml:"ssiAdditionalPoints" xml:"ssiAdditionalPoints"` // ssiCalculatedIr SsiCalculatedIr string `form:"ssiCalculatedIr" json:"ssiCalculatedIr" yaml:"ssiCalculatedIr" xml:"ssiCalculatedIr"` // ssiCalculatedLoi SsiCalculatedLoi string `form:"ssiCalculatedLoi" json:"ssiCalculatedLoi" yaml:"ssiCalculatedLoi" xml:"ssiCalculatedLoi"` // ssiChartsNum SsiChartsNum int `form:"ssiChartsNum" json:"ssiChartsNum" yaml:"ssiChartsNum" xml:"ssiChartsNum"` // ssiFamilyId SsiFamilyID string `form:"ssiFamilyId" json:"ssiFamilyId" yaml:"ssiFamilyId" xml:"ssiFamilyId"` // ssiImagesNum SsiImagesNum int `form:"ssiImagesNum" json:"ssiImagesNum" yaml:"ssiImagesNum" xml:"ssiImagesNum"` // ssiImagesSpecialNum SsiImagesSpecialNum int `form:"ssiImagesSpecialNum" json:"ssiImagesSpecialNum" yaml:"ssiImagesSpecialNum" xml:"ssiImagesSpecialNum"` // ssiInputPrice SsiInputPrice float64 `form:"ssiInputPrice" json:"ssiInputPrice" yaml:"ssiInputPrice" xml:"ssiInputPrice"` // ssiIr SsiIr int `form:"ssiIr" json:"ssiIr" yaml:"ssiIr" xml:"ssiIr"` // ssiLabel SsiLabel string `form:"ssiLabel" json:"ssiLabel" yaml:"ssiLabel" xml:"ssiLabel"` // ssiProductType SsiProductType string `form:"ssiProductType" json:"ssiProductType" yaml:"ssiProductType" xml:"ssiProductType"` // ssiProductTypeId SsiProductTypeID int `form:"ssiProductTypeId" json:"ssiProductTypeId" yaml:"ssiProductTypeId" xml:"ssiProductTypeId"` // ssiSampleCountryCode SsiSampleCountryCode string `form:"ssiSampleCountryCode" json:"ssiSampleCountryCode" yaml:"ssiSampleCountryCode" xml:"ssiSampleCountryCode"` // ssiSampleCountryId SsiSampleCountryID string `form:"ssiSampleCountryId" json:"ssiSampleCountryId" yaml:"ssiSampleCountryId" xml:"ssiSampleCountryId"` // ssiTitle SsiTitle string `form:"ssiTitle" json:"ssiTitle" yaml:"ssiTitle" xml:"ssiTitle"` // ssiVendorUsed SsiVendorUsed string `form:"ssiVendorUsed" json:"ssiVendorUsed" yaml:"ssiVendorUsed" xml:"ssiVendorUsed"` // ssiVideosNum SsiVideosNum int `form:"ssiVideosNum" json:"ssiVideosNum" yaml:"ssiVideosNum" xml:"ssiVideosNum"` // vendorLine VendorLine bool `form:"vendorLine" json:"vendorLine" yaml:"vendorLine" xml:"vendorLine"` }
SalesOrderDetails ...
type SampleSource ¶
type SampleSource struct { CountryISOCode string `json:"countryISOCode"` LanguageISOCode string `json:"languageISOCode"` Sources []Sources `json:"sources"` }
SampleSource ...
type SampleSourceCategory ¶
type SampleSourceCategory struct {
SurveyTopic []string `json:"surveyTopics" valid:"required"`
}
SampleSourceCategory is a Sample source's allowed list of surveytopics
type Sort ¶
type Sort struct { Field QueryField Direction SortDirection }
Sort by top level fields only. Nested fields are not supported for sorting.
type SortDirection ¶
type SortDirection string
SortDirection (asc, desc)
const ( SortDirectionAsc SortDirection = "asc" SortDirectionDesc SortDirection = "desc" )
SortDirection values
type Sources ¶
type Sources struct { ID int `json:"id"` Name string `json:"name"` Category SampleSourceCategory `json:"category"` Default bool `json:"default"` }
Sources ...
type State ¶
type State string
State ...
const ( StateProvisioned State = "PROVISIONED" StateLaunched State = "LAUNCHED" StatePaused State = "PAUSED" StateClosed State = "CLOSED" StateCompleted State = "COMPLETED" StateAwaitingApproval State = "AWAITING_APPROVAL" StateInvoiced State = "INVOICED" StateQAApproved State = "QA_APPROVED" StateRejected State = "REJECTED" StateCancelled State = "CANCELLED" StateAwaitingApprovalPaused State = "AWAITING_APPROVAL_PAUSED" StateAwaitingClientApproval State = "AWAITING_CLIENT_APPROVAL" StateRejectedPaused State = "REJECTED_PAUSED" )
State values for Projects and LineItems
type StatusType ¶
type StatusType string
StatusType ...
const ( StatusTypeSuccess StatusType = "success" StatusTypeFail StatusType = "fail" StatusTypeUnknown StatusType = "unknown" )
StatusType values
type StringSlice ¶
type StringSlice []string
StringSlice ..
func (StringSlice) String ¶
func (ss StringSlice) String() string
type StudyMetadata ¶
type StudyMetadata struct { Category CategoryMetadata `json:"category"` DeliveryTypes []MetadataItem `json:"deliveryTypes"` }
StudyMetadata ...
type StudyMetadataResponse ¶
type StudyMetadataResponse struct { StudyMetadata StudyMetadata `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
StudyMetadataResponse ...
type SurveyTopic ¶
SurveyTopic ... Represents Survey Topic for a project. Required to setup a project
type SwitchCompanyCriteria ¶ added in v0.0.5
type SwitchCompanyCriteria struct { ClientID string `json:"clientId"` ClientSecret string `json:"clientSecret"` RefreshToken string `json:"refreshToken"` CompanyID int32 `json:"companyId"` }
SwitchCompanyCriteria ...
type TargetType ¶ added in v0.0.2
type TargetType string
TargetType ...
const (
TargetTypeComplete TargetType = "COMPLETE"
)
TargetType values
type Team ¶
type Team struct { ID int32 `json:"id"` Name string `json:"name"` Role string `json:"role"` Default bool `json:"default"` Status string `json:"status"` }
Team holds the information about a team associated to a company.
type TeamPermission ¶
type TeamPermission struct {
ID []int32 `json:"id" valid:"required"`
}
TeamPermission holds the team input to the upsert Project permissions.
type TeamsResponse ¶
type TeamsResponse struct { List []*CompanyTeam `json:"data"` ResponseStatus ResponseStatus `json:"status"` Meta Meta `json:"meta"` }
TeamsResponse holds api response object and returns a list of teams associated to a company.
type TemplateCriteria ¶
type TemplateCriteria struct { CountryISOCode string `json:"countryISOCode"` Description string `json:"description"` LanguageISOCode string `json:"languageISOCode"` Name string `json:"name"` QuotaPlan *QuotaPlan `json:"quotaPlan"` Tags []string `json:"tags"` }
TemplateCriteria ...
type TemplateData ¶
type TemplateData struct { CountryISOCode *string `json:"countryISOCode,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Description *string `json:"description,omitempty"` Editable bool `json:"editable"` ID int `json:"id"` LanguageISOCode *string `json:"languageISOCode,omitempty"` Name string `json:"name"` State string `json:"state"` Tags []string `json:"tags"` UpdatedAt *string `json:"updatedAt,omitempty"` QuotaPlan *QuotaPlan `json:"quotaPlan"` }
TemplateData ...
type TemplateResponse ¶
type TemplateResponse struct { Data *TemplateData `json:"data"` Meta *Meta `json:"meta"` Status *Status `json:"status"` }
TemplateResponse response
type TemplatesResponse ¶
type TemplatesResponse struct { Data []*TemplateData `json:"data"` Meta *Meta `json:"meta"` Status *Status `json:"status"` }
TemplatesResponse response
type TokenRequest ¶
type TokenRequest struct { ClientID string `json:"clientId"` Username string `json:"username"` Password string `json:"password"` }
TokenRequest contains parameters to obtain an access token
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"accessToken"` ExpiresIn uint `json:"expiresIn"` RefreshToken string `json:"refreshToken"` RefreshExpiresIn uint `json:"refreshExpiresIn"` Acquired *time.Time }
TokenResponse stores auth tokens
func (*TokenResponse) AccessTokenExpired ¶
func (t *TokenResponse) AccessTokenExpired() bool
AccessTokenExpired ...
func (*TokenResponse) RefreshTokenExpired ¶
func (t *TokenResponse) RefreshTokenExpired() bool
RefreshTokenExpired ...
type URLParameter ¶
URLParameter ...
type UpdateLineItemCriteria ¶
type UpdateLineItemCriteria struct { ExtLineItemID string `json:"extLineItemId"` Title *string `json:"title,omitempty" valid:"optional"` CountryISOCode *string `json:"countryISOCode,omitempty" valid:"optional,ISO3166Alpha2"` LanguageISOCode *string `json:"languageISOCode,omitempty" valid:"optional,languageISOCode"` SurveyURL *string `json:"surveyURL,omitempty" valid:"optional,surveyURL"` SurveyTestURL *string `json:"surveyTestURL,omitempty" valid:"optional"` IndicativeIncidence *float64 `json:"indicativeIncidence,omitempty" valid:"optional"` DaysInField *int64 `json:"daysInField,omitempty" valid:"optional"` FieldSchedule *Schedule `json:"fieldSchedule" valid:"optional"` LengthOfInterview *int64 `json:"lengthOfInterview,omitempty" valid:"optional"` DeliveryType *string `json:"deliveryType" valid:"optional"` QuotaPlan *QuotaPlan `json:"quotaPlan,omitempty" valid:"optional,quotaPlan"` SurveyURLParams []*URLParameter `json:"surveyURLParams" valid:"optional"` SurveyTestURLParams []*URLParameter `json:"surveyTestURLParams" valid:"optional"` Sources *[]*LineItemSource `json:"sources,omitempty" valid:"optional"` Targets []*LineItemTarget `json:"targets"` SurveyTestingNotes *string `json:"surveyTestingNotes,omitempty" valid:"optional"` }
UpdateLineItemCriteria has the fields to update a LineItem
type UpdateLineItemStateResponse ¶
type UpdateLineItemStateResponse struct { LineItem *LineItem `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
UpdateLineItemStateResponse ...
type UpdateProjectCriteria ¶
type UpdateProjectCriteria struct { ExtProjectID string `json:"extProjectId" valid:"required"` Title *string `json:"title,omitempty" valid:"optional"` NotificationEmails *[]string `json:"notificationEmails,omitempty" valid:"email,optional"` JobNumber *string `json:"jobNumber,omitempty" valid:"optional"` Devices *[]DeviceType `json:"devices,omitempty" valid:"DeviceType,optional"` Category *Category `json:"category,omitempty" valid:"optional"` LineItems *[]*UpdateLineItemCriteria `json:"lineItems,omitempty" valid:"optional"` Exclusions *Exclusions `json:"exclusions,omitempty" valid:"optional"` RespondentFilters *[]RespondentFilter `json:"respondentFilters,omitempty" valid:"optional"` }
UpdateProjectCriteria has the fields to update a project
type UpsertPermissionsCriteria ¶
type UpsertPermissionsCriteria struct { ExtProjectID string `json:"extProjectId" valid:"required"` UserPermissions *[]*UserPermission `json:"users" valid:"optional"` TeamPermissions *[]*TeamPermission `json:"teams" valid:"optional"` }
UpsertPermissionsCriteria has the fields to update and insert project permissions
type User ¶
type User struct { Applications []Application `json:"applications"` CompanyID int32 `json:"companyId"` CompanyName string `json:"companyName"` Email string `json:"email"` Username string `json:"username"` FullName string `json:"fullName"` }
User to hold any information related to the user.
type UserData ¶
type UserData struct { ID int32 `json:"id"` Username string `json:"username"` Role string `json:"role"` }
UserData holds the information of the users associated to a project
type UserDetails ¶ added in v0.0.5
type UserDetails struct { ID int32 `json:"id,omitempty"` Email string `json:"email"` Username string `json:"userName"` FullName string `json:"fullName"` Companies []Company `json:"companies"` }
User to hold any information related to the user.
type UserDetailsResponse ¶ added in v0.0.5
type UserDetailsResponse struct { User *UserDetails `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
UserResponse to hold the api response object.
type UserPermission ¶
type UserPermission struct { ID int32 `json:"id" valid:"required"` Role string `json:"role" valid:"required"` }
UserPermission holds the user input to the upsert Project permissions.
type UserResponse ¶
type UserResponse struct { User *User `json:"data"` ResponseStatus ResponseStatus `json:"status"` }
UserResponse to hold the api response object.
type ValueCount ¶
type ValueCount struct {
QuotaCells []*FeasibilityQuotaCell `json:"quotaCells"`
}
ValueCount ...