schema

package
v0.0.0-...-6cc63a5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 17

Documentation

Overview

Package schema provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.8.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Constraint

type Constraint struct {
	AllowedValues []SegmenterValues `json:"allowed_values"`
	Options       *SegmenterOptions `json:"options,omitempty"`
	PreRequisites []PreRequisite    `json:"pre_requisites"`
}

Constraint defines model for Constraint.

type Error

type Error struct {
	Code    string `json:"code"`
	Error   string `json:"error"`
	Message string `json:"message"`
}

Error defines model for Error.

type Experiment

type Experiment struct {
	CreatedAt   *time.Time         `json:"created_at,omitempty"`
	Description *string            `json:"description"`
	EndTime     *time.Time         `json:"end_time,omitempty"`
	Id          *int64             `json:"id,omitempty"`
	Interval    *int32             `json:"interval"`
	Name        *string            `json:"name,omitempty"`
	ProjectId   *int64             `json:"project_id,omitempty"`
	Segment     *ExperimentSegment `json:"segment,omitempty"`
	StartTime   *time.Time         `json:"start_time,omitempty"`
	Status      *ExperimentStatus  `json:"status,omitempty"`

	// The user-friendly classification of experiment statuses. The categories are
	// self-explanatory. Note that the current time plays a role in the definition
	// of some of these statuses.
	StatusFriendly *ExperimentStatusFriendly `json:"status_friendly,omitempty"`
	Tier           *ExperimentTier           `json:"tier,omitempty"`
	Treatments     *[]ExperimentTreatment    `json:"treatments,omitempty"`
	Type           *ExperimentType           `json:"type,omitempty"`
	UpdatedAt      *time.Time                `json:"updated_at,omitempty"`
	UpdatedBy      *string                   `json:"updated_by,omitempty"`
	Version        *int64                    `json:"version,omitempty"`
}

Experiment defines model for Experiment.

type ExperimentField

type ExperimentField string

ExperimentField defines model for ExperimentField.

const (
	ExperimentFieldEndTime ExperimentField = "end_time"

	ExperimentFieldId ExperimentField = "id"

	ExperimentFieldName ExperimentField = "name"

	ExperimentFieldStartTime ExperimentField = "start_time"

	ExperimentFieldStatusFriendly ExperimentField = "status_friendly"

	ExperimentFieldTier ExperimentField = "tier"

	ExperimentFieldTreatments ExperimentField = "treatments"

	ExperimentFieldType ExperimentField = "type"

	ExperimentFieldUpdatedAt ExperimentField = "updated_at"
)

Defines values for ExperimentField.

type ExperimentHistory

type ExperimentHistory struct {
	CreatedAt    time.Time             `json:"created_at"`
	Description  *string               `json:"description"`
	EndTime      time.Time             `json:"end_time"`
	ExperimentId int64                 `json:"experiment_id"`
	Id           int64                 `json:"id"`
	Interval     *int32                `json:"interval"`
	Name         string                `json:"name"`
	Segment      ExperimentSegment     `json:"segment"`
	StartTime    time.Time             `json:"start_time"`
	Status       ExperimentStatus      `json:"status"`
	Tier         ExperimentTier        `json:"tier"`
	Treatments   []ExperimentTreatment `json:"treatments"`
	Type         ExperimentType        `json:"type"`
	UpdatedAt    time.Time             `json:"updated_at"`
	UpdatedBy    string                `json:"updated_by"`
	Version      int64                 `json:"version"`
}

ExperimentHistory defines model for ExperimentHistory.

type ExperimentSegment

type ExperimentSegment map[string]interface{}

ExperimentSegment defines model for ExperimentSegment.

type ExperimentStatus

type ExperimentStatus string

ExperimentStatus defines model for ExperimentStatus.

const (
	ExperimentStatusActive ExperimentStatus = "active"

	ExperimentStatusInactive ExperimentStatus = "inactive"
)

Defines values for ExperimentStatus.

type ExperimentStatusFriendly

type ExperimentStatusFriendly string

The user-friendly classification of experiment statuses. The categories are self-explanatory. Note that the current time plays a role in the definition of some of these statuses.

const (
	ExperimentStatusFriendlyCompleted ExperimentStatusFriendly = "completed"

	ExperimentStatusFriendlyDeactivated ExperimentStatusFriendly = "deactivated"

	ExperimentStatusFriendlyRunning ExperimentStatusFriendly = "running"

	ExperimentStatusFriendlyScheduled ExperimentStatusFriendly = "scheduled"
)

Defines values for ExperimentStatusFriendly.

type ExperimentTier

type ExperimentTier string

ExperimentTier defines model for ExperimentTier.

const (
	ExperimentTierDefault ExperimentTier = "default"

	ExperimentTierOverride ExperimentTier = "override"
)

Defines values for ExperimentTier.

type ExperimentTreatment

type ExperimentTreatment struct {

	// Configuration associated with the given treatment
	Configuration map[string]interface{} `json:"configuration"`

	// Name of the treatment
	Name string `json:"name"`

	// When the experiment is matched, the % traffic to be directed to the treatment.
	// Optional for Switchback Experiments.
	Traffic *int32 `json:"traffic,omitempty"`
}

ExperimentTreatment defines model for ExperimentTreatment.

type ExperimentType

type ExperimentType string

ExperimentType defines model for ExperimentType.

const (
	ExperimentTypeAB ExperimentType = "A/B"

	ExperimentTypeSwitchback ExperimentType = "Switchback"
)

Defines values for ExperimentType.

type MessageQueueConfig

type MessageQueueConfig struct {

	// Kind of message queue
	Kind   *MessageQueueKind `json:"kind,omitempty"`
	PubSub *PubSub           `json:"pub_sub,omitempty"`
}

MessageQueueConfig defines model for MessageQueueConfig.

type MessageQueueKind

type MessageQueueKind string

Kind of message queue

const (
	MessageQueueKindNoop MessageQueueKind = "noop"

	MessageQueueKindPubsub MessageQueueKind = "pubsub"
)

Defines values for MessageQueueKind.

type Paging

type Paging struct {

	// Number of the current page
	Page int32 `json:"page"`

	// Total number of pages
	Pages int32 `json:"pages"`

	// Total number of results matching the query criteria
	Total int32 `json:"total"`
}

Paging defines model for Paging.

type PreRequisite

type PreRequisite struct {
	SegmenterName   string            `json:"segmenter_name"`
	SegmenterValues []SegmenterValues `json:"segmenter_values"`
}

PreRequisite defines model for PreRequisite.

type Project

type Project struct {
	CreatedAt        time.Time `json:"created_at"`
	Id               int64     `json:"id"`
	RandomizationKey string    `json:"randomization_key"`
	Segmenters       []string  `json:"segmenters"`
	UpdatedAt        time.Time `json:"updated_at"`
	Username         string    `json:"username"`
}

Project defines model for Project.

type ProjectSegmenters

type ProjectSegmenters struct {

	// List of segmenters name within Project, in priority order.
	Names []string `json:"names"`

	// Mapping of segmenter to the configured experiment variables
	Variables ProjectSegmenters_Variables `json:"variables"`
}

ProjectSegmenters defines model for ProjectSegmenters.

type ProjectSegmenters_Variables

type ProjectSegmenters_Variables struct {
	AdditionalProperties map[string][]string `json:"-"`
}

Mapping of segmenter to the configured experiment variables

func (ProjectSegmenters_Variables) Get

func (a ProjectSegmenters_Variables) Get(fieldName string) (value []string, found bool)

Getter for additional properties for ProjectSegmenters_Variables. Returns the specified element and whether it was found

func (ProjectSegmenters_Variables) MarshalJSON

func (a ProjectSegmenters_Variables) MarshalJSON() ([]byte, error)

Override default JSON handling for ProjectSegmenters_Variables to handle AdditionalProperties

func (*ProjectSegmenters_Variables) Set

func (a *ProjectSegmenters_Variables) Set(fieldName string, value []string)

Setter for additional properties for ProjectSegmenters_Variables

func (*ProjectSegmenters_Variables) UnmarshalJSON

func (a *ProjectSegmenters_Variables) UnmarshalJSON(b []byte) error

Override default JSON handling for ProjectSegmenters_Variables to handle AdditionalProperties

type ProjectSettings

type ProjectSettings struct {
	CreatedAt            time.Time         `json:"created_at"`
	EnableS2idClustering bool              `json:"enable_s2id_clustering"`
	Passkey              string            `json:"passkey"`
	ProjectId            int64             `json:"project_id"`
	RandomizationKey     string            `json:"randomization_key"`
	Segmenters           ProjectSegmenters `json:"segmenters"`

	// Object containing information to define a valid treatment schema
	TreatmentSchema *TreatmentSchema `json:"treatment_schema,omitempty"`
	UpdatedAt       time.Time        `json:"updated_at"`
	Username        string           `json:"username"`
	ValidationUrl   *string          `json:"validation_url,omitempty"`
}

ProjectSettings defines model for ProjectSettings.

type PubSub

type PubSub struct {

	// Project name of the PubSub subscription
	Project *string `json:"project,omitempty"`

	// Topic name of the PubSub subscription
	TopicName *string `json:"topic_name,omitempty"`
}

PubSub defines model for PubSub.

type Rule

type Rule struct {
	Name string `json:"name"`

	// A Go template expression that must return a boolean value
	Predicate string `json:"predicate"`
}

A rule that forms part of a definition of a valid treatment schema

type Rules

type Rules []Rule

List of rules that define a valid treatment schema

type Segment

type Segment struct {
	CreatedAt *time.Time         `json:"created_at,omitempty"`
	Id        *int64             `json:"id,omitempty"`
	Name      *string            `json:"name,omitempty"`
	ProjectId *int64             `json:"project_id,omitempty"`
	Segment   *ExperimentSegment `json:"segment,omitempty"`
	UpdatedAt *time.Time         `json:"updated_at,omitempty"`
	UpdatedBy *string            `json:"updated_by,omitempty"`
}

Segment defines model for Segment.

type SegmentField

type SegmentField string

SegmentField defines model for SegmentField.

const (
	SegmentFieldId SegmentField = "id"

	SegmentFieldName SegmentField = "name"
)

Defines values for SegmentField.

type SegmentHistory

type SegmentHistory struct {
	CreatedAt time.Time         `json:"created_at"`
	Id        int64             `json:"id"`
	Name      string            `json:"name"`
	Segment   ExperimentSegment `json:"segment"`
	SegmentId int64             `json:"segment_id"`
	UpdatedAt time.Time         `json:"updated_at"`
	UpdatedBy string            `json:"updated_by"`
	Version   int64             `json:"version"`
}

SegmentHistory defines model for SegmentHistory.

type Segmenter

type Segmenter struct {
	Constraints []Constraint     `json:"constraints"`
	CreatedAt   *time.Time       `json:"created_at,omitempty"`
	Description *string          `json:"description,omitempty"`
	MultiValued bool             `json:"multi_valued"`
	Name        string           `json:"name"`
	Options     SegmenterOptions `json:"options"`
	Required    bool             `json:"required"`
	Scope       *SegmenterScope  `json:"scope,omitempty"`
	Status      *SegmenterStatus `json:"status,omitempty"`

	// List of varying combination of variables in which this segmenter is can be derived from
	TreatmentRequestFields [][]string    `json:"treatment_request_fields"`
	Type                   SegmenterType `json:"type"`
	UpdatedAt              *time.Time    `json:"updated_at,omitempty"`
}

Segmenter defines model for Segmenter.

type SegmenterConfig

type SegmenterConfig map[string]interface{}

SegmenterConfig defines model for SegmenterConfig.

type SegmenterOptions

type SegmenterOptions struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

SegmenterOptions defines model for SegmenterOptions.

func (SegmenterOptions) Get

func (a SegmenterOptions) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for SegmenterOptions. Returns the specified element and whether it was found

func (SegmenterOptions) MarshalJSON

func (a SegmenterOptions) MarshalJSON() ([]byte, error)

Override default JSON handling for SegmenterOptions to handle AdditionalProperties

func (*SegmenterOptions) Set

func (a *SegmenterOptions) Set(fieldName string, value interface{})

Setter for additional properties for SegmenterOptions

func (*SegmenterOptions) UnmarshalJSON

func (a *SegmenterOptions) UnmarshalJSON(b []byte) error

Override default JSON handling for SegmenterOptions to handle AdditionalProperties

type SegmenterScope

type SegmenterScope string

SegmenterScope defines model for SegmenterScope.

const (
	SegmenterScopeGlobal SegmenterScope = "global"

	SegmenterScopeProject SegmenterScope = "project"
)

Defines values for SegmenterScope.

type SegmenterStatus

type SegmenterStatus string

SegmenterStatus defines model for SegmenterStatus.

const (
	SegmenterStatusActive SegmenterStatus = "active"

	SegmenterStatusInactive SegmenterStatus = "inactive"
)

Defines values for SegmenterStatus.

type SegmenterType

type SegmenterType string

SegmenterType defines model for SegmenterType.

const (
	SegmenterTypeBool SegmenterType = "bool"

	SegmenterTypeInteger SegmenterType = "integer"

	SegmenterTypeReal SegmenterType = "real"

	SegmenterTypeString SegmenterType = "string"
)

Defines values for SegmenterType.

type SegmenterValues

type SegmenterValues interface{}

SegmenterValues defines model for SegmenterValues.

type SelectedTreatment

type SelectedTreatment struct {
	ExperimentId   int64                     `json:"experiment_id"`
	ExperimentName string                    `json:"experiment_name"`
	Metadata       SelectedTreatmentMetadata `json:"metadata"`
	Treatment      SelectedTreatmentData     `json:"treatment"`
}

SelectedTreatment defines model for SelectedTreatment.

type SelectedTreatmentData

type SelectedTreatmentData struct {

	// Custom configuration associated with the given treatment
	Configuration map[string]interface{} `json:"configuration"`
	Id            *int64                 `json:"id,omitempty"`

	// Name of the treatment
	Name string `json:"name"`

	// When the experiment is matched, the % traffic to be directed to the treatment.
	// Optional for Switchback Experiments.
	Traffic *int32 `json:"traffic,omitempty"`
}

SelectedTreatmentData defines model for SelectedTreatmentData.

type SelectedTreatmentMetadata

type SelectedTreatmentMetadata struct {
	ExperimentType    ExperimentType `json:"experiment_type"`
	ExperimentVersion int64          `json:"experiment_version"`

	// The window id since the beginning of the current version of the Switchback experiment.
	// This field will only be set for Switchback experiments and the window id starts at 0.
	SwitchbackWindowId *int64 `json:"switchback_window_id,omitempty"`
}

SelectedTreatmentMetadata defines model for SelectedTreatmentMetadata.

type Treatment

type Treatment struct {
	Configuration *map[string]interface{} `json:"configuration,omitempty"`
	CreatedAt     *time.Time              `json:"created_at,omitempty"`
	Id            *int64                  `json:"id,omitempty"`
	Name          *string                 `json:"name,omitempty"`
	ProjectId     *int64                  `json:"project_id,omitempty"`
	UpdatedAt     *time.Time              `json:"updated_at,omitempty"`
	UpdatedBy     *string                 `json:"updated_by,omitempty"`
}

Treatment defines model for Treatment.

type TreatmentField

type TreatmentField string

TreatmentField defines model for TreatmentField.

const (
	TreatmentFieldId TreatmentField = "id"

	TreatmentFieldName TreatmentField = "name"
)

Defines values for TreatmentField.

type TreatmentHistory

type TreatmentHistory struct {
	Configuration map[string]interface{} `json:"configuration"`
	CreatedAt     time.Time              `json:"created_at"`
	Id            int64                  `json:"id"`
	Name          string                 `json:"name"`
	TreatmentId   int64                  `json:"treatment_id"`
	UpdatedAt     time.Time              `json:"updated_at"`
	UpdatedBy     string                 `json:"updated_by"`
	Version       int64                  `json:"version"`
}

TreatmentHistory defines model for TreatmentHistory.

type TreatmentSchema

type TreatmentSchema struct {

	// List of rules that define a valid treatment schema
	Rules Rules `json:"rules"`
}

Object containing information to define a valid treatment schema

type TreatmentServiceConfig

type TreatmentServiceConfig struct {
	MessageQueueConfig *MessageQueueConfig `json:"message_queue_config,omitempty"`
	SegmenterConfig    *SegmenterConfig    `json:"segmenter_config,omitempty"`
}

TreatmentServiceConfig defines model for TreatmentServiceConfig.

Jump to

Keyboard shortcuts

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