client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

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

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

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

Index

Constants

View Source
const (
	ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewAuthenticateRequest

func NewAuthenticateRequest(server string, body AuthenticateJSONRequestBody) (*http.Request, error)

NewAuthenticateRequest calls the generic Authenticate builder with application/json body

func NewAuthenticateRequestWithBody

func NewAuthenticateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewAuthenticateRequestWithBody generates requests for Authenticate with any type of body

func NewGetAllSegmentsRequest

func NewGetAllSegmentsRequest(server string, environmentUUID string, params *GetAllSegmentsParams) (*http.Request, error)

NewGetAllSegmentsRequest generates requests for GetAllSegments

func NewGetEvaluationByIdentifierRequest

func NewGetEvaluationByIdentifierRequest(server string, environmentUUID string, target string, feature string, params *GetEvaluationByIdentifierParams) (*http.Request, error)

NewGetEvaluationByIdentifierRequest generates requests for GetEvaluationByIdentifier

func NewGetEvaluationsRequest

func NewGetEvaluationsRequest(server string, environmentUUID string, target string, params *GetEvaluationsParams) (*http.Request, error)

NewGetEvaluationsRequest generates requests for GetEvaluations

func NewGetFeatureConfigByIdentifierRequest

func NewGetFeatureConfigByIdentifierRequest(server string, environmentUUID string, identifier string, params *GetFeatureConfigByIdentifierParams) (*http.Request, error)

NewGetFeatureConfigByIdentifierRequest generates requests for GetFeatureConfigByIdentifier

func NewGetFeatureConfigRequest

func NewGetFeatureConfigRequest(server string, environmentUUID string, params *GetFeatureConfigParams) (*http.Request, error)

NewGetFeatureConfigRequest generates requests for GetFeatureConfig

func NewGetSegmentByIdentifierRequest

func NewGetSegmentByIdentifierRequest(server string, environmentUUID string, identifier string, params *GetSegmentByIdentifierParams) (*http.Request, error)

NewGetSegmentByIdentifierRequest generates requests for GetSegmentByIdentifier

func NewPostMetricsRequest

func NewPostMetricsRequest(server string, environmentUUID EnvironmentPathParam, params *PostMetricsParams, body PostMetricsJSONRequestBody) (*http.Request, error)

NewPostMetricsRequest calls the generic PostMetrics builder with application/json body

func NewPostMetricsRequestWithBody

func NewPostMetricsRequestWithBody(server string, environmentUUID EnvironmentPathParam, params *PostMetricsParams, contentType string, body io.Reader) (*http.Request, error)

NewPostMetricsRequestWithBody generates requests for PostMetrics with any type of body

func NewStreamRequest

func NewStreamRequest(server string, params *StreamParams) (*http.Request, error)

NewStreamRequest generates requests for Stream

Types

type AuthenticateJSONBody

type AuthenticateJSONBody = AuthenticationRequest

AuthenticateJSONBody defines parameters for Authenticate.

type AuthenticateJSONRequestBody

type AuthenticateJSONRequestBody = AuthenticateJSONBody

AuthenticateJSONRequestBody defines body for Authenticate for application/json ContentType.

type AuthenticateResponse

type AuthenticateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AuthenticationResponse
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

func ParseAuthenticateResponse

func ParseAuthenticateResponse(rsp *http.Response) (*AuthenticateResponse, error)

ParseAuthenticateResponse parses an HTTP response from a AuthenticateWithResponse call

func (AuthenticateResponse) Status

func (r AuthenticateResponse) Status() string

Status returns HTTPResponse.Status

func (AuthenticateResponse) StatusCode

func (r AuthenticateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AuthenticationRequest

type AuthenticationRequest struct {
	ApiKey string `json:"apiKey"`
	Target *struct {
		Anonymous  *bool                   `json:"anonymous,omitempty"`
		Attributes *map[string]interface{} `json:"attributes,omitempty"`
		Identifier string                  `json:"identifier"`
		Name       *string                 `json:"name,omitempty"`
	} `json:"target,omitempty"`
}

AuthenticationRequest defines model for AuthenticationRequest.

type AuthenticationResponse

type AuthenticationResponse struct {
	AuthToken string `json:"authToken"`
}

AuthenticationResponse defines model for AuthenticationResponse.

type Clause

type Clause struct {
	// The attribute to use in the clause.  This can be any target attribute
	Attribute string `json:"attribute"`

	// The unique ID for the clause
	Id *string `json:"id,omitempty"`

	// Is the operation negated?
	Negate bool `json:"negate"`

	// The type of operation such as equals, starts_with, contains
	Op string `json:"op"`

	// The values that are compared against the operator
	Values []string `json:"values"`
}

A clause describes what conditions are used to evaluate a flag

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) Authenticate

func (c *Client) Authenticate(ctx context.Context, body AuthenticateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AuthenticateWithBody

func (c *Client) AuthenticateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAllSegments

func (c *Client) GetAllSegments(ctx context.Context, environmentUUID string, params *GetAllSegmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetEvaluationByIdentifier

func (c *Client) GetEvaluationByIdentifier(ctx context.Context, environmentUUID string, target string, feature string, params *GetEvaluationByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetEvaluations

func (c *Client) GetEvaluations(ctx context.Context, environmentUUID string, target string, params *GetEvaluationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetFeatureConfig

func (c *Client) GetFeatureConfig(ctx context.Context, environmentUUID string, params *GetFeatureConfigParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetFeatureConfigByIdentifier

func (c *Client) GetFeatureConfigByIdentifier(ctx context.Context, environmentUUID string, identifier string, params *GetFeatureConfigByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetSegmentByIdentifier

func (c *Client) GetSegmentByIdentifier(ctx context.Context, environmentUUID string, identifier string, params *GetSegmentByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostMetrics

func (c *Client) PostMetrics(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, body PostMetricsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostMetricsWithBody

func (c *Client) PostMetricsWithBody(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Stream

func (c *Client) Stream(ctx context.Context, params *StreamParams, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Authenticate request with any body
	AuthenticateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Authenticate(ctx context.Context, body AuthenticateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFeatureConfig request
	GetFeatureConfig(ctx context.Context, environmentUUID string, params *GetFeatureConfigParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFeatureConfigByIdentifier request
	GetFeatureConfigByIdentifier(ctx context.Context, environmentUUID string, identifier string, params *GetFeatureConfigByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAllSegments request
	GetAllSegments(ctx context.Context, environmentUUID string, params *GetAllSegmentsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSegmentByIdentifier request
	GetSegmentByIdentifier(ctx context.Context, environmentUUID string, identifier string, params *GetSegmentByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetEvaluations request
	GetEvaluations(ctx context.Context, environmentUUID string, target string, params *GetEvaluationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetEvaluationByIdentifier request
	GetEvaluationByIdentifier(ctx context.Context, environmentUUID string, target string, feature string, params *GetEvaluationByIdentifierParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostMetrics request with any body
	PostMetricsWithBody(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostMetrics(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, body PostMetricsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Stream request
	Stream(ctx context.Context, params *StreamParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AuthenticateWithBodyWithResponse

func (c *ClientWithResponses) AuthenticateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

AuthenticateWithBodyWithResponse request with arbitrary body returning *AuthenticateResponse

func (*ClientWithResponses) AuthenticateWithResponse

func (c *ClientWithResponses) AuthenticateWithResponse(ctx context.Context, body AuthenticateJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

func (*ClientWithResponses) GetAllSegmentsWithResponse

func (c *ClientWithResponses) GetAllSegmentsWithResponse(ctx context.Context, environmentUUID string, params *GetAllSegmentsParams, reqEditors ...RequestEditorFn) (*GetAllSegmentsResponse, error)

GetAllSegmentsWithResponse request returning *GetAllSegmentsResponse

func (*ClientWithResponses) GetEvaluationByIdentifierWithResponse

func (c *ClientWithResponses) GetEvaluationByIdentifierWithResponse(ctx context.Context, environmentUUID string, target string, feature string, params *GetEvaluationByIdentifierParams, reqEditors ...RequestEditorFn) (*GetEvaluationByIdentifierResponse, error)

GetEvaluationByIdentifierWithResponse request returning *GetEvaluationByIdentifierResponse

func (*ClientWithResponses) GetEvaluationsWithResponse

func (c *ClientWithResponses) GetEvaluationsWithResponse(ctx context.Context, environmentUUID string, target string, params *GetEvaluationsParams, reqEditors ...RequestEditorFn) (*GetEvaluationsResponse, error)

GetEvaluationsWithResponse request returning *GetEvaluationsResponse

func (*ClientWithResponses) GetFeatureConfigByIdentifierWithResponse

func (c *ClientWithResponses) GetFeatureConfigByIdentifierWithResponse(ctx context.Context, environmentUUID string, identifier string, params *GetFeatureConfigByIdentifierParams, reqEditors ...RequestEditorFn) (*GetFeatureConfigByIdentifierResponse, error)

GetFeatureConfigByIdentifierWithResponse request returning *GetFeatureConfigByIdentifierResponse

func (*ClientWithResponses) GetFeatureConfigWithResponse

func (c *ClientWithResponses) GetFeatureConfigWithResponse(ctx context.Context, environmentUUID string, params *GetFeatureConfigParams, reqEditors ...RequestEditorFn) (*GetFeatureConfigResponse, error)

GetFeatureConfigWithResponse request returning *GetFeatureConfigResponse

func (*ClientWithResponses) GetSegmentByIdentifierWithResponse

func (c *ClientWithResponses) GetSegmentByIdentifierWithResponse(ctx context.Context, environmentUUID string, identifier string, params *GetSegmentByIdentifierParams, reqEditors ...RequestEditorFn) (*GetSegmentByIdentifierResponse, error)

GetSegmentByIdentifierWithResponse request returning *GetSegmentByIdentifierResponse

func (*ClientWithResponses) PostMetricsWithBodyWithResponse

func (c *ClientWithResponses) PostMetricsWithBodyWithResponse(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostMetricsResponse, error)

PostMetricsWithBodyWithResponse request with arbitrary body returning *PostMetricsResponse

func (*ClientWithResponses) PostMetricsWithResponse

func (c *ClientWithResponses) PostMetricsWithResponse(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, body PostMetricsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMetricsResponse, error)

func (*ClientWithResponses) StreamWithResponse

func (c *ClientWithResponses) StreamWithResponse(ctx context.Context, params *StreamParams, reqEditors ...RequestEditorFn) (*StreamResponse, error)

StreamWithResponse request returning *StreamResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Authenticate request with any body
	AuthenticateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

	AuthenticateWithResponse(ctx context.Context, body AuthenticateJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthenticateResponse, error)

	// GetFeatureConfig request
	GetFeatureConfigWithResponse(ctx context.Context, environmentUUID string, params *GetFeatureConfigParams, reqEditors ...RequestEditorFn) (*GetFeatureConfigResponse, error)

	// GetFeatureConfigByIdentifier request
	GetFeatureConfigByIdentifierWithResponse(ctx context.Context, environmentUUID string, identifier string, params *GetFeatureConfigByIdentifierParams, reqEditors ...RequestEditorFn) (*GetFeatureConfigByIdentifierResponse, error)

	// GetAllSegments request
	GetAllSegmentsWithResponse(ctx context.Context, environmentUUID string, params *GetAllSegmentsParams, reqEditors ...RequestEditorFn) (*GetAllSegmentsResponse, error)

	// GetSegmentByIdentifier request
	GetSegmentByIdentifierWithResponse(ctx context.Context, environmentUUID string, identifier string, params *GetSegmentByIdentifierParams, reqEditors ...RequestEditorFn) (*GetSegmentByIdentifierResponse, error)

	// GetEvaluations request
	GetEvaluationsWithResponse(ctx context.Context, environmentUUID string, target string, params *GetEvaluationsParams, reqEditors ...RequestEditorFn) (*GetEvaluationsResponse, error)

	// GetEvaluationByIdentifier request
	GetEvaluationByIdentifierWithResponse(ctx context.Context, environmentUUID string, target string, feature string, params *GetEvaluationByIdentifierParams, reqEditors ...RequestEditorFn) (*GetEvaluationByIdentifierResponse, error)

	// PostMetrics request with any body
	PostMetricsWithBodyWithResponse(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostMetricsResponse, error)

	PostMetricsWithResponse(ctx context.Context, environmentUUID EnvironmentPathParam, params *PostMetricsParams, body PostMetricsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMetricsResponse, error)

	// Stream request
	StreamWithResponse(ctx context.Context, params *StreamParams, reqEditors ...RequestEditorFn) (*StreamResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type ClusterQueryOptionalParam

type ClusterQueryOptionalParam = string

ClusterQueryOptionalParam defines model for clusterQueryOptionalParam.

type Distribution

type Distribution struct {
	// The attribute to use when distributing targets across buckets
	BucketBy string `json:"bucketBy"`

	// A list of variations and the weight that should be given to each
	Variations []WeightedVariation `json:"variations"`
}

Describes a distribution rule

type EnvironmentPathParam

type EnvironmentPathParam = string

EnvironmentPathParam defines model for environmentPathParam.

type Error

type Error struct {
	// The http error code
	Code string `json:"code"`

	// Additional details about the error
	Details *map[string]interface{} `json:"details,omitempty"`

	// The reason the request failed
	Message string `json:"message"`
}

Error defines model for Error.

type Evaluation

type Evaluation struct {
	Flag       string  `json:"flag"`
	Identifier *string `json:"identifier,omitempty"`
	Kind       string  `json:"kind"`
	Value      string  `json:"value"`
}

Evaluation defines model for Evaluation.

type Evaluations

type Evaluations = []Evaluation

Evaluations defines model for Evaluations.

type FeatureConfig

type FeatureConfig struct {
	// Describe the distribution rule and the variation that should be served to the target
	DefaultServe  Serve             `json:"defaultServe"`
	Environment   string            `json:"environment"`
	Feature       string            `json:"feature"`
	Kind          FeatureConfigKind `json:"kind"`
	OffVariation  string            `json:"offVariation"`
	Prerequisites *[]Prerequisite   `json:"prerequisites,omitempty"`
	Project       string            `json:"project"`
	Rules         *[]ServingRule    `json:"rules,omitempty"`

	// The state of a flag either off or on
	State                FeatureState    `json:"state"`
	VariationToTargetMap *[]VariationMap `json:"variationToTargetMap,omitempty"`
	Variations           []Variation     `json:"variations"`
	Version              *int64          `json:"version,omitempty"`
}

FeatureConfig defines model for FeatureConfig.

type FeatureConfigKind

type FeatureConfigKind string

FeatureConfigKind defines model for FeatureConfig.Kind.

const (
	Boolean FeatureConfigKind = "boolean"
	Int     FeatureConfigKind = "int"
	Json    FeatureConfigKind = "json"
	String  FeatureConfigKind = "string"
)

Defines values for FeatureConfigKind.

type FeatureState

type FeatureState string

The state of a flag either off or on

const (
	Off FeatureState = "off"
	On  FeatureState = "on"
)

Defines values for FeatureState.

type GetAllSegmentsParams

type GetAllSegmentsParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetAllSegmentsParams defines parameters for GetAllSegments.

type GetAllSegmentsResponse

type GetAllSegmentsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Segment
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

func ParseGetAllSegmentsResponse

func ParseGetAllSegmentsResponse(rsp *http.Response) (*GetAllSegmentsResponse, error)

ParseGetAllSegmentsResponse parses an HTTP response from a GetAllSegmentsWithResponse call

func (GetAllSegmentsResponse) Status

func (r GetAllSegmentsResponse) Status() string

Status returns HTTPResponse.Status

func (GetAllSegmentsResponse) StatusCode

func (r GetAllSegmentsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetEvaluationByIdentifierParams

type GetEvaluationByIdentifierParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetEvaluationByIdentifierParams defines parameters for GetEvaluationByIdentifier.

type GetEvaluationByIdentifierResponse

type GetEvaluationByIdentifierResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Evaluation
}

func ParseGetEvaluationByIdentifierResponse

func ParseGetEvaluationByIdentifierResponse(rsp *http.Response) (*GetEvaluationByIdentifierResponse, error)

ParseGetEvaluationByIdentifierResponse parses an HTTP response from a GetEvaluationByIdentifierWithResponse call

func (GetEvaluationByIdentifierResponse) Status

Status returns HTTPResponse.Status

func (GetEvaluationByIdentifierResponse) StatusCode

func (r GetEvaluationByIdentifierResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetEvaluationsParams

type GetEvaluationsParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetEvaluationsParams defines parameters for GetEvaluations.

type GetEvaluationsResponse

type GetEvaluationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// The total number of items
		ItemCount int `json:"itemCount"`

		// The total number of pages
		PageCount int `json:"pageCount"`

		// The current page
		PageIndex int `json:"pageIndex"`

		// The number of items per page
		PageSize int `json:"pageSize"`

		// The version of this object.  The version will be incremented each time the object is modified
		Version *int `json:"version,omitempty"`
	}
}

func ParseGetEvaluationsResponse

func ParseGetEvaluationsResponse(rsp *http.Response) (*GetEvaluationsResponse, error)

ParseGetEvaluationsResponse parses an HTTP response from a GetEvaluationsWithResponse call

func (GetEvaluationsResponse) Status

func (r GetEvaluationsResponse) Status() string

Status returns HTTPResponse.Status

func (GetEvaluationsResponse) StatusCode

func (r GetEvaluationsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFeatureConfigByIdentifierParams

type GetFeatureConfigByIdentifierParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetFeatureConfigByIdentifierParams defines parameters for GetFeatureConfigByIdentifier.

type GetFeatureConfigByIdentifierResponse

type GetFeatureConfigByIdentifierResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *FeatureConfig
}

func ParseGetFeatureConfigByIdentifierResponse

func ParseGetFeatureConfigByIdentifierResponse(rsp *http.Response) (*GetFeatureConfigByIdentifierResponse, error)

ParseGetFeatureConfigByIdentifierResponse parses an HTTP response from a GetFeatureConfigByIdentifierWithResponse call

func (GetFeatureConfigByIdentifierResponse) Status

Status returns HTTPResponse.Status

func (GetFeatureConfigByIdentifierResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetFeatureConfigParams

type GetFeatureConfigParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetFeatureConfigParams defines parameters for GetFeatureConfig.

type GetFeatureConfigResponse

type GetFeatureConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]FeatureConfig
}

func ParseGetFeatureConfigResponse

func ParseGetFeatureConfigResponse(rsp *http.Response) (*GetFeatureConfigResponse, error)

ParseGetFeatureConfigResponse parses an HTTP response from a GetFeatureConfigWithResponse call

func (GetFeatureConfigResponse) Status

func (r GetFeatureConfigResponse) Status() string

Status returns HTTPResponse.Status

func (GetFeatureConfigResponse) StatusCode

func (r GetFeatureConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSegmentByIdentifierParams

type GetSegmentByIdentifierParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

GetSegmentByIdentifierParams defines parameters for GetSegmentByIdentifier.

type GetSegmentByIdentifierResponse

type GetSegmentByIdentifierResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Segment
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

func ParseGetSegmentByIdentifierResponse

func ParseGetSegmentByIdentifierResponse(rsp *http.Response) (*GetSegmentByIdentifierResponse, error)

ParseGetSegmentByIdentifierResponse parses an HTTP response from a GetSegmentByIdentifierWithResponse call

func (GetSegmentByIdentifierResponse) Status

Status returns HTTPResponse.Status

func (GetSegmentByIdentifierResponse) StatusCode

func (r GetSegmentByIdentifierResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InternalServerError

type InternalServerError = Error

InternalServerError defines model for InternalServerError.

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KeyValue defines model for KeyValue.

type Metrics

type Metrics struct {
	MetricsData *[]MetricsData `json:"metricsData,omitempty"`
	TargetData  *[]TargetData  `json:"targetData,omitempty"`
}

Metrics defines model for Metrics.

type MetricsData

type MetricsData struct {
	Attributes []KeyValue `json:"attributes"`
	Count      int        `json:"count"`

	// This can be of type FeatureMetrics
	MetricsType MetricsDataMetricsType `json:"metricsType"`

	// time at when this data was recorded
	Timestamp int64 `json:"timestamp"`
}

MetricsData defines model for MetricsData.

type MetricsDataMetricsType

type MetricsDataMetricsType string

This can be of type FeatureMetrics

const (
	FFMETRICS MetricsDataMetricsType = "FFMETRICS"
)

Defines values for MetricsDataMetricsType.

type NotFound

type NotFound = Error

NotFound defines model for NotFound.

type Pagination

type Pagination struct {
	// The total number of items
	ItemCount int `json:"itemCount"`

	// The total number of pages
	PageCount int `json:"pageCount"`

	// The current page
	PageIndex int `json:"pageIndex"`

	// The number of items per page
	PageSize int `json:"pageSize"`

	// The version of this object.  The version will be incremented each time the object is modified
	Version *int `json:"version,omitempty"`
}

Pagination defines model for Pagination.

type PostMetricsJSONBody

type PostMetricsJSONBody = Metrics

PostMetricsJSONBody defines parameters for PostMetrics.

type PostMetricsJSONRequestBody

type PostMetricsJSONRequestBody = PostMetricsJSONBody

PostMetricsJSONRequestBody defines body for PostMetrics for application/json ContentType.

type PostMetricsParams

type PostMetricsParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
}

PostMetricsParams defines parameters for PostMetrics.

type PostMetricsResponse

type PostMetricsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *Error
	JSON403      *Error
	JSON500      *Error
}

func ParsePostMetricsResponse

func ParsePostMetricsResponse(rsp *http.Response) (*PostMetricsResponse, error)

ParsePostMetricsResponse parses an HTTP response from a PostMetricsWithResponse call

func (PostMetricsResponse) Status

func (r PostMetricsResponse) Status() string

Status returns HTTPResponse.Status

func (PostMetricsResponse) StatusCode

func (r PostMetricsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Prerequisite

type Prerequisite struct {
	// The feature identifier that is the prerequisite
	Feature string `json:"feature"`

	// A list of variations that must be met
	Variations []string `json:"variations"`
}

Feature Flag pre-requisites

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Segment

type Segment struct {
	// The data and time in milliseconds when the group was created
	CreatedAt *int64 `json:"createdAt,omitempty"`

	// The environment this target group belongs to
	Environment *string `json:"environment,omitempty"`

	// A list of Targets who are excluded from this target group
	Excluded *[]Target `json:"excluded,omitempty"`

	// Unique identifier for the target group.
	Identifier string `json:"identifier"`

	// A list of Targets who belong to this target group
	Included *[]Target `json:"included,omitempty"`

	// The data and time in milliseconds when the group was last modified
	ModifiedAt *int64 `json:"modifiedAt,omitempty"`

	// Name of the target group.
	Name string `json:"name"`

	// An array of rules that can cause a user to be included in this segment.
	Rules *[]Clause `json:"rules,omitempty"`

	// Tags for this target group
	Tags *[]Tag `json:"tags,omitempty"`

	// The version of this group.  Each time it is modified the version is incremented
	Version *int64 `json:"version,omitempty"`
}

A Target Group (Segment) response

type Serve

type Serve struct {
	// Describes a distribution rule
	Distribution *Distribution `json:"distribution,omitempty"`
	Variation    *string       `json:"variation,omitempty"`
}

Describe the distribution rule and the variation that should be served to the target

type ServingRule

type ServingRule struct {
	// A list of clauses to use in the rule
	Clauses []Clause `json:"clauses"`

	// The rules priority relative to other rules.  The rules are evaluated in order with 1 being the highest
	Priority int `json:"priority"`

	// The unique identifier for this rule
	RuleId *string `json:"ruleId,omitempty"`

	// Describe the distribution rule and the variation that should be served to the target
	Serve Serve `json:"serve"`
}

The rule used to determine what variation to serve to a target

type StreamParams

type StreamParams struct {
	// Unique identifier for the cluster for the account
	Cluster *ClusterQueryOptionalParam `form:"cluster,omitempty" json:"cluster,omitempty"`
	APIKey  string                     `json:"API-Key"`
}

StreamParams defines parameters for Stream.

type StreamResponse

type StreamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseStreamResponse

func ParseStreamResponse(rsp *http.Response) (*StreamResponse, error)

ParseStreamResponse parses an HTTP response from a StreamWithResponse call

func (StreamResponse) Status

func (r StreamResponse) Status() string

Status returns HTTPResponse.Status

func (StreamResponse) StatusCode

func (r StreamResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Tag

type Tag struct {
	// The name of the tag
	Name string `json:"name"`

	// The value of the tag
	Value *string `json:"value,omitempty"`
}

A tag has a name and value

type Target

type Target struct {
	// The account ID that the target belongs to
	Account string `json:"account"`

	// Indicates if this target is anonymous
	Anonymous *bool `json:"anonymous,omitempty"`

	// a JSON representation of the attributes for this target
	Attributes *map[string]interface{} `json:"attributes,omitempty"`

	// The date and time in milliseconds when this Target was created
	CreatedAt *int64 `json:"createdAt,omitempty"`

	// The identifier for the environment that the target belongs to
	Environment string `json:"environment"`

	// The unique identifier for this target
	Identifier string `json:"identifier"`

	// The name of this Target
	Name string `json:"name"`

	// The identifier for the organization that the target belongs to
	Org string `json:"org"`

	// The identifier for the project that this target belongs to
	Project string `json:"project"`

	// A list of Target Groups (Segments) that this Target belongs to
	Segments *[]Segment `json:"segments,omitempty"`
}

A Target object

type TargetData

type TargetData struct {
	Attributes []KeyValue `json:"attributes"`
	Identifier string     `json:"identifier"`
	Name       string     `json:"name"`
}

TargetData defines model for TargetData.

type TargetMap

type TargetMap struct {
	// The identifier for the target
	Identifier string `json:"identifier"`

	// The name of the target
	Name string `json:"name"`
}

Target map provides the details of a target that belongs to a flag

type Unauthenticated

type Unauthenticated = Error

Unauthenticated defines model for Unauthenticated.

type Unauthorized

type Unauthorized = Error

Unauthorized defines model for Unauthorized.

type Variation

type Variation struct {
	// A description of the variation
	Description *string `json:"description,omitempty"`

	// The unique identifier for the variation
	Identifier string `json:"identifier"`

	// The user friendly name of the variation
	Name *string `json:"name,omitempty"`

	// The variation value to serve such as true or false for a boolean flag
	Value string `json:"value"`
}

A variation of a flag that can be returned to a target

type VariationMap

type VariationMap struct {
	// A list of target groups (segments)
	TargetSegments *[]string `json:"targetSegments,omitempty"`

	// A list of target mappings
	Targets *[]TargetMap `json:"targets,omitempty"`

	// The variation identifier
	Variation string `json:"variation"`
}

A mapping of variations to targets and target groups (segments). The targets listed here should receive this variation.

type WeightedVariation

type WeightedVariation struct {
	// The variation identifier
	Variation string `json:"variation"`

	// The weight to be given to the variation in percent
	Weight int `json:"weight"`
}

A variation and the weighting it should receive as part of a percentage rollout

Jump to

Keyboard shortcuts

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