ldapi

package module
v0.0.0-...-aef5c04 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

README

This repository contains a client library for LaunchDarkly's REST API. This client was automatically generated from our OpenAPI specification.

This REST API is for custom integrations, data export, or automating your feature flag workflows. DO NOT use this client library to include feature flags in your web or mobile application. To integrate feature flags with your application, please see the SDK documentation

Go API client for ldapi

Build custom integrations with the LaunchDarkly REST API

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.14
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen For more information, please visit https://support.launchdarkly.com

Installation

import "github.com/launchdarkly/api-client-go"

Documentation for API Endpoints

All URIs are relative to https://app.launchdarkly.com/api/v2

Class Method HTTP request Description
AuditLogApi GetAuditLogEntries Get /auditlog Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.
AuditLogApi GetAuditLogEntry Get /auditlog/{resourceId} Use this endpoint to fetch a single audit log entry by its resouce ID.
CustomRolesApi DeleteCustomRole Delete /roles/{customRoleKey} Delete a custom role by key.
CustomRolesApi GetCustomRole Get /roles/{customRoleKey} Get one custom role by key.
CustomRolesApi GetCustomRoles Get /roles Return a complete list of custom roles.
CustomRolesApi PatchCustomRole Patch /roles/{customRoleKey} Modify a custom role by key.
CustomRolesApi PostCustomRole Post /roles Create a new custom role.
EnvironmentsApi DeleteEnvironment Delete /projects/{projectKey}/environments/{environmentKey} Delete an environment in a specific project.
EnvironmentsApi GetEnvironment Get /projects/{projectKey}/environments/{environmentKey} Get an environment given a project and key.
EnvironmentsApi PatchEnvironment Patch /projects/{projectKey}/environments/{environmentKey} Modify an environment by ID.
EnvironmentsApi PostEnvironment Post /projects/{projectKey}/environments Create a new environment in a specified project with a given name, key, and swatch color.
FeatureFlagsApi CopyFeatureFlag Post /flags/{projectKey}/{environmentKey}/{featureFlagKey}/copy Copies the feature flag configuration from one environment to the same feature flag in another environment.
FeatureFlagsApi DeleteFeatureFlag Delete /flags/{projectKey}/{featureFlagKey} Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application.
FeatureFlagsApi GetFeatureFlag Get /flags/{projectKey}/{featureFlagKey} Get a single feature flag by key.
FeatureFlagsApi GetFeatureFlagStatus Get /flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey} Get the status for a particular feature flag.
FeatureFlagsApi GetFeatureFlagStatuses Get /flag-statuses/{projectKey}/{environmentKey} Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as the state of the flag.
FeatureFlagsApi GetFeatureFlags Get /flags/{projectKey} Get a list of all features in the given project.
FeatureFlagsApi PatchFeatureFlag Patch /flags/{projectKey}/{featureFlagKey} Perform a partial update to a feature.
FeatureFlagsApi PostFeatureFlag Post /flags/{projectKey} Creates a new feature flag.
ProjectsApi DeleteProject Delete /projects/{projectKey} Delete a project by key. Caution-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.
ProjectsApi GetProject Get /projects/{projectKey} Fetch a single project by key.
ProjectsApi GetProjects Get /projects Returns a list of all projects in the account.
ProjectsApi PatchProject Patch /projects/{projectKey} Modify a project by ID.
ProjectsApi PostProject Post /projects Create a new project with the given key and name.
RootApi GetRoot Get /
TeamMembersApi DeleteMember Delete /members/{memberId} Delete a team member by ID.
TeamMembersApi GetMember Get /members/{memberId} Get a single team member by ID.
TeamMembersApi GetMembers Get /members Returns a list of all members in the account.
TeamMembersApi PatchMember Patch /members/{memberId} Modify a team member by ID.
TeamMembersApi PostMembers Post /members Invite new members.
UserSegmentsApi DeleteUserSegment Delete /segments/{projectKey}/{environmentKey}/{userSegmentKey} Delete a user segment.
UserSegmentsApi GetUserSegment Get /segments/{projectKey}/{environmentKey}/{userSegmentKey} Get a single user segment by key.
UserSegmentsApi GetUserSegments Get /segments/{projectKey}/{environmentKey} Get a list of all user segments in the given project.
UserSegmentsApi PatchUserSegment Patch /segments/{projectKey}/{environmentKey}/{userSegmentKey} Perform a partial update to a user segment.
UserSegmentsApi PostUserSegment Post /segments/{projectKey}/{environmentKey} Creates a new user segment.
UserSettingsApi GetUserFlagSetting Get /users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} Fetch a single flag setting for a user by key.
UserSettingsApi GetUserFlagSettings Get /users/{projectKey}/{environmentKey}/{userKey}/flags Fetch a single flag setting for a user by key.
UserSettingsApi PutFlagSetting Put /users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} Specifically enable or disable a feature flag for a user based on their key.
UsersApi DeleteUser Delete /users/{projectKey}/{environmentKey}/{userKey} Delete a user by ID.
UsersApi GetSearchUsers Get /user-search/{projectKey}/{environmentKey} Search users in LaunchDarkly based on their last active date, or a search query. It should not be used to enumerate all users in LaunchDarkly-- use the List users API resource.
UsersApi GetUser Get /users/{projectKey}/{environmentKey}/{userKey} Get a user by key.
UsersApi GetUsers Get /users/{projectKey}/{environmentKey} List all users in the environment. Includes the total count of users. In each page, there will be up to 'limit' users returned (default 20). This is useful for exporting all users in the system for further analysis. Paginated collections will include a next link containing a URL with the next set of elements in the collection.
WebhooksApi DeleteWebhook Delete /webhooks/{resourceId} Delete a webhook by ID.
WebhooksApi GetWebhook Get /webhooks/{resourceId} Get a webhook by ID.
WebhooksApi GetWebhooks Get /webhooks Fetch a list of all webhooks.
WebhooksApi PatchWebhook Patch /webhooks/{resourceId} Modify a webhook by ID.
WebhooksApi PostWebhook Post /webhooks Create a webhook.

Documentation For Models

Author

support@launchdarkly.com

Sample Code

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/launchdarkly/api-client-go"
)

func main() {
	apiKey := os.Getenv("LD_API_KEY")
	if apiKey == "" {
		panic("LD_API_KEY env var was empty!")
	}
	client := ldapi.NewAPIClient(ldapi.NewConfiguration())
	ctx := context.WithValue(context.Background(), ldapi.ContextAPIKey, ldapi.APIKey{
		Key: apiKey,
	})

	// Create a multi-variate feature flag
	body := ldapi.FeatureFlagBody{
		Name: "Test Flag Go",
		Key:  "test-go",
		Variations: []ldapi.Variation{
			{Value: intfPtr([]interface{}{1, 2})},
			{Value: intfPtr([]interface{}{3, 4})},
			{Value: intfPtr([]interface{}{5})}}}
	flag, _, err := client.FeatureFlagsApi.PostFeatureFlag(ctx, "openapi", body, nil)
	if err != nil {
		panic(fmt.Errorf("create failed: %s", err))
	}
	fmt.Printf("Created flag: %+v\n", flag)
	// Clean up new flag
	defer func() {
		if _, err := client.FeatureFlagsApi.DeleteFeatureFlag(ctx, "openapi", body.Key); err != nil {
			panic(fmt.Errorf("delete failed: %s", err))
		}
	}()
}

func intfPtr(i interface{}) *interface{} {
	return &i
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	AuditLogApi *AuditLogApiService

	CustomRolesApi *CustomRolesApiService

	EnvironmentsApi *EnvironmentsApiService

	FeatureFlagsApi *FeatureFlagsApiService

	ProjectsApi *ProjectsApiService

	RootApi *RootApiService

	TeamMembersApi *TeamMembersApiService

	UserSegmentsApi *UserSegmentsApiService

	UserSettingsApi *UserSettingsApiService

	UsersApi *UsersApiService

	WebhooksApi *WebhooksApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the LaunchDarkly REST API API v2.0.14 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AuditLogApiService

type AuditLogApiService service

func (*AuditLogApiService) GetAuditLogEntries

func (a *AuditLogApiService) GetAuditLogEntries(ctx context.Context, localVarOptionals *GetAuditLogEntriesOpts) (AuditLogEntries, *http.Response, error)

func (*AuditLogApiService) GetAuditLogEntry

func (a *AuditLogApiService) GetAuditLogEntry(ctx context.Context, resourceId string) (AuditLogEntry, *http.Response, error)

AuditLogApiService Use this endpoint to fetch a single audit log entry by its resouce ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param resourceId The resource ID.

@return AuditLogEntry

type AuditLogEntries

type AuditLogEntries struct {
	Links *Links          `json:"_links,omitempty"`
	Items []AuditLogEntry `json:"items,omitempty"`
}

type AuditLogEntry

type AuditLogEntry struct {
	Links *Links `json:"_links,omitempty"`
	// The unique resource id.
	Id               string               `json:"_id,omitempty"`
	Date             int64                `json:"date,omitempty"`
	Kind             string               `json:"kind,omitempty"`
	Name             string               `json:"name,omitempty"`
	Description      string               `json:"description,omitempty"`
	ShortDescription string               `json:"shortDescription,omitempty"`
	Comment          string               `json:"comment,omitempty"`
	Member           *Member              `json:"member,omitempty"`
	TitleVerb        string               `json:"titleVerb,omitempty"`
	Title            string               `json:"title,omitempty"`
	Target           *AuditLogEntryTarget `json:"target,omitempty"`
}

type AuditLogEntryTarget

type AuditLogEntryTarget struct {
	Links     *Links   `json:"_links,omitempty"`
	Name      string   `json:"name,omitempty"`
	Resources []string `json:"resources,omitempty"`
}

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Clause

type Clause struct {
	Attribute string        `json:"attribute,omitempty"`
	Op        string        `json:"op,omitempty"`
	Values    []interface{} `json:"values,omitempty"`
	Negate    bool          `json:"negate,omitempty"`
}

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type CustomProperty

type CustomProperty struct {
	// The name of the property.
	Name string `json:"name"`
	// Values for this property.
	Value []string `json:"value,omitempty"`
}

A name and value describing a custom property.

type CustomRole

type CustomRole struct {
	Links *Links `json:"_links,omitempty"`
	// Name of the custom role.
	Name string `json:"name,omitempty"`
	// The 20-hexdigit id or the key for a custom role.
	Key string `json:"key,omitempty"`
	// Description of the custom role.
	Description string `json:"description,omitempty"`
	// The unique resource id.
	Id     string   `json:"_id,omitempty"`
	Policy []Policy `json:"policy,omitempty"`
}

type CustomRoleBody

type CustomRoleBody struct {
	// Name of the custom role.
	Name string `json:"name"`
	// Description of the custom role.
	Description string `json:"description,omitempty"`
	// The 20-hexdigit id or the key for a custom role.
	Key    string   `json:"key"`
	Policy []Policy `json:"policy"`
}

type CustomRoles

type CustomRoles struct {
	Links *Links       `json:"_links,omitempty"`
	Items []CustomRole `json:"items,omitempty"`
}

type CustomRolesApiService

type CustomRolesApiService service

func (*CustomRolesApiService) DeleteCustomRole

func (a *CustomRolesApiService) DeleteCustomRole(ctx context.Context, customRoleKey string) (*http.Response, error)

CustomRolesApiService Delete a custom role by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param customRoleKey The custom role key.

func (*CustomRolesApiService) GetCustomRole

func (a *CustomRolesApiService) GetCustomRole(ctx context.Context, customRoleKey string) (CustomRole, *http.Response, error)

CustomRolesApiService Get one custom role by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param customRoleKey The custom role key.

@return CustomRole

func (*CustomRolesApiService) GetCustomRoles

func (a *CustomRolesApiService) GetCustomRoles(ctx context.Context) (CustomRoles, *http.Response, error)

CustomRolesApiService Return a complete list of custom roles.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return CustomRoles

func (*CustomRolesApiService) PatchCustomRole

func (a *CustomRolesApiService) PatchCustomRole(ctx context.Context, customRoleKey string, patchDelta []PatchOperation) (CustomRole, *http.Response, error)

CustomRolesApiService Modify a custom role by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param customRoleKey The custom role key.
  • @param patchDelta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

@return CustomRole

func (*CustomRolesApiService) PostCustomRole

func (a *CustomRolesApiService) PostCustomRole(ctx context.Context, customRoleBody CustomRoleBody) (CustomRole, *http.Response, error)

CustomRolesApiService Create a new custom role.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param customRoleBody New role or roles to create.

@return CustomRole

type Environment

type Environment struct {
	Links *Links `json:"_links,omitempty"`
	// The unique resource id.
	Id string `json:"_id,omitempty"`
	// The key for the environment.
	Key string `json:"key,omitempty"`
	// The name of the environment.
	Name string `json:"name,omitempty"`
	// The SDK key for backend LaunchDarkly SDKs.
	ApiKey string `json:"apiKey,omitempty"`
	// The SDK key for mobile LaunchDarkly SDKs.
	MobileKey string `json:"mobileKey,omitempty"`
	// The swatch color for the environment.
	Color string `json:"color,omitempty"`
	// The default TTL.
	DefaultTtl float32 `json:"defaultTtl,omitempty"`
	// Determines if this environment is in safe mode.
	SecureMode bool `json:"secureMode,omitempty"`
	// Set to true to send detailed event information for new flags.
	DefaultTrackEvents bool `json:"defaultTrackEvents,omitempty"`
	// An array of tags for this environment.
	Tags []string `json:"tags,omitempty"`
}

type EnvironmentPost

type EnvironmentPost struct {
	// The name of the new environment.
	Name string `json:"name"`
	// A project-unique key for the new environment.
	Key string `json:"key"`
	// A color swatch (as an RGB hex value with no leading '#', e.g. C8C8C8).
	Color string `json:"color"`
	// The default TTL for the new environment.
	DefaultTtl float32 `json:"defaultTtl,omitempty"`
}

type EnvironmentsApiService

type EnvironmentsApiService service

func (*EnvironmentsApiService) DeleteEnvironment

func (a *EnvironmentsApiService) DeleteEnvironment(ctx context.Context, projectKey string, environmentKey string) (*http.Response, error)

EnvironmentsApiService Delete an environment in a specific project.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.

func (*EnvironmentsApiService) GetEnvironment

func (a *EnvironmentsApiService) GetEnvironment(ctx context.Context, projectKey string, environmentKey string) (Environment, *http.Response, error)

EnvironmentsApiService Get an environment given a project and key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.

@return Environment

func (*EnvironmentsApiService) PatchEnvironment

func (a *EnvironmentsApiService) PatchEnvironment(ctx context.Context, projectKey string, environmentKey string, patchDelta []PatchOperation) (Environment, *http.Response, error)

EnvironmentsApiService Modify an environment by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param patchDelta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

@return Environment

func (*EnvironmentsApiService) PostEnvironment

func (a *EnvironmentsApiService) PostEnvironment(ctx context.Context, projectKey string, environmentBody EnvironmentPost) (Environment, *http.Response, error)

EnvironmentsApiService Create a new environment in a specified project with a given name, key, and swatch color.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentBody New environment.

@return Environment

type FeatureFlag

type FeatureFlag struct {
	Key string `json:"key,omitempty"`
	// Name of the feature flag.
	Name string `json:"name,omitempty"`
	// Description of the feature flag.
	Description string `json:"description,omitempty"`
	// Whether the feature flag is a boolean flag or multivariate.
	Kind string `json:"kind,omitempty"`
	// A unix epoch time in milliseconds specifying the creation time of this flag.
	CreationDate     float32 `json:"creationDate,omitempty"`
	IncludeInSnippet bool    `json:"includeInSnippet,omitempty"`
	// Whether or not this flag is temporary.
	Temporary bool `json:"temporary,omitempty"`
	// The ID of the member that should maintain this flag.
	MaintainerId string `json:"maintainerId,omitempty"`
	// An array of tags for this feature flag.
	Tags []string `json:"tags,omitempty"`
	// The variations for this feature flag.
	Variations []Variation `json:"variations,omitempty"`
	// An array goals from all environments associated with this feature flag
	GoalIds []string `json:"goalIds,omitempty"`
	Version int32    `json:"_version,omitempty"`
	// A mapping of keys to CustomProperty entries.
	CustomProperties map[string]CustomProperty    `json:"customProperties,omitempty"`
	Links            *Links                       `json:"_links,omitempty"`
	Maintainer       *Member                      `json:"_maintainer,omitempty"`
	Environments     map[string]FeatureFlagConfig `json:"environments,omitempty"`
}

type FeatureFlagBody

type FeatureFlagBody struct {
	// A human-friendly name for the feature flag. Remember to note if this flag is intended to be temporary or permanent.
	Name string `json:"name"`
	// A unique key that will be used to reference the flag in your code.
	Key string `json:"key"`
	// A description of the feature flag.
	Description string `json:"description,omitempty"`
	// An array of possible variations for the flag.
	Variations []Variation `json:"variations"`
	// Whether or not the flag is a temporary flag.
	Temporary bool `json:"temporary,omitempty"`
	// Tags for the feature flag.
	Tags []string `json:"tags,omitempty"`
	// Whether or not this flag should be made available to the client-side JavaScript SDK.
	IncludeInSnippet bool `json:"includeInSnippet,omitempty"`
}

type FeatureFlagConfig

type FeatureFlagConfig struct {
	On            bool              `json:"on,omitempty"`
	Archived      bool              `json:"archived,omitempty"`
	Salt          string            `json:"salt,omitempty"`
	Sel           string            `json:"sel,omitempty"`
	LastModified  int64             `json:"lastModified,omitempty"`
	Version       int32             `json:"version,omitempty"`
	Targets       []Target          `json:"targets,omitempty"`
	Rules         []Rule            `json:"rules,omitempty"`
	Fallthrough_  *ModelFallthrough `json:"fallthrough,omitempty"`
	OffVariation  int32             `json:"offVariation,omitempty"`
	Prerequisites []Prerequisite    `json:"prerequisites,omitempty"`
	// Set to true to send detailed event information for this flag.
	TrackEvents bool `json:"trackEvents,omitempty"`
}

type FeatureFlagStatus

type FeatureFlagStatus struct {
	Links *Links `json:"_links,omitempty"`
	// | Name     | Description | | --------:| ----------- | | new      | the feature flag was created within the last 7 days, and has not been requested yet | | active   | the feature flag was requested by your servers or clients within the last 7 days | | inactive | the feature flag was created more than 7 days ago, and hasn't been requested by your servers or clients within the past 7 days | | launched | one variation of the feature flag has been rolled out to all your users for at least 7 days |
	Name          string       `json:"name,omitempty"`
	LastRequested string       `json:"lastRequested,omitempty"`
	Default_      *interface{} `json:"default,omitempty"`
}

type FeatureFlagStatuses

type FeatureFlagStatuses struct {
	Links *Links              `json:"_links,omitempty"`
	Items []FeatureFlagStatus `json:"items,omitempty"`
}

type FeatureFlags

type FeatureFlags struct {
	Links *Links        `json:"_links,omitempty"`
	Items []FeatureFlag `json:"items,omitempty"`
}

type FeatureFlagsApiService

type FeatureFlagsApiService service

func (*FeatureFlagsApiService) CopyFeatureFlag

func (a *FeatureFlagsApiService) CopyFeatureFlag(ctx context.Context, projectKey string, environmentKey string, featureFlagKey string) (FeatureFlag, *http.Response, error)

FeatureFlagsApiService Copies the feature flag configuration from one environment to the same feature flag in another environment.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.

@return FeatureFlag

func (*FeatureFlagsApiService) DeleteFeatureFlag

func (a *FeatureFlagsApiService) DeleteFeatureFlag(ctx context.Context, projectKey string, featureFlagKey string) (*http.Response, error)

FeatureFlagsApiService Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.

func (*FeatureFlagsApiService) GetFeatureFlag

func (a *FeatureFlagsApiService) GetFeatureFlag(ctx context.Context, projectKey string, featureFlagKey string, localVarOptionals *GetFeatureFlagOpts) (FeatureFlag, *http.Response, error)

func (*FeatureFlagsApiService) GetFeatureFlagStatus

func (a *FeatureFlagsApiService) GetFeatureFlagStatus(ctx context.Context, projectKey string, environmentKey string, featureFlagKey string) (FeatureFlagStatus, *http.Response, error)

FeatureFlagsApiService Get the status for a particular feature flag.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.

@return FeatureFlagStatus

func (*FeatureFlagsApiService) GetFeatureFlagStatuses

func (a *FeatureFlagsApiService) GetFeatureFlagStatuses(ctx context.Context, projectKey string, environmentKey string) (FeatureFlagStatuses, *http.Response, error)

FeatureFlagsApiService Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as the state of the flag.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.

@return FeatureFlagStatuses

func (*FeatureFlagsApiService) GetFeatureFlags

func (a *FeatureFlagsApiService) GetFeatureFlags(ctx context.Context, projectKey string, localVarOptionals *GetFeatureFlagsOpts) (FeatureFlags, *http.Response, error)

func (*FeatureFlagsApiService) PatchFeatureFlag

func (a *FeatureFlagsApiService) PatchFeatureFlag(ctx context.Context, projectKey string, featureFlagKey string, patchComment PatchComment) (FeatureFlag, *http.Response, error)

FeatureFlagsApiService Perform a partial update to a feature.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.
  • @param patchComment Requires a JSON Patch representation of the desired changes to the project, and an optional comment. 'http://jsonpatch.com/' Feature flag patches also support JSON Merge Patch format. 'https://tools.ietf.org/html/rfc7386' The addition of comments is also supported.

@return FeatureFlag

func (*FeatureFlagsApiService) PostFeatureFlag

func (a *FeatureFlagsApiService) PostFeatureFlag(ctx context.Context, projectKey string, featureFlagBody FeatureFlagBody, localVarOptionals *PostFeatureFlagOpts) (FeatureFlag, *http.Response, error)

type GenericSwaggerError

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

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type GetAuditLogEntriesOpts

type GetAuditLogEntriesOpts struct {
	Before optional.Float32
	After  optional.Float32
	Q      optional.String
	Limit  optional.Float32
	Spec   optional.String
}

type GetFeatureFlagOpts

type GetFeatureFlagOpts struct {
	Env optional.String
}

type GetFeatureFlagsOpts

type GetFeatureFlagsOpts struct {
	Env optional.String
	Tag optional.String
}

type GetSearchUsersOpts

type GetSearchUsersOpts struct {
	Q      optional.String
	Limit  optional.Int32
	Offset optional.Int32
	After  optional.Float32
}

type GetUserSegmentsOpts

type GetUserSegmentsOpts struct {
	Tag optional.String
}

type GetUsersOpts

type GetUsersOpts struct {
	Limit    optional.Int32
	H        optional.String
	ScrollId optional.String
}

type Id

type Id struct {
}

The unique resource id.

type Link struct {
	Href  string `json:"href,omitempty"`
	Type_ string `json:"type,omitempty"`
}
type Links struct {
	Self *Link `json:"self,omitempty"`
	Next *Link `json:"next,omitempty"`
}

type Member

type Member struct {
	Links *Links `json:"_links,omitempty"`
	// The unique resource id.
	Id            string   `json:"_id,omitempty"`
	Role          *Role    `json:"role,omitempty"`
	Email         string   `json:"email,omitempty"`
	FirstName     string   `json:"firstName,omitempty"`
	LastName      string   `json:"lastName,omitempty"`
	PendingInvite bool     `json:"_pendingInvite,omitempty"`
	IsBeta        bool     `json:"isBeta,omitempty"`
	CustomRoles   []string `json:"customRoles,omitempty"`
}

type Members

type Members struct {
	Links *Links   `json:"_links,omitempty"`
	Items []Member `json:"items,omitempty"`
}

type MembersBody

type MembersBody struct {
	Email       string      `json:"email"`
	FirstName   string      `json:"firstName,omitempty"`
	LastName    string      `json:"lastName,omitempty"`
	Role        *Role       `json:"role,omitempty"`
	CustomRoles []string    `json:"customRoles,omitempty"`
	InlineRole  *Statements `json:"inlineRole,omitempty"`
}

type ModelFallthrough

type ModelFallthrough struct {
	Variation int32    `json:"variation,omitempty"`
	Rollout   *Rollout `json:"rollout,omitempty"`
}

type PatchComment

type PatchComment struct {
	Comment string           `json:"comment,omitempty"`
	Patch   []PatchOperation `json:"patch,omitempty"`
}

type PatchOperation

type PatchOperation struct {
	Op    string       `json:"op"`
	Path  string       `json:"path"`
	Value *interface{} `json:"value"`
}

type Policy

type Policy struct {
	Resources []string `json:"resources,omitempty"`
	Actions   []string `json:"actions,omitempty"`
	// Effect of the policy - allow or deny.
	Effect string `json:"effect,omitempty"`
}

type PostFeatureFlagOpts

type PostFeatureFlagOpts struct {
	Clone optional.String
}

type Prerequisite

type Prerequisite struct {
	Key       string `json:"key,omitempty"`
	Variation int32  `json:"variation,omitempty"`
}

type Project

type Project struct {
	Links *Links `json:"_links,omitempty"`
	// The unique resource id.
	Id           string        `json:"_id,omitempty"`
	Key          string        `json:"key,omitempty"`
	Name         string        `json:"name,omitempty"`
	Environments []Environment `json:"environments,omitempty"`
	// An array of tags for this project.
	Tags []string `json:"tags,omitempty"`
}

type ProjectBody

type ProjectBody struct {
	Name         string            `json:"name"`
	Key          string            `json:"key"`
	Environments []EnvironmentPost `json:"environments,omitempty"`
}

type Projects

type Projects struct {
	Links *Links    `json:"_links,omitempty"`
	Items []Project `json:"items,omitempty"`
}

type ProjectsApiService

type ProjectsApiService service

func (*ProjectsApiService) DeleteProject

func (a *ProjectsApiService) DeleteProject(ctx context.Context, projectKey string) (*http.Response, error)

ProjectsApiService Delete a project by key. Caution-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.

func (*ProjectsApiService) GetProject

func (a *ProjectsApiService) GetProject(ctx context.Context, projectKey string) (Project, *http.Response, error)

ProjectsApiService Fetch a single project by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.

@return Project

func (*ProjectsApiService) GetProjects

func (a *ProjectsApiService) GetProjects(ctx context.Context) (Projects, *http.Response, error)

ProjectsApiService Returns a list of all projects in the account.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Projects

func (*ProjectsApiService) PatchProject

func (a *ProjectsApiService) PatchProject(ctx context.Context, projectKey string, patchDelta []PatchOperation) (Project, *http.Response, error)

ProjectsApiService Modify a project by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param patchDelta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

@return Project

func (*ProjectsApiService) PostProject

func (a *ProjectsApiService) PostProject(ctx context.Context, projectBody ProjectBody) (Project, *http.Response, error)

ProjectsApiService Create a new project with the given key and name.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectBody Project keys must be unique within an account.

@return Project

type Role

type Role string
const (
	WRITER Role = "writer"
	READER Role = "reader"
	ADMIN  Role = "admin"
	OWNER  Role = "owner"
)

List of Role

type Rollout

type Rollout struct {
	Variations []WeightedVariation `json:"variations,omitempty"`
}

type RootApiService

type RootApiService service

func (*RootApiService) GetRoot

func (a *RootApiService) GetRoot(ctx context.Context) (Links, *http.Response, error)

RootApiService You can issue a GET request to the root resource to find all of the resource categories supported by the API.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Links

type Rule

type Rule struct {
	Id        string   `json:"_id,omitempty"`
	Variation int32    `json:"variation,omitempty"`
	Rollout   *Rollout `json:"rollout,omitempty"`
	Clauses   []Clause `json:"clauses,omitempty"`
}

type Statement

type Statement struct {
	Resources []string `json:"resources,omitempty"`
	// Targeted resource will be those resources NOT in this list. The \"resources`\" field must be empty to use this field.
	Notresources []string `json:"notresources,omitempty"`
	Actions      []string `json:"actions,omitempty"`
	// Targeted actions will be those actions NOT in this list. The \"actions\" field must be empty to use this field.
	Notactions []string `json:"notactions,omitempty"`
	Effect     string   `json:"effect,omitempty"`
}

type Statements

type Statements struct {
}

type Target

type Target struct {
	Values    []string `json:"values,omitempty"`
	Variation int32    `json:"variation,omitempty"`
}

type TeamMembersApiService

type TeamMembersApiService service

func (*TeamMembersApiService) DeleteMember

func (a *TeamMembersApiService) DeleteMember(ctx context.Context, memberId string) (*http.Response, error)

TeamMembersApiService Delete a team member by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param memberId The member ID.

func (*TeamMembersApiService) GetMember

func (a *TeamMembersApiService) GetMember(ctx context.Context, memberId string) (Member, *http.Response, error)

TeamMembersApiService Get a single team member by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param memberId The member ID.

@return Member

func (*TeamMembersApiService) GetMembers

TeamMembersApiService Returns a list of all members in the account.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Members

func (*TeamMembersApiService) PatchMember

func (a *TeamMembersApiService) PatchMember(ctx context.Context, memberId string, patchDelta []PatchOperation) (Member, *http.Response, error)

TeamMembersApiService Modify a team member by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param memberId The member ID.
  • @param patchDelta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

@return Member

func (*TeamMembersApiService) PostMembers

func (a *TeamMembersApiService) PostMembers(ctx context.Context, membersBody []MembersBody) (Members, *http.Response, error)

TeamMembersApiService Invite new members.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param membersBody New members to invite.

@return Members

type User

type User struct {
	Key       string       `json:"key,omitempty"`
	Secondary string       `json:"secondary,omitempty"`
	Ip        string       `json:"ip,omitempty"`
	Country   string       `json:"country,omitempty"`
	Email     string       `json:"email,omitempty"`
	FirstName string       `json:"firstName,omitempty"`
	LastName  string       `json:"lastName,omitempty"`
	Avatar    string       `json:"avatar,omitempty"`
	Name      string       `json:"name,omitempty"`
	Anonymous bool         `json:"anonymous,omitempty"`
	Custom    *interface{} `json:"custom,omitempty"`
}

type UserFlagSetting

type UserFlagSetting struct {
	Links *Links `json:"_links,omitempty"`
	// The most important attribute in the response. The _value is the current setting for the user. For a boolean feature toggle, this will be true, false, or null if there is no defined fallthrough value.
	Value bool `json:"_value,omitempty"`
	// The setting attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be false. A setting of null means that you haven't assigned that user to a specific variation.
	Setting bool `json:"setting,omitempty"`
}

type UserFlagSettings

type UserFlagSettings struct {
	Links *Links                     `json:"_links,omitempty"`
	Items map[string]UserFlagSetting `json:"items,omitempty"`
}

type UserRecord

type UserRecord struct {
	LastPing      string `json:"lastPing,omitempty"`
	EnvironmentId string `json:"environmentId,omitempty"`
	// The unique resource id.
	OwnerId string `json:"ownerId,omitempty"`
	User    *User  `json:"user,omitempty"`
	Avatar  string `json:"avatar,omitempty"`
}

type UserSegment

type UserSegment struct {
	// Unique identifier for the user segment.
	Key string `json:"key"`
	// Name of the user segment.
	Name string `json:"name"`
	// Description of the user segment.
	Description string `json:"description,omitempty"`
	// An array of tags for this user segment.
	Tags []string `json:"tags,omitempty"`
	// A unix epoch time in milliseconds specifying the creation time of this flag.
	CreationDate float32 `json:"creationDate"`
	// An array of user keys that are included in this segment.
	Included []string `json:"included,omitempty"`
	// An array of user keys that should not be included in this segment, unless they are also listed in \"included\".
	Excluded []string `json:"excluded,omitempty"`
	// An array of rules that can cause a user to be included in this segment.
	Rules   []UserSegmentRule `json:"rules,omitempty"`
	Version int32             `json:"version,omitempty"`
	Links   *Links            `json:"_links,omitempty"`
}

type UserSegmentBody

type UserSegmentBody struct {
	// A human-friendly name for the user segment.
	Name string `json:"name"`
	// A unique key that will be used to reference the user segment in feature flags.
	Key string `json:"key"`
	// A description for the user segment.
	Description string `json:"description,omitempty"`
	// Tags for the user segment.
	Tags []string `json:"tags,omitempty"`
}

type UserSegmentRule

type UserSegmentRule struct {
	Clauses  []Clause `json:"clauses,omitempty"`
	Weight   int32    `json:"weight,omitempty"`
	BucketBy string   `json:"bucketBy,omitempty"`
}

type UserSegments

type UserSegments struct {
	Links *Links        `json:"_links,omitempty"`
	Items []UserSegment `json:"items,omitempty"`
}

type UserSegmentsApiService

type UserSegmentsApiService service

func (*UserSegmentsApiService) DeleteUserSegment

func (a *UserSegmentsApiService) DeleteUserSegment(ctx context.Context, projectKey string, environmentKey string, userSegmentKey string) (*http.Response, error)

UserSegmentsApiService Delete a user segment.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userSegmentKey The user segment's key. The key identifies the user segment in your code.

func (*UserSegmentsApiService) GetUserSegment

func (a *UserSegmentsApiService) GetUserSegment(ctx context.Context, projectKey string, environmentKey string, userSegmentKey string) (UserSegment, *http.Response, error)

UserSegmentsApiService Get a single user segment by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userSegmentKey The user segment's key. The key identifies the user segment in your code.

@return UserSegment

func (*UserSegmentsApiService) GetUserSegments

func (a *UserSegmentsApiService) GetUserSegments(ctx context.Context, projectKey string, environmentKey string, localVarOptionals *GetUserSegmentsOpts) (UserSegments, *http.Response, error)

func (*UserSegmentsApiService) PatchUserSegment

func (a *UserSegmentsApiService) PatchUserSegment(ctx context.Context, projectKey string, environmentKey string, userSegmentKey string, patchOnly []PatchOperation) (UserSegment, *http.Response, error)

UserSegmentsApiService Perform a partial update to a user segment.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userSegmentKey The user segment's key. The key identifies the user segment in your code.
  • @param patchOnly Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' Feature flag patches also support JSON Merge Patch format. 'https://tools.ietf.org/html/rfc7386' The addition of comments is also supported.

@return UserSegment

func (*UserSegmentsApiService) PostUserSegment

func (a *UserSegmentsApiService) PostUserSegment(ctx context.Context, projectKey string, environmentKey string, userSegmentBody UserSegmentBody) (UserSegment, *http.Response, error)

UserSegmentsApiService Creates a new user segment.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userSegmentBody Create a new user segment.

@return UserSegment

type UserSettingsApiService

type UserSettingsApiService service

func (*UserSettingsApiService) GetUserFlagSetting

func (a *UserSettingsApiService) GetUserFlagSetting(ctx context.Context, projectKey string, environmentKey string, userKey string, featureFlagKey string) (UserFlagSetting, *http.Response, error)

UserSettingsApiService Fetch a single flag setting for a user by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userKey The user's key.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.

@return UserFlagSetting

func (*UserSettingsApiService) GetUserFlagSettings

func (a *UserSettingsApiService) GetUserFlagSettings(ctx context.Context, projectKey string, environmentKey string, userKey string) (UserFlagSettings, *http.Response, error)

UserSettingsApiService Fetch a single flag setting for a user by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userKey The user's key.

@return UserFlagSettings

func (*UserSettingsApiService) PutFlagSetting

func (a *UserSettingsApiService) PutFlagSetting(ctx context.Context, projectKey string, environmentKey string, userKey string, featureFlagKey string, userSettingsBody UserSettingsBody) (*http.Response, error)

UserSettingsApiService Specifically enable or disable a feature flag for a user based on their key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userKey The user's key.
  • @param featureFlagKey The feature flag's key. The key identifies the flag in your code.
  • @param userSettingsBody

type UserSettingsBody

type UserSettingsBody struct {
	// The variation value to set for the user. Must match the variation type of the flag.
	Setting bool `json:"setting,omitempty"`
}

type Users

type Users struct {
	Links      *Links       `json:"_links,omitempty"`
	TotalCount float32      `json:"totalCount,omitempty"`
	Items      []UserRecord `json:"items,omitempty"`
}

type UsersApiService

type UsersApiService service

func (*UsersApiService) DeleteUser

func (a *UsersApiService) DeleteUser(ctx context.Context, projectKey string, environmentKey string, userKey string) (*http.Response, error)

UsersApiService Delete a user by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userKey The user's key.

func (*UsersApiService) GetSearchUsers

func (a *UsersApiService) GetSearchUsers(ctx context.Context, projectKey string, environmentKey string, localVarOptionals *GetSearchUsersOpts) (Users, *http.Response, error)

func (*UsersApiService) GetUser

func (a *UsersApiService) GetUser(ctx context.Context, projectKey string, environmentKey string, userKey string) (User, *http.Response, error)

UsersApiService Get a user by key.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
  • @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
  • @param userKey The user's key.

@return User

func (*UsersApiService) GetUsers

func (a *UsersApiService) GetUsers(ctx context.Context, projectKey string, environmentKey string, localVarOptionals *GetUsersOpts) (Users, *http.Response, error)

type Variation

type Variation struct {
	Name        string       `json:"name,omitempty"`
	Description string       `json:"description,omitempty"`
	Value       *interface{} `json:"value"`
}

type Webhook

type Webhook struct {
	Links *Links `json:"_links,omitempty"`
	// The unique resource id.
	Id string `json:"_id,omitempty"`
	// The URL of the remote webhook.
	Url string `json:"url,omitempty"`
	// If defined, the webhooks post request will include a X-LD-Signature header whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the secret as the key.
	Secret string `json:"secret,omitempty"`
	// Whether this webhook is enabled or not.
	On bool `json:"on,omitempty"`
	// The name of the webhook.
	Name string `json:"name,omitempty"`
	// Tags assigned to this webhook.
	Tags []string `json:"tags,omitempty"`
}

type WebhookBody

type WebhookBody struct {
	// The URL of the remote webhook.
	Url string `json:"url"`
	// If sign is true, and the secret attribute is omitted, LaunchDarkly will automatically generate a secret for you.
	Secret string `json:"secret,omitempty"`
	// If sign is false, the webhook will not include a signature header, and the secret can be omitted.
	Sign bool `json:"sign"`
	// Whether this webhook is enabled or not.
	On bool `json:"on"`
	// The name of the webhook.
	Name string `json:"name,omitempty"`
}

type Webhooks

type Webhooks struct {
	Links *Links    `json:"_links,omitempty"`
	Items []Webhook `json:"items,omitempty"`
}

type WebhooksApiService

type WebhooksApiService service

func (*WebhooksApiService) DeleteWebhook

func (a *WebhooksApiService) DeleteWebhook(ctx context.Context, resourceId string) (*http.Response, error)

WebhooksApiService Delete a webhook by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param resourceId The resource ID.

func (*WebhooksApiService) GetWebhook

func (a *WebhooksApiService) GetWebhook(ctx context.Context, resourceId string) (Webhook, *http.Response, error)

WebhooksApiService Get a webhook by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param resourceId The resource ID.

@return Webhook

func (*WebhooksApiService) GetWebhooks

func (a *WebhooksApiService) GetWebhooks(ctx context.Context) (Webhooks, *http.Response, error)

WebhooksApiService Fetch a list of all webhooks.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Webhooks

func (*WebhooksApiService) PatchWebhook

func (a *WebhooksApiService) PatchWebhook(ctx context.Context, resourceId string, patchDelta []PatchOperation) (Webhook, *http.Response, error)

WebhooksApiService Modify a webhook by ID.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param resourceId The resource ID.
  • @param patchDelta Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

@return Webhook

func (*WebhooksApiService) PostWebhook

func (a *WebhooksApiService) PostWebhook(ctx context.Context, webhookBody WebhookBody) (Webhook, *http.Response, error)

WebhooksApiService Create a webhook.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param webhookBody New webhook.

@return Webhook

type WeightedVariation

type WeightedVariation struct {
	Variation int32 `json:"variation,omitempty"`
	Weight    int32 `json:"weight,omitempty"`
}

Jump to

Keyboard shortcuts

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