samplify

package
v0.0.0-...-4575f22 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionLaunched        Action          = "launch"
	ActionPaused          Action          = "pause"
	ActionClosed          Action          = "close"
	QCellStatusTypeLaunch QCellStatusType = "LAUNCHED"
	QCellStatusTypePause  QCellStatusType = "PAUSED"
)

Action values for changing LineItem state

View Source
const (
	TimeLayout = "2006/01/02 15:04:05"
	// DateLayout ...
	DateLayout = "2006/01/02"
)
View Source
const (
	URLMaxLength = 2000
	URLMinLength = 3
)

Constants ...

View Source
const (
	// TierStandard is the constant defined for Standard Tier in Attribute
	TierStandard = "Standard"
)

Variables

View Source
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

View Source
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")
)
View Source
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

View Source
var (
	ErrEventActionNotApplicable = errors.New("requested action is not applicable for this event")
)

Event errors

View Source
var ErrIncorrectEnvironemt = errors.New("one of local/dev/uat/prod only are allowed")

ErrIncorrectEnvironemt ...

View Source
var ErrSessionExpired = errors.New("session expired")

ErrSessionExpired ... Returns if both Access and Refresh tokens are expired

RespondentFilterTypes ...

RespondentScheduleTypes ...

RespondentStatuses ...

Functions

func AppendURLScheme

func AppendURLScheme(baseURL string) string

AppendURLScheme appends URL scheme

func IsCountryCodeOrEmpty

func IsCountryCodeOrEmpty(countryCode string) error

IsCountryCodeOrEmpty ...

func IsLanguageCodeOrEmpty

func IsLanguageCodeOrEmpty(languageCode string) error

IsLanguageCodeOrEmpty ...

func RemoveWhiteSpace

func RemoveWhiteSpace(obj struct{})

RemoveWhiteSpace function is trimming the object

func Validate

func Validate(obj interface{}) error

Validate ...

func ValidateAction

func ValidateAction(action Action) error

ValidateAction ...

func ValidateDeviceType

func ValidateDeviceType(val DeviceType) error

ValidateDeviceType ...

func ValidateEmail

func ValidateEmail(email ...string) error

ValidateEmail ...

func ValidateExclusionType

func ValidateExclusionType(val ExclusionType) error

ValidateExclusionType ...

func ValidateLanguageISOCode

func ValidateLanguageISOCode(val string) error

ValidateLanguageISOCode ...

func ValidateNotEmpty

func ValidateNotEmpty(values ...string) error

ValidateNotEmpty ...

func ValidateNotNull

func ValidateNotNull(obj interface{}) error

ValidateNotNull ...

func ValidateQuotaPlan

func ValidateQuotaPlan(val *QuotaPlan) error

ValidateQuotaPlan ...

func ValidateSchedule

func ValidateSchedule(daysInField *int64, fieldSchedule *Schedule) error

func ValidateStruct

func ValidateStruct(obj interface{}) error

ValidateStruct ...

func ValidateSurveyLink(baseURL string) error

ValidateSurveyLink ...

func ValidateSurveyURL

func ValidateSurveyURL(val string) error

ValidateSurveyURL ...

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

func SendRequestWithContext(ctx context.Context, host, method, url, accessToken string, body interface{}, timeout int) (*APIResponse, error)

SendRequestWithContext exposing sendrequest to enable custom requests

type Action

type Action string

Action ...

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

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

type CheckOrderNumber struct {
	Availability bool `json:"availability"`
}

type CheckOrderNumberResponse

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
}

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, opts ...ExtraOption) (*Client, error)

NewClientFromEnv returns an API client.

func (*Client) AcceptEvent

func (c *Client) AcceptEvent(event *Event) error

AcceptEvent ...

func (*Client) AcceptEventWithContext

func (c *Client) AcceptEventWithContext(ctx context.Context, event *Event) error

AcceptEventWithContext ...

func (*Client) AddLineItem

func (c *Client) AddLineItem(extProjectID string, lineItem *CreateLineItemCriteria) (*LineItemResponse, error)

AddLineItem ...

func (*Client) AddLineItemWithContext

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

func (c *Client) BuyProjectWithContext(ctx context.Context, extProjectID string, buy []*BuyProjectCriteria) (*BuyProjectResponse, error)

BuyProjectWithContext ...

func (*Client) CheckOrderNumber

func (c *Client) CheckOrderNumber(ordNumber string) (bool, error)

CheckOrderNumber ...

func (*Client) CheckOrderNumberWithContext

func (c *Client) CheckOrderNumberWithContext(ctx context.Context, ordNumber string) (bool, error)

CheckOrderNumberWithContext ...

func (*Client) CloseLineItem

func (c *Client) CloseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)

CloseLineItem utility function to close a lineitem

func (*Client) CloseLineItemWithContext

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

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

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

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

func (c *Client) CreateTemplateWithContext(ctx context.Context, template *TemplateCriteria) (*TemplateResponse, error)

CreateTemplateWithContext ...

func (*Client) DeleteTemplate

func (c *Client) DeleteTemplate(id int) (*AppError, error)

DeleteTemplate ...

func (*Client) DeleteTemplateWithContext

func (c *Client) DeleteTemplateWithContext(ctx context.Context, id int) (*AppError, error)

DeleteTemplateWithContext ...

func (*Client) GetAllLineItems

func (c *Client) GetAllLineItems(extProjectID string, options *QueryOptions) (*GetAllLineItemsResponse, error)

GetAllLineItems ...

func (*Client) GetAllLineItemsWithContext

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

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

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) GetAuth

func (c *Client) GetAuth() (TokenResponse, error)

GetAuth ...

func (*Client) GetAuthWithContext

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

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

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

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

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

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

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

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

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

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

func (c *Client) GetLineItemByWithContext(ctx context.Context, extProjectID, extLineItemID string) (*LineItemResponse, error)

GetLineItemByWithContext ...

func (*Client) GetOrderDetails

func (c *Client) GetOrderDetails(ordNumber string) (*OrderDetailResponse, error)

GetOrderDetails ...

func (*Client) GetOrderDetailsWithContext

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

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

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

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

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

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

func (c *Client) GetTemplateListWithContext(ctx context.Context, country string, lang string, options *QueryOptions) (*TemplatesResponse, error)

GetTemplateListWithContext ...

func (*Client) GetUserDetails

func (c *Client) GetUserDetails() (*UserDetailsResponse, error)

GetUserDetails ...

func (*Client) GetUserDetailsWithContext

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

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

func (c *Client) LaunchLineItemWithContext(ctx context.Context, pid, lid string) (*UpdateLineItemStateResponse, error)

LaunchLineItemWithContext utility function to launch a line item

func (*Client) Logout

func (c *Client) Logout() error

Logout ...

func (*Client) LogoutWithContext

func (c *Client) LogoutWithContext(ctx context.Context) error

LogoutWithContext ...

func (*Client) PauseLineItem

func (c *Client) PauseLineItem(pid, lid string) (*UpdateLineItemStateResponse, error)

PauseLineItem utility function to pause a lineitem

func (*Client) PauseLineItemWithContext

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

func (c *Client) ProjectPermissionsWithContext(ctx context.Context, extProjectID string) (*ProjectPermissionsResponse, error)

ProjectPermissionsWithContext gives information about the user that is currently logged in.

func (*Client) RefreshToken

func (c *Client) RefreshToken() error

RefreshToken ...

func (*Client) RefreshTokenWithContext

func (c *Client) RefreshTokenWithContext(ctx context.Context) error

RefreshTokenWithContext ...

func (*Client) RejectEvent

func (c *Client) RejectEvent(event *Event) error

RejectEvent ...

func (*Client) RejectEventWithContext

func (c *Client) RejectEventWithContext(ctx context.Context, event *Event) error

RejectEventWithContext ...

func (*Client) Roles

func (c *Client) Roles(options *QueryOptions) (*RolesResponse, error)

Roles returns the roles specified in the filter.

func (*Client) RolesWithContext

func (c *Client) RolesWithContext(ctx context.Context, options *QueryOptions) (*RolesResponse, error)

RolesWithContext returns the roles specified in the filter.

func (*Client) SetOptions

func (c *Client) SetOptions(env string, timeout int) error

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

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

func (c *Client) SwitchCompany(criteria *SwitchCompanyCriteria) error

SwitchCompany ...

func (*Client) SwitchCompanyWithContext

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

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

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

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

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

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

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

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"`
	InternalURL string `conform:"trim"`
	StatusURL   string `conform:"trim"`
	GatewayURL  string `conform:"trim"`
	Timeout     *int
	// contains filtered or unexported fields
}

ClientOptions ...

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 CostType

type CostType string

CostType ...

const (
	CostTypeBase    CostType = "BASE"
	CostTypePremium CostType = "PREMIUM"
)

CostType for the different types of 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"`
	RequiredCompletes   int64             `json:"requiredCompletes" valid:"required"`
	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"`
	CostPerInterview    float64           `json:"costPerInterview,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

type CustomTime struct {
	time.Time
}

CustomTime ...

func (*CustomTime) IsSet

func (ct *CustomTime) IsSet() bool

IsSet ...

func (*CustomTime) MarshalJSON

func (ct *CustomTime) MarshalJSON() (text []byte, err error)

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON ...

type DateFilterValue

type DateFilterValue struct {
	From *time.Time
	To   *time.Time
}

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 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 Error

type Error struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

Error ...

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 ...

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

Error ...

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

type EventReason struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

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 EventType

type EventType string

EventType ...

const (
	EventLineItemRepriceTriggered EventType = "LineItem:RepriceTriggered"
	EventLineItemRepriceAccepted  EventType = "LineItem:RepriceAccepted"
	EventLineItemRepriceRejected  EventType = "LineItem:RepriceRejected"
)

EventType values

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 ExtraOption

type ExtraOption func(*extraOptions)

func WithRetry

func WithRetry(attempts int) ExtraOption

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 IntSlice

type IntSlice []int

IntSlice ...

func (IntSlice) String

func (is IntSlice) String() string

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"`
	RequiredCompletes   int64             `json:"requiredCompletes"`
	QuotaPlan           *QuotaPlan        `json:"quotaPlan"`
	EndLinks            *EndLinks         `json:"endLinks"`
	SurveyURLParams     []*URLParameter   `json:"surveyURLParams"`
	Sources             []*LineItemSource `json:"sources"`
	Targets             []*LineItemTarget `json:"targets"`
	SurveyTestingNotes  string            `json:"surveyTestingNotes"`
	CostPerInterview    float64           `json:"costPerInterview"`
}

LineItem ...

func (*LineItem) IsBuyable

func (l *LineItem) IsBuyable() bool

IsBuyable returns true if the lineitem can be bought or not

func (*LineItem) IsCloseable

func (l *LineItem) IsCloseable() bool

IsCloseable returns false if the line item cannot be updated.

func (*LineItem) IsRebalanceable

func (l *LineItem) IsRebalanceable() bool

IsRebalanceable returns false if the line item cannot be updated.

func (*LineItem) IsUpdateable

func (l *LineItem) IsUpdateable() bool

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

type LineItemSource struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

LineItemSource source associated with the lineitem.

type LineItemTarget

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 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 Operator

type Operator string

Operator operator for the filters.

const (
	// OperatorInclude to include all the respondents that match the given options
	OperatorInclude Operator = "include"
	// OperatorExclude to exclude all the respondents that match the given options
	OperatorExclude Operator = "exclude"
)

func (Operator) ToUpper

func (o Operator) ToUpper() string

ToUpper converts the operator to upper case.

type OrderDetail

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

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

func (p *Project) IsUserSubscribed(email string) bool

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 QCellStatusType

type QCellStatusType string

QCellStatusType ...

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 `conform:"trim"`
	ExtLineItemId *string `conform:"trim"`
	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 QuotaNode

type QuotaNode struct {
	AttributeID string   `json:"attributeId"`
	Options     []string `json:"options"`
}

QuotaNode ...

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 QuoteType

type QuoteType string

QuoteType ...

const (
	// TypeBase ...
	TypeBase QuoteType = "BASE"
	// TypePremium ...
	TypePremium QuoteType = "PREMIUM"
)

type Reconcile

type Reconcile struct {
	File        []byte `json:"data"`
	Description string `json:"description"`
}

Reconcile ... Represents Request correction file

type RelativeType

type RelativeType int

RelativeType ...

const (
	RelativeTypeDays   RelativeType = 1
	RelativeTypeWeeks  RelativeType = 7
	RelativeTypeMonths RelativeType = 30
)

RelativeType values

type Resource

type Resource struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

Resource ...

type RespondentFilter

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

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

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

func (rf *RespondentFilter) PopulateProjects(extProjectIDs []string) error

PopulateProjects is appending projects to the respondent filter list, existing projects are ignored

func (*RespondentFilter) SetDates

func (rf *RespondentFilter) SetDates(start *time.Time, end *time.Time)

SetDates sets start and end dates

func (*RespondentFilter) ValidateDates

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

type RespondentFilterSchedule struct {
	Type      string  `json:"type"`
	Value     int32   `json:"value"`
	StartDate *string `json:"startDate"`
	EndDate   *string `json:"endDate"`
}

type RespondentFilterType

type RespondentFilterType string

RespondentFilterType ...

const (
	RespondentFilterTypeProject  RespondentFilterType = "PROJECT"
	RespondentFilterTypeTag      RespondentFilterType = "TAG"
	RespondentFilterTypeCategory RespondentFilterType = "CATEGORY"
)

RespondentFilterType values

type RespondentScheduleType

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

type RespondentStatus string
const (
	RespondentStatusCompleted  RespondentStatus = "COMPLETED"
	RespondentStatusOverQuota  RespondentStatus = "OVERQUOTA"
	RespondentStatusScreenOut  RespondentStatus = "SCREENOUT"
	RespondentStatusInComplete RespondentStatus = "INCOMPLETE"
)

type ResponseStatus

type ResponseStatus struct {
	Message string      `json:"message"`
	Errors  []ErrorInfo `json:"errors"`
}

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

type RolesResponse struct {
	Roles []Role `json:"data"`
	Meta  Meta   `json:"meta"`
}

RolesResponse ...

type SalesOrder

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

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 Schedule

type Schedule struct {
	StartTime string `json:"startTime"`
	EndTime   string `json:"endTime"`
}

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

func (State) String

func (s State) String() string

type Status

type Status struct {
	Errors  []*ErrorType `json:"errors"`
	Message string       `json:"message"`
}

Status user type.

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

type SurveyTopic struct {
	Topic       string `json:"topic"`
	Description string `json:"description"`
}

SurveyTopic ... Represents Survey Topic for a project. Required to setup a project

type SwitchCompanyCriteria

type SwitchCompanyCriteria struct {
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	RefreshToken string `json:"refreshToken"`
	CompanyID    int32  `json:"companyId"`
}

SwitchCompanyCriteria ...

type TargetType

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 TeamData

type TeamData struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

TeamData holds the information of the teams associated to a project

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

type URLParameter struct {
	Key    string   `json:"key"`
	Values []string `json:"values"`
}

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"`
	RequiredCompletes   *int64             `json:"requiredCompletes,omitempty" 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

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

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 Value

type Value interface {
	String() string
}

Value ...

type ValueCount

type ValueCount struct {
	QuotaCells []*FeasibilityQuotaCell `json:"quotaCells"`
}

ValueCount ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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