featuremanagement

package
v7.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContributedFeatureEnabledValueValues = contributedFeatureEnabledValueValuesType{

	Undefined: "undefined",

	Disabled: "disabled",

	Enabled: "enabled",
}

Functions

This section is empty.

Types

type Client

type Client interface {
	// [Preview API] Get a specific feature by its id
	GetFeature(context.Context, GetFeatureArgs) (*ContributedFeature, error)
	// [Preview API] Get a list of all defined features
	GetFeatures(context.Context, GetFeaturesArgs) (*[]ContributedFeature, error)
	// [Preview API] Get the state of the specified feature for the given user/all-users scope
	GetFeatureState(context.Context, GetFeatureStateArgs) (*ContributedFeatureState, error)
	// [Preview API] Get the state of the specified feature for the given named scope
	GetFeatureStateForScope(context.Context, GetFeatureStateForScopeArgs) (*ContributedFeatureState, error)
	// [Preview API] Get the effective state for a list of feature ids
	QueryFeatureStates(context.Context, QueryFeatureStatesArgs) (*ContributedFeatureStateQuery, error)
	// [Preview API] Get the states of the specified features for the default scope
	QueryFeatureStatesForDefaultScope(context.Context, QueryFeatureStatesForDefaultScopeArgs) (*ContributedFeatureStateQuery, error)
	// [Preview API] Get the states of the specified features for the specific named scope
	QueryFeatureStatesForNamedScope(context.Context, QueryFeatureStatesForNamedScopeArgs) (*ContributedFeatureStateQuery, error)
	// [Preview API] Set the state of a feature
	SetFeatureState(context.Context, SetFeatureStateArgs) (*ContributedFeatureState, error)
	// [Preview API] Set the state of a feature at a specific scope
	SetFeatureStateForScope(context.Context, SetFeatureStateForScopeArgs) (*ContributedFeatureState, error)
}

func NewClient

func NewClient(ctx context.Context, connection *azuredevops.Connection) Client

type ClientImpl

type ClientImpl struct {
	Client azuredevops.Client
}

func (*ClientImpl) GetFeature

func (client *ClientImpl) GetFeature(ctx context.Context, args GetFeatureArgs) (*ContributedFeature, error)

[Preview API] Get a specific feature by its id

func (*ClientImpl) GetFeatureState

func (client *ClientImpl) GetFeatureState(ctx context.Context, args GetFeatureStateArgs) (*ContributedFeatureState, error)

[Preview API] Get the state of the specified feature for the given user/all-users scope

func (*ClientImpl) GetFeatureStateForScope

func (client *ClientImpl) GetFeatureStateForScope(ctx context.Context, args GetFeatureStateForScopeArgs) (*ContributedFeatureState, error)

[Preview API] Get the state of the specified feature for the given named scope

func (*ClientImpl) GetFeatures

func (client *ClientImpl) GetFeatures(ctx context.Context, args GetFeaturesArgs) (*[]ContributedFeature, error)

[Preview API] Get a list of all defined features

func (*ClientImpl) QueryFeatureStates

func (client *ClientImpl) QueryFeatureStates(ctx context.Context, args QueryFeatureStatesArgs) (*ContributedFeatureStateQuery, error)

[Preview API] Get the effective state for a list of feature ids

func (*ClientImpl) QueryFeatureStatesForDefaultScope

func (client *ClientImpl) QueryFeatureStatesForDefaultScope(ctx context.Context, args QueryFeatureStatesForDefaultScopeArgs) (*ContributedFeatureStateQuery, error)

[Preview API] Get the states of the specified features for the default scope

func (*ClientImpl) QueryFeatureStatesForNamedScope

func (client *ClientImpl) QueryFeatureStatesForNamedScope(ctx context.Context, args QueryFeatureStatesForNamedScopeArgs) (*ContributedFeatureStateQuery, error)

[Preview API] Get the states of the specified features for the specific named scope

func (*ClientImpl) SetFeatureState

func (client *ClientImpl) SetFeatureState(ctx context.Context, args SetFeatureStateArgs) (*ContributedFeatureState, error)

[Preview API] Set the state of a feature

func (*ClientImpl) SetFeatureStateForScope

func (client *ClientImpl) SetFeatureStateForScope(ctx context.Context, args SetFeatureStateForScopeArgs) (*ContributedFeatureState, error)

[Preview API] Set the state of a feature at a specific scope

type ContributedFeature

type ContributedFeature struct {
	// Named links describing the feature
	Links interface{} `json:"_links,omitempty"`
	// If true, the feature is enabled unless overridden at some scope
	DefaultState *bool `json:"defaultState,omitempty"`
	// Rules for setting the default value if not specified by any setting/scope. Evaluated in order until a rule returns an Enabled or Disabled state (not Undefined)
	DefaultValueRules *[]ContributedFeatureValueRule `json:"defaultValueRules,omitempty"`
	// The description of the feature
	Description *string `json:"description,omitempty"`
	// Extra properties for the feature
	FeatureProperties *map[string]interface{} `json:"featureProperties,omitempty"`
	// Handler for listening to setter calls on feature value. These listeners are only invoked after a successful set has occurred
	FeatureStateChangedListeners *[]ContributedFeatureListener `json:"featureStateChangedListeners,omitempty"`
	// The full contribution id of the feature
	Id *string `json:"id,omitempty"`
	// If this is set to true, then the id for this feature will be added to the list of claims for the request.
	IncludeAsClaim *bool `json:"includeAsClaim,omitempty"`
	// The friendly name of the feature
	Name *string `json:"name,omitempty"`
	// Suggested order to display feature in.
	Order *int `json:"order,omitempty"`
	// Rules for overriding a feature value. These rules are run before explicit user/host state values are checked. They are evaluated in order until a rule returns an Enabled or Disabled state (not Undefined)
	OverrideRules *[]ContributedFeatureValueRule `json:"overrideRules,omitempty"`
	// The scopes/levels at which settings can set the enabled/disabled state of this feature
	Scopes *[]ContributedFeatureSettingScope `json:"scopes,omitempty"`
	// The service instance id of the service that owns this feature
	ServiceInstanceType *uuid.UUID `json:"serviceInstanceType,omitempty"`
	// Tags associated with the feature.
	Tags *[]string `json:"tags,omitempty"`
}

A feature that can be enabled or disabled

type ContributedFeatureEnabledValue

type ContributedFeatureEnabledValue string

The current state of a feature within a given scope

type ContributedFeatureHandlerSettings

type ContributedFeatureHandlerSettings struct {
	// Name of the handler to run
	Name *string `json:"name,omitempty"`
	// Properties to feed to the handler
	Properties *map[string]interface{} `json:"properties,omitempty"`
}

type ContributedFeatureListener

type ContributedFeatureListener struct {
	// Name of the handler to run
	Name *string `json:"name,omitempty"`
	// Properties to feed to the handler
	Properties *map[string]interface{} `json:"properties,omitempty"`
}

An identifier and properties used to pass into a handler for a listener or plugin

type ContributedFeatureSettingScope

type ContributedFeatureSettingScope struct {
	// The name of the settings scope to use when reading/writing the setting
	SettingScope *string `json:"settingScope,omitempty"`
	// Whether this is a user-scope or this is a host-wide (all users) setting
	UserScoped *bool `json:"userScoped,omitempty"`
}

The scope to which a feature setting applies

type ContributedFeatureState

type ContributedFeatureState struct {
	// The full contribution id of the feature
	FeatureId *string `json:"featureId,omitempty"`
	// True if the effective state was set by an override rule (indicating that the state cannot be managed by the end user)
	Overridden *bool `json:"overridden,omitempty"`
	// Reason that the state was set (by a plugin/rule).
	Reason *string `json:"reason,omitempty"`
	// The scope at which this state applies
	Scope *ContributedFeatureSettingScope `json:"scope,omitempty"`
	// The current state of this feature
	State *ContributedFeatureEnabledValue `json:"state,omitempty"`
}

A contributed feature/state pair

type ContributedFeatureStateQuery

type ContributedFeatureStateQuery struct {
	// The list of feature ids to query
	FeatureIds *[]string `json:"featureIds,omitempty"`
	// The query result containing the current feature states for each of the queried feature ids
	FeatureStates *map[string]ContributedFeatureState `json:"featureStates,omitempty"`
	// A dictionary of scope values (project name, etc.) to use in the query (if querying across scopes)
	ScopeValues *map[string]string `json:"scopeValues,omitempty"`
}

A query for the effective contributed feature states for a list of feature ids

type ContributedFeatureValueRule

type ContributedFeatureValueRule struct {
	// Name of the handler to run
	Name *string `json:"name,omitempty"`
	// Properties to feed to the handler
	Properties *map[string]interface{} `json:"properties,omitempty"`
}

A rule for dynamically getting the enabled/disabled state of a feature

type GetFeatureArgs

type GetFeatureArgs struct {
	// (required) The contribution id of the feature
	FeatureId *string
}

Arguments for the GetFeature function

type GetFeatureStateArgs

type GetFeatureStateArgs struct {
	// (required) Contribution id of the feature
	FeatureId *string
	// (required) User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
	UserScope *string
}

Arguments for the GetFeatureState function

type GetFeatureStateForScopeArgs

type GetFeatureStateForScopeArgs struct {
	// (required) Contribution id of the feature
	FeatureId *string
	// (required) User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.
	UserScope *string
	// (required) Scope at which to get the feature setting for (e.g. "project" or "team")
	ScopeName *string
	// (required) Value of the scope (e.g. the project or team id)
	ScopeValue *string
}

Arguments for the GetFeatureStateForScope function

type GetFeaturesArgs

type GetFeaturesArgs struct {
	// (optional) Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution.
	TargetContributionId *string
}

Arguments for the GetFeatures function

type QueryFeatureStatesArgs

type QueryFeatureStatesArgs struct {
	// (required) Features to query along with current scope values
	Query *ContributedFeatureStateQuery
}

Arguments for the QueryFeatureStates function

type QueryFeatureStatesForDefaultScopeArgs

type QueryFeatureStatesForDefaultScopeArgs struct {
	// (required) Query describing the features to query.
	Query *ContributedFeatureStateQuery
	// (required)
	UserScope *string
}

Arguments for the QueryFeatureStatesForDefaultScope function

type QueryFeatureStatesForNamedScopeArgs

type QueryFeatureStatesForNamedScopeArgs struct {
	// (required) Query describing the features to query.
	Query *ContributedFeatureStateQuery
	// (required)
	UserScope *string
	// (required)
	ScopeName *string
	// (required)
	ScopeValue *string
}

Arguments for the QueryFeatureStatesForNamedScope function

type SetFeatureStateArgs

type SetFeatureStateArgs struct {
	// (required) Posted feature state object. Should specify the effective value.
	Feature *ContributedFeatureState
	// (required) Contribution id of the feature
	FeatureId *string
	// (required) User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
	UserScope *string
	// (optional) Reason for changing the state
	Reason *string
	// (optional) Short reason code
	ReasonCode *string
}

Arguments for the SetFeatureState function

type SetFeatureStateForScopeArgs

type SetFeatureStateForScopeArgs struct {
	// (required) Posted feature state object. Should specify the effective value.
	Feature *ContributedFeatureState
	// (required) Contribution id of the feature
	FeatureId *string
	// (required) User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.
	UserScope *string
	// (required) Scope at which to get the feature setting for (e.g. "project" or "team")
	ScopeName *string
	// (required) Value of the scope (e.g. the project or team id)
	ScopeValue *string
	// (optional) Reason for changing the state
	Reason *string
	// (optional) Short reason code
	ReasonCode *string
}

Arguments for the SetFeatureStateForScope function

Jump to

Keyboard shortcuts

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