Skip to content

Latest commit

 

History

History
742 lines (493 loc) · 26.4 KB

File metadata and controls

742 lines (493 loc) · 26.4 KB

\ViewsBetaApi

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

Method HTTP request Description
CreateView Post /api/v2/projects/{projectKey}/views Create view
DeleteView Delete /api/v2/projects/{projectKey}/views/{viewKey} Delete view
GetLinkedResources Get /api/v2/projects/{projectKey}/views/{viewKey}/linked/{resourceType} Get linked resources
GetLinkedViews Get /api/v2/projects/{projectKey}/view-associations/{resourceType}/{resourceKey} Get linked views for a given resource
GetView Get /api/v2/projects/{projectKey}/views/{viewKey} Get view
GetViews Get /api/v2/projects/{projectKey}/views List views
LinkResource Post /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType} Link resource
UnlinkResource Delete /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType} Unlink resource
UpdateView Patch /api/v2/projects/{projectKey}/views/{viewKey} Update view

CreateView

View CreateView(ctx, projectKey).LDAPIVersion(lDAPIVersion).ViewPost(viewPost).Execute()

Create view

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewPost := *openapiclient.NewViewPost("Key_example", "Name_example") // ViewPost | View object to create

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.CreateView(context.Background(), projectKey).LDAPIVersion(lDAPIVersion).ViewPost(viewPost).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.CreateView``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateView`: View
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.CreateView`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string

Other Parameters

Other parameters are passed through a pointer to a apiCreateViewRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

viewPost | ViewPost | View object to create |

Return type

View

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteView

DeleteView(ctx, projectKey, viewKey).LDAPIVersion(lDAPIVersion).Execute()

Delete view

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ViewsBetaApi.DeleteView(context.Background(), projectKey, viewKey).LDAPIVersion(lDAPIVersion).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.DeleteView``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string

Other Parameters

Other parameters are passed through a pointer to a apiDeleteViewRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

Return type

(empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLinkedResources

ViewLinkedResources GetLinkedResources(ctx, projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).Limit(limit).Offset(offset).Sort(sort).Query(query).Filter(filter).Expand(expand).Execute()

Get linked resources

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 
	resourceType := "flags" // string | 
	limit := int32(56) // int32 | The number of views to return. (optional)
	offset := int32(56) // int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
	sort := "sort_example" // string | Field to sort by. Default field is `linkedAt`, default order is ascending. (optional) (default to "linkedAt")
	query := "query_example" // string | Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name. (optional)
	filter := "filter_example" // string | Optional resource filter expression for linked resources. - Supported for `flags` and `segments` resource types. - Uses the same syntax as link/unlink and list endpoints. - For `segments`, `environmentId` is required when `filter` is provided.  (optional)
	expand := []string{"Expand_example"} // []string | A comma-separated list of fields to expand. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.GetLinkedResources(context.Background(), projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).Limit(limit).Offset(offset).Sort(sort).Query(query).Filter(filter).Expand(expand).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.GetLinkedResources``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLinkedResources`: ViewLinkedResources
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.GetLinkedResources`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string
resourceType string

Other Parameters

Other parameters are passed through a pointer to a apiGetLinkedResourcesRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

limit | int32 | The number of views to return. | offset | int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | sort | string | Field to sort by. Default field is `linkedAt`, default order is ascending. | [default to "linkedAt"] query | string | Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name. | filter | string | Optional resource filter expression for linked resources. - Supported for `flags` and `segments` resource types. - Uses the same syntax as link/unlink and list endpoints. - For `segments`, `environmentId` is required when `filter` is provided. | expand | []string | A comma-separated list of fields to expand. |

Return type

ViewLinkedResources

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLinkedViews

Views GetLinkedViews(ctx, projectKey, resourceType, resourceKey).LDAPIVersion(lDAPIVersion).EnvironmentId(environmentId).Limit(limit).Offset(offset).Execute()

Get linked views for a given resource

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	resourceType := "flags" // string | 
	resourceKey := "my-flag" // string | 
	environmentId := "6890ff25c3e3830ba1a352e4" // string | Environment ID. Required when resourceType is 'segments' (optional)
	limit := int32(56) // int32 | The number of views to return. (optional)
	offset := int32(56) // int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.GetLinkedViews(context.Background(), projectKey, resourceType, resourceKey).LDAPIVersion(lDAPIVersion).EnvironmentId(environmentId).Limit(limit).Offset(offset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.GetLinkedViews``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetLinkedViews`: Views
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.GetLinkedViews`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
resourceType string
resourceKey string

Other Parameters

Other parameters are passed through a pointer to a apiGetLinkedViewsRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

environmentId | string | Environment ID. Required when resourceType is 'segments' | limit | int32 | The number of views to return. | offset | int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. |

Return type

Views

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetView

View GetView(ctx, projectKey, viewKey).LDAPIVersion(lDAPIVersion).Sort(sort).Limit(limit).Offset(offset).Filter(filter).Expand(expand).Execute()

Get view

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 
	sort := "sort_example" // string | A sort to apply to the list of views. (optional)
	limit := int32(56) // int32 | The number of views to return. (optional)
	offset := int32(56) // int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
	filter := "filter_example" // string | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). (optional)
	expand := []string{"Expand_example"} // []string | A comma-separated list of fields to expand. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.GetView(context.Background(), projectKey, viewKey).LDAPIVersion(lDAPIVersion).Sort(sort).Limit(limit).Offset(offset).Filter(filter).Expand(expand).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.GetView``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetView`: View
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.GetView`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string

Other Parameters

Other parameters are passed through a pointer to a apiGetViewRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

sort | string | A sort to apply to the list of views. | limit | int32 | The number of views to return. | offset | int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | filter | string | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). | expand | []string | A comma-separated list of fields to expand. |

Return type

View

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetViews

Views GetViews(ctx, projectKey).LDAPIVersion(lDAPIVersion).Sort(sort).Limit(limit).Offset(offset).Filter(filter).Expand(expand).Execute()

List views

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	sort := "sort_example" // string | A sort to apply to the list of views. (optional)
	limit := int32(56) // int32 | The number of views to return. (optional)
	offset := int32(56) // int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
	filter := "filter_example" // string | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). (optional)
	expand := []string{"Expand_example"} // []string | A comma-separated list of fields to expand. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.GetViews(context.Background(), projectKey).LDAPIVersion(lDAPIVersion).Sort(sort).Limit(limit).Offset(offset).Filter(filter).Expand(expand).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.GetViews``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetViews`: Views
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.GetViews`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string

Other Parameters

Other parameters are passed through a pointer to a apiGetViewsRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

sort | string | A sort to apply to the list of views. | limit | int32 | The number of views to return. | offset | int32 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | filter | string | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). | expand | []string | A comma-separated list of fields to expand. |

Return type

Views

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

LinkResource

LinkResourceSuccessResponse LinkResource(ctx, projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).ViewLinkRequest(viewLinkRequest).Execute()

Link resource

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 
	resourceType := "flags" // string | 
	viewLinkRequest := openapiclient.ViewLinkRequest{ViewLinkRequestFilter: openapiclient.NewViewLinkRequestFilter("maintainerId:507f1f77bcf86cd799439011,tags:backend+beta")} // ViewLinkRequest | Resources to link to the view. You can provide explicit keys/IDs, filters, or both. - Flags: identified by key or filtered by maintainerId, maintainerTeamKey, tags, state, query - Segments: identified by segment ID or filtered by tags, query, unbounded 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.LinkResource(context.Background(), projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).ViewLinkRequest(viewLinkRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.LinkResource``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `LinkResource`: LinkResourceSuccessResponse
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.LinkResource`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string
resourceType string

Other Parameters

Other parameters are passed through a pointer to a apiLinkResourceRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

viewLinkRequest | ViewLinkRequest | Resources to link to the view. You can provide explicit keys/IDs, filters, or both. - Flags: identified by key or filtered by maintainerId, maintainerTeamKey, tags, state, query - Segments: identified by segment ID or filtered by tags, query, unbounded |

Return type

LinkResourceSuccessResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnlinkResource

UnlinkResourceSuccessResponse UnlinkResource(ctx, projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).ViewLinkRequest(viewLinkRequest).Execute()

Unlink resource

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 
	resourceType := "flags" // string | 
	viewLinkRequest := openapiclient.ViewLinkRequest{ViewLinkRequestFilter: openapiclient.NewViewLinkRequestFilter("maintainerId:507f1f77bcf86cd799439011,tags:backend+beta")} // ViewLinkRequest | The resource to link to the view. Flags are identified by key. Segments are identified by segment ID.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.UnlinkResource(context.Background(), projectKey, viewKey, resourceType).LDAPIVersion(lDAPIVersion).ViewLinkRequest(viewLinkRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.UnlinkResource``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UnlinkResource`: UnlinkResourceSuccessResponse
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.UnlinkResource`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string
resourceType string

Other Parameters

Other parameters are passed through a pointer to a apiUnlinkResourceRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

viewLinkRequest | ViewLinkRequest | The resource to link to the view. Flags are identified by key. Segments are identified by segment ID. |

Return type

UnlinkResourceSuccessResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateView

View UpdateView(ctx, projectKey, viewKey).LDAPIVersion(lDAPIVersion).ViewPatch(viewPatch).Execute()

Update view

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	lDAPIVersion := "lDAPIVersion_example" // string | Version of the endpoint.
	projectKey := "default" // string | 
	viewKey := "my-view" // string | 
	viewPatch := *openapiclient.NewViewPatch() // ViewPatch | A JSON representation of the view including only the fields to update.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ViewsBetaApi.UpdateView(context.Background(), projectKey, viewKey).LDAPIVersion(lDAPIVersion).ViewPatch(viewPatch).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ViewsBetaApi.UpdateView``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateView`: View
	fmt.Fprintf(os.Stdout, "Response from `ViewsBetaApi.UpdateView`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string
viewKey string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateViewRequest struct via the builder pattern

Name Type Description Notes
lDAPIVersion string Version of the endpoint.

viewPatch | ViewPatch | A JSON representation of the view including only the fields to update. |

Return type

View

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]