flags

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.

Index

Constants

View Source
const (
	HTTPBearerScopes = "HTTPBearer.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateFlagRequest

func NewCreateFlagRequest(server string, body CreateFlagJSONRequestBody) (*http.Request, error)

NewCreateFlagRequest calls the generic CreateFlag builder with application/json body

func NewCreateFlagRequestWithBody

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

NewCreateFlagRequestWithBody generates requests for CreateFlag with any type of body

func NewDeleteFlagRequest

func NewDeleteFlagRequest(server string, id openapi_types.UUID) (*http.Request, error)

NewDeleteFlagRequest generates requests for DeleteFlag

func NewGetFlagRequest

func NewGetFlagRequest(server string, id openapi_types.UUID) (*http.Request, error)

NewGetFlagRequest generates requests for GetFlag

func NewListFlagsRequest

func NewListFlagsRequest(server string, params *ListFlagsParams) (*http.Request, error)

NewListFlagsRequest generates requests for ListFlags

func NewUpdateFlagRequest

func NewUpdateFlagRequest(server string, id openapi_types.UUID, body UpdateFlagJSONRequestBody) (*http.Request, error)

NewUpdateFlagRequest calls the generic UpdateFlag builder with application/json body

func NewUpdateFlagRequestWithBody

func NewUpdateFlagRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error)

NewUpdateFlagRequestWithBody generates requests for UpdateFlag with any type of body

Types

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

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

func (*Client) CreateFlagWithBody

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

func (*Client) DeleteFlag

func (c *Client) DeleteFlag(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetFlag

func (c *Client) GetFlag(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListFlags

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

func (*Client) UpdateFlag

func (c *Client) UpdateFlag(ctx context.Context, id openapi_types.UUID, body UpdateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateFlagWithBody

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

type ClientInterface

type ClientInterface interface {
	// ListFlags request
	ListFlags(ctx context.Context, params *ListFlagsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateFlagWithBody request with any body
	CreateFlagWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateFlag(ctx context.Context, body CreateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteFlag request
	DeleteFlag(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFlag request
	GetFlag(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateFlagWithBody request with any body
	UpdateFlagWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateFlag(ctx context.Context, id openapi_types.UUID, body UpdateFlagJSONRequestBody, 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) CreateFlagWithBodyWithResponse

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

CreateFlagWithBodyWithResponse request with arbitrary body returning *CreateFlagResponse

func (*ClientWithResponses) CreateFlagWithResponse

func (c *ClientWithResponses) CreateFlagWithResponse(ctx context.Context, body CreateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFlagResponse, error)

func (*ClientWithResponses) DeleteFlagWithResponse

func (c *ClientWithResponses) DeleteFlagWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteFlagResponse, error)

DeleteFlagWithResponse request returning *DeleteFlagResponse

func (*ClientWithResponses) GetFlagWithResponse

func (c *ClientWithResponses) GetFlagWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetFlagResponse, error)

GetFlagWithResponse request returning *GetFlagResponse

func (*ClientWithResponses) ListFlagsWithResponse

func (c *ClientWithResponses) ListFlagsWithResponse(ctx context.Context, params *ListFlagsParams, reqEditors ...RequestEditorFn) (*ListFlagsResponse, error)

ListFlagsWithResponse request returning *ListFlagsResponse

func (*ClientWithResponses) UpdateFlagWithBodyWithResponse

func (c *ClientWithResponses) UpdateFlagWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFlagResponse, error)

UpdateFlagWithBodyWithResponse request with arbitrary body returning *UpdateFlagResponse

func (*ClientWithResponses) UpdateFlagWithResponse

func (c *ClientWithResponses) UpdateFlagWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFlagResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListFlagsWithResponse request
	ListFlagsWithResponse(ctx context.Context, params *ListFlagsParams, reqEditors ...RequestEditorFn) (*ListFlagsResponse, error)

	// CreateFlagWithBodyWithResponse request with any body
	CreateFlagWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFlagResponse, error)

	CreateFlagWithResponse(ctx context.Context, body CreateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFlagResponse, error)

	// DeleteFlagWithResponse request
	DeleteFlagWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteFlagResponse, error)

	// GetFlagWithResponse request
	GetFlagWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetFlagResponse, error)

	// UpdateFlagWithBodyWithResponse request with any body
	UpdateFlagWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFlagResponse, error)

	UpdateFlagWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateFlagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFlagResponse, error)
}

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

type CreateFlagJSONRequestBody

type CreateFlagJSONRequestBody = ResponseFlag

CreateFlagJSONRequestBody defines body for CreateFlag for application/json ContentType.

type CreateFlagResponse

type CreateFlagResponse struct {
	Body                     []byte
	HTTPResponse             *http.Response
	ApplicationvndApiJSON201 *FlagResponse
	ApplicationvndApiJSON422 *HTTPValidationError
}

func ParseCreateFlagResponse

func ParseCreateFlagResponse(rsp *http.Response) (*CreateFlagResponse, error)

ParseCreateFlagResponse parses an HTTP response from a CreateFlagWithResponse call

func (CreateFlagResponse) Status

func (r CreateFlagResponse) Status() string

Status returns HTTPResponse.Status

func (CreateFlagResponse) StatusCode

func (r CreateFlagResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteFlagResponse

type DeleteFlagResponse struct {
	Body                     []byte
	HTTPResponse             *http.Response
	ApplicationvndApiJSON422 *HTTPValidationError
}

func ParseDeleteFlagResponse

func ParseDeleteFlagResponse(rsp *http.Response) (*DeleteFlagResponse, error)

ParseDeleteFlagResponse parses an HTTP response from a DeleteFlagWithResponse call

func (DeleteFlagResponse) Status

func (r DeleteFlagResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteFlagResponse) StatusCode

func (r DeleteFlagResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Flag

type Flag struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Default Default value; must reference a value in the values array
	Default      interface{}                 `json:"default"`
	Description  *string                     `json:"description,omitempty"`
	Environments *map[string]FlagEnvironment `json:"environments,omitempty"`

	// Key Unique key within account
	Key string `json:"key"`

	// Name Human-readable display name
	Name string `json:"name"`

	// Type Value type: STRING, BOOLEAN, NUMERIC, or JSON
	Type      string     `json:"type"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// Values Closed set of possible values
	Values []FlagValue `json:"values"`
}

Flag defines model for Flag.

type FlagEnvironment

type FlagEnvironment struct {
	Default interface{} `json:"default,omitempty"`
	Enabled *bool       `json:"enabled,omitempty"`
	Rules   *[]FlagRule `json:"rules,omitempty"`
}

FlagEnvironment defines model for FlagEnvironment.

type FlagListResponse

type FlagListResponse struct {
	Data []FlagResource `json:"data"`
}

FlagListResponse defines model for FlagListResponse.

type FlagResource

type FlagResource struct {
	Attributes Flag             `json:"attributes"`
	Id         *string          `json:"id,omitempty"`
	Type       FlagResourceType `json:"type"`
}

FlagResource defines model for FlagResource.

type FlagResourceType added in v1.3.1

type FlagResourceType string

FlagResourceType defines model for FlagResource.Type.

const (
	FlagResourceTypeFlag FlagResourceType = "flag"
)

Defines values for FlagResourceType.

func (FlagResourceType) Valid added in v1.3.1

func (e FlagResourceType) Valid() bool

Valid indicates whether the value is a known member of the FlagResourceType enum.

type FlagResponse

type FlagResponse struct {
	Data FlagResource `json:"data"`
}

FlagResponse defines model for FlagResponse.

type FlagRule

type FlagRule struct {
	Description *string                `json:"description,omitempty"`
	Logic       map[string]interface{} `json:"logic"`
	Value       interface{}            `json:"value"`
}

FlagRule defines model for FlagRule.

type FlagValue

type FlagValue struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

FlagValue defines model for FlagValue.

type GetFlagResponse

type GetFlagResponse struct {
	Body                     []byte
	HTTPResponse             *http.Response
	ApplicationvndApiJSON200 *FlagResponse
	ApplicationvndApiJSON422 *HTTPValidationError
}

func ParseGetFlagResponse

func ParseGetFlagResponse(rsp *http.Response) (*GetFlagResponse, error)

ParseGetFlagResponse parses an HTTP response from a GetFlagWithResponse call

func (GetFlagResponse) Status

func (r GetFlagResponse) Status() string

Status returns HTTPResponse.Status

func (GetFlagResponse) StatusCode

func (r GetFlagResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPValidationError

type HTTPValidationError struct {
	Detail *[]ValidationError `json:"detail,omitempty"`
}

HTTPValidationError defines model for HTTPValidationError.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListFlagsParams

type ListFlagsParams struct {
	FilterKey  *string `form:"filter[key],omitempty" json:"filter[key],omitempty"`
	FilterType *string `form:"filter[type],omitempty" json:"filter[type],omitempty"`
}

ListFlagsParams defines parameters for ListFlags.

type ListFlagsResponse

type ListFlagsResponse struct {
	Body                     []byte
	HTTPResponse             *http.Response
	ApplicationvndApiJSON200 *FlagListResponse
	ApplicationvndApiJSON422 *HTTPValidationError
}

func ParseListFlagsResponse

func ParseListFlagsResponse(rsp *http.Response) (*ListFlagsResponse, error)

ParseListFlagsResponse parses an HTTP response from a ListFlagsWithResponse call

func (ListFlagsResponse) Status

func (r ListFlagsResponse) Status() string

Status returns HTTPResponse.Status

func (ListFlagsResponse) StatusCode

func (r ListFlagsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ResourceFlag

type ResourceFlag struct {
	Attributes Flag    `json:"attributes"`
	Id         *string `json:"id,omitempty"`
	Type       *string `json:"type,omitempty"`
}

ResourceFlag defines model for Resource_Flag_.

type ResponseFlag

type ResponseFlag struct {
	Data ResourceFlag `json:"data"`
}

ResponseFlag defines model for Response_Flag_.

type UpdateFlagJSONRequestBody

type UpdateFlagJSONRequestBody = ResponseFlag

UpdateFlagJSONRequestBody defines body for UpdateFlag for application/json ContentType.

type UpdateFlagResponse

type UpdateFlagResponse struct {
	Body                     []byte
	HTTPResponse             *http.Response
	ApplicationvndApiJSON200 *FlagResponse
	ApplicationvndApiJSON422 *HTTPValidationError
}

func ParseUpdateFlagResponse

func ParseUpdateFlagResponse(rsp *http.Response) (*UpdateFlagResponse, error)

ParseUpdateFlagResponse parses an HTTP response from a UpdateFlagWithResponse call

func (UpdateFlagResponse) Status

func (r UpdateFlagResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateFlagResponse) StatusCode

func (r UpdateFlagResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ValidationError

type ValidationError struct {
	Loc  []ValidationError_Loc_Item `json:"loc"`
	Msg  string                     `json:"msg"`
	Type string                     `json:"type"`
}

ValidationError defines model for ValidationError.

type ValidationErrorLoc0

type ValidationErrorLoc0 = string

ValidationErrorLoc0 defines model for .

type ValidationErrorLoc1

type ValidationErrorLoc1 = int

ValidationErrorLoc1 defines model for .

type ValidationError_Loc_Item

type ValidationError_Loc_Item struct {
	// contains filtered or unexported fields
}

ValidationError_Loc_Item defines model for ValidationError.loc.Item.

func (ValidationError_Loc_Item) AsValidationErrorLoc0

func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)

AsValidationErrorLoc0 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc0

func (ValidationError_Loc_Item) AsValidationErrorLoc1

func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)

AsValidationErrorLoc1 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc1

func (*ValidationError_Loc_Item) FromValidationErrorLoc0

func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error

FromValidationErrorLoc0 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) FromValidationErrorLoc1

func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error

FromValidationErrorLoc1 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc1

func (ValidationError_Loc_Item) MarshalJSON

func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error)

func (*ValidationError_Loc_Item) MergeValidationErrorLoc0

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error

MergeValidationErrorLoc0 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) MergeValidationErrorLoc1

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error

MergeValidationErrorLoc1 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc1

func (*ValidationError_Loc_Item) UnmarshalJSON

func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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