Skip to content

Latest commit

 

History

History
758 lines (610 loc) · 31.7 KB

File metadata and controls

758 lines (610 loc) · 31.7 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(ldAPIVersion, projectKey, viewPost)

Create view

Create a new view in the given project.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    ViewPost viewPost = new ViewPost(); // ViewPost | View object to create
    try {
      View result = apiInstance.createView(ldAPIVersion, projectKey, viewPost);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#createView");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewPost ViewPost View object to create

Return type

View

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

deleteView

deleteView(ldAPIVersion, projectKey, viewKey)

Delete view

Delete a specific view by its key.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    try {
      apiInstance.deleteView(ldAPIVersion, projectKey, viewKey);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#deleteView");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No content -
403 Forbidden -
404 Not found -
500 Internal server error -

getLinkedResources

ViewLinkedResources getLinkedResources(ldAPIVersion, projectKey, viewKey, resourceType, limit, offset, sort, query, filter, expand)

Get linked resources

Get a list of all linked resources for a given view.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    String resourceType = "flags"; // String | 
    Integer limit = 56; // Integer | The number of views to return.
    Integer offset = 56; // Integer | 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`.
    String sort = "linkedAt"; // String | Field to sort by. Default field is `linkedAt`, default order is ascending.
    String query = "query_example"; // String | Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name.
    String 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. 
    List<String> expand = Arrays.asList(); // List<String> | A comma-separated list of fields to expand.
    try {
      ViewLinkedResources result = apiInstance.getLinkedResources(ldAPIVersion, projectKey, viewKey, resourceType, limit, offset, sort, query, filter, expand);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#getLinkedResources");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String
resourceType String [enum: flags, segments]
limit Integer The number of views to return. [optional]
offset Integer 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 String Field to sort by. Default field is `linkedAt`, default order is ascending. [optional] [default to linkedAt] [enum: linkedAt, name]
query String Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name. [optional]
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. [optional]
expand List<String> A comma-separated list of fields to expand. [optional] [enum: maintainer, resourceDetails]

Return type

ViewLinkedResources

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

getLinkedViews

Views getLinkedViews(ldAPIVersion, projectKey, resourceType, resourceKey, environmentId, limit, offset)

Get linked views for a given resource

Get a list of all linked views for a resource. Flags are identified by key. Segments are identified by segment ID.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String resourceType = "flags"; // String | 
    String resourceKey = "my-flag"; // String | 
    String environmentId = "6890ff25c3e3830ba1a352e4"; // String | Environment ID. Required when resourceType is 'segments'
    Integer limit = 56; // Integer | The number of views to return.
    Integer offset = 56; // Integer | 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`.
    try {
      Views result = apiInstance.getLinkedViews(ldAPIVersion, projectKey, resourceType, resourceKey, environmentId, limit, offset);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#getLinkedViews");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
resourceType String [enum: flags, segments]
resourceKey String
environmentId String Environment ID. Required when resourceType is 'segments' [optional]
limit Integer The number of views to return. [optional]
offset Integer 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]

Return type

Views

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

getView

View getView(ldAPIVersion, projectKey, viewKey, sort, limit, offset, filter, expand)

Get view

Retrieve a specific view by its key.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    String sort = "key"; // String | A sort to apply to the list of views.
    Integer limit = 56; // Integer | The number of views to return.
    Integer offset = 56; // Integer | 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`.
    String 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).
    List<String> expand = Arrays.asList(); // List<String> | A comma-separated list of fields to expand.
    try {
      View result = apiInstance.getView(ldAPIVersion, projectKey, viewKey, sort, limit, offset, filter, expand);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#getView");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String
sort String A sort to apply to the list of views. [optional] [enum: key, name, updatedAt]
limit Integer The number of views to return. [optional]
offset Integer 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 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 List<String> A comma-separated list of fields to expand. [optional] [enum: allFlags, allSegments, allResources, maintainer, flagsSummary, segmentsSummary, resourceSummary]

Return type

View

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

getViews

Views getViews(ldAPIVersion, projectKey, sort, limit, offset, filter, expand)

List views

Get a list of all views in the given project.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String sort = "key"; // String | A sort to apply to the list of views.
    Integer limit = 56; // Integer | The number of views to return.
    Integer offset = 56; // Integer | 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`.
    String 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).
    List<String> expand = Arrays.asList(); // List<String> | A comma-separated list of fields to expand.
    try {
      Views result = apiInstance.getViews(ldAPIVersion, projectKey, sort, limit, offset, filter, expand);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#getViews");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
sort String A sort to apply to the list of views. [optional] [enum: key, name, updatedAt]
limit Integer The number of views to return. [optional]
offset Integer 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 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 List<String> A comma-separated list of fields to expand. [optional] [enum: flagsSummary, segmentsSummary, resourceSummary]

Return type

Views

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

linkResource

LinkResourceSuccessResponse linkResource(ldAPIVersion, projectKey, viewKey, resourceType, viewLinkRequest)

Link resource

Link one or multiple resources to a view by keys, filters, or both: - Link flags using flag keys or filters (maintainerId, maintainerTeamKey, tags, state, query) - Link segments using segment IDs or filters (tags, query, unbounded) When both keys and filters are provided, resources matching either condition are linked (union).

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    String resourceType = "flags"; // String | 
    ViewLinkRequest viewLinkRequest = new 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 
    try {
      LinkResourceSuccessResponse result = apiInstance.linkResource(ldAPIVersion, projectKey, viewKey, resourceType, viewLinkRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#linkResource");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String
resourceType String [enum: flags, segments]
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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

unlinkResource

UnlinkResourceSuccessResponse unlinkResource(ldAPIVersion, projectKey, viewKey, resourceType, viewLinkRequest)

Unlink resource

Unlink one or multiple resources from a view: - Unlink flags using flag keys - Unlink segments using segment IDs

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    String resourceType = "flags"; // String | 
    ViewLinkRequest viewLinkRequest = new ViewLinkRequest(); // ViewLinkRequest | The resource to link to the view. Flags are identified by key. Segments are identified by segment ID.
    try {
      UnlinkResourceSuccessResponse result = apiInstance.unlinkResource(ldAPIVersion, projectKey, viewKey, resourceType, viewLinkRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#unlinkResource");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String
resourceType String [enum: flags, segments]
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

HTTP response details

Status code Description Response headers
200 Successful response with unlink details -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -

updateView

View updateView(ldAPIVersion, projectKey, viewKey, viewPatch)

Update view

Edit an existing view. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: ``` { &quot;description&quot;: &quot;Example updated description&quot;, &quot;tags&quot;: [&quot;new-tag&quot;] } ```

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ViewsBetaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ViewsBetaApi apiInstance = new ViewsBetaApi(defaultClient);
    String ldAPIVersion = "beta"; // String | Version of the endpoint.
    String projectKey = "default"; // String | 
    String viewKey = "my-view"; // String | 
    ViewPatch viewPatch = new ViewPatch(); // ViewPatch | A JSON representation of the view including only the fields to update.
    try {
      View result = apiInstance.updateView(ldAPIVersion, projectKey, viewKey, viewPatch);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ViewsBetaApi#updateView");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
ldAPIVersion String Version of the endpoint. [enum: beta]
projectKey String
viewKey String
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

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad request -
403 Forbidden -
404 Not found -
500 Internal server error -