LaunchDarkly API Client for Java

Official LaunchDarkly API Client for Java

License

License

Categories

Categories

Java Languages CLI User Interface
GroupId

GroupId

com.launchdarkly
ArtifactId

ArtifactId

api-client-java
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

LaunchDarkly API Client for Java
Official LaunchDarkly API Client for Java
Project URL

Project URL

https://github.com/launchdarkly/api-client-java
Source Code Management

Source Code Management

https://github.com/launchdarkly/api-client-java

Download api-client-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.launchdarkly/api-client-java/ -->
<dependency>
    <groupId>com.launchdarkly</groupId>
    <artifactId>api-client-java</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.launchdarkly/api-client-java/
implementation 'com.launchdarkly:api-client-java:1.0.0'
// https://jarcasting.com/artifacts/com.launchdarkly/api-client-java/
implementation ("com.launchdarkly:api-client-java:1.0.0")
'com.launchdarkly:api-client-java:jar:1.0.0'
<dependency org="com.launchdarkly" name="api-client-java" rev="1.0.0">
  <artifact name="api-client-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.launchdarkly', module='api-client-java', version='1.0.0')
)
libraryDependencies += "com.launchdarkly" % "api-client-java" % "1.0.0"
[com.launchdarkly/api-client-java "1.0.0"]

Dependencies

compile (5)

Group / Artifact Type Version
joda-time : joda-time jar 2.9.9
com.squareup.okhttp : okhttp jar 2.7.5
com.google.code.gson : gson jar 2.8.1
com.squareup.okhttp : logging-interceptor jar 2.7.5
io.swagger : swagger-annotations jar 1.5.15

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

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

api-client

LaunchDarkly REST API

  • API version: 4.0.0
    • Build date: 2020-12-15T02:54:39.973Z

Build custom integrations with the LaunchDarkly REST API

For more information, please visit https://support.launchdarkly.com

Automatically generated by the Swagger Codegen

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.launchdarkly</groupId>
  <artifactId>api-client</artifactId>
  <version>4.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.launchdarkly:api-client:4.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/api-client-4.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.launchdarkly.api.*;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.model.*;
import com.launchdarkly.api.api.AccessTokensApi;

import java.io.File;
import java.util.*;

public class AccessTokensApiExample {

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

        AccessTokensApi apiInstance = new AccessTokensApi();
        String tokenId = "tokenId_example"; // String | The access token ID.
        try {
            apiInstance.deleteToken(tokenId);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccessTokensApi#deleteToken");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
AccessTokensApi deleteToken DELETE /tokens/{tokenId} Delete an access token by ID.
AccessTokensApi getToken GET /tokens/{tokenId} Get a single access token by ID.
AccessTokensApi getTokens GET /tokens Returns a list of tokens in the account.
AccessTokensApi patchToken PATCH /tokens/{tokenId} Modify an access token by ID.
AccessTokensApi postToken POST /tokens Create a new token.
AccessTokensApi resetToken POST /tokens/{tokenId}/reset Reset an access token's secret key with an optional expiry time for the old key.
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.
CustomerMetricsApi getEvaluations GET /usage/evaluations/{envId}/{flagKey} Get events usage by event id and the feature flag key.
CustomerMetricsApi getEvent GET /usage/events/{type} Get events usage by event type.
CustomerMetricsApi getEvents GET /usage/events Get events usage endpoints.
CustomerMetricsApi getMAU GET /usage/mau Get monthly active user data.
CustomerMetricsApi getMAUByCategory GET /usage/mau/bycategory Get monthly active user data by category.
CustomerMetricsApi getStream GET /usage/streams/{source} Get a stream endpoint and return timeseries data.
CustomerMetricsApi getStreamBySDK GET /usage/streams/{source}/bysdkversion Get a stream timeseries data by source show sdk version metadata.
CustomerMetricsApi getStreamSDKVersion GET /usage/streams/{source}/sdkversions Get a stream timeseries data by source and show all sdk version associated.
CustomerMetricsApi getStreams GET /usage/streams Returns a list of all streams.
CustomerMetricsApi getUsage GET /usage Returns of the usage endpoints available.
DataExportDestinationsApi deleteDestination DELETE /destinations/{projectKey}/{environmentKey}/{destinationId} Get a single data export destination by ID
DataExportDestinationsApi getDestination GET /destinations/{projectKey}/{environmentKey}/{destinationId} Get a single data export destination by ID
DataExportDestinationsApi getDestinations GET /destinations Returns a list of all data export destinations.
DataExportDestinationsApi patchDestination PATCH /destinations/{projectKey}/{environmentKey}/{destinationId} Perform a partial update to a data export destination.
DataExportDestinationsApi postDestination POST /destinations/{projectKey}/{environmentKey} Create a new data export destination
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.
EnvironmentsApi resetEnvironmentMobileKey POST /projects/{projectKey}/environments/{environmentKey}/mobileKey Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
EnvironmentsApi resetEnvironmentSDKKey POST /projects/{projectKey}/environments/{environmentKey}/apiKey Reset an environment's SDK key with an optional expiry time for the old key.
FeatureFlagsApi copyFeatureFlag POST /flags/{projectKey}/{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 deleteFeatureFlagApprovalRequest DELETE /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagApprovalRequestId} Delete an approval request for a feature flag
FeatureFlagsApi getExpiringUserTargets GET /flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey} Get expiring user targets for feature flag
FeatureFlagsApi getFeatureFlag GET /flags/{projectKey}/{featureFlagKey} Get a single feature flag by key.
FeatureFlagsApi getFeatureFlagApprovalRequest GET /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagApprovalRequestId} Get a single approval request for a feature flag
FeatureFlagsApi getFeatureFlagApprovalRequests GET /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests Get all approval requests for a feature flag
FeatureFlagsApi getFeatureFlagStatus GET /flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey} Get the status for a particular feature flag.
FeatureFlagsApi getFeatureFlagStatusAcrossEnvironments GET /flag-status/{projectKey}/{featureFlagKey} Get the status for a particular feature flag across environments
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 patchExpiringUserTargets PATCH /flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey} Update, add, or delete expiring user targets on feature flag
FeatureFlagsApi patchFeatureFlag PATCH /flags/{projectKey}/{featureFlagKey} Perform a partial update to a feature.
FeatureFlagsApi postApplyFeatureFlagApprovalRequest POST /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagApprovalRequestId}/apply Apply approval request for a feature flag
FeatureFlagsApi postFeatureFlag POST /flags/{projectKey} Creates a new feature flag.
FeatureFlagsApi postFeatureFlagApprovalRequest POST /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagApprovalRequestId} Create an approval request for a feature flag
FeatureFlagsApi postReviewFeatureFlagApprovalRequest POST /projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagApprovalRequestId}/review Review approval request for a feature flag
IntegrationsApi deleteIntegrationSubscription DELETE /integrations/{integrationKey}/{integrationId} Delete an integration subscription by ID.
IntegrationsApi getIntegrationSubscription GET /integrations/{integrationKey}/{integrationId} Get a single integration subscription by ID.
IntegrationsApi getIntegrationSubscriptions GET /integrations/{integrationKey} Get a list of all configured integrations of a given kind.
IntegrationsApi getIntegrations GET /integrations Get a list of all configured audit log event integrations associated with this account.
IntegrationsApi patchIntegrationSubscription PATCH /integrations/{integrationKey}/{integrationId} Modify an integration subscription by ID.
IntegrationsApi postIntegrationSubscription POST /integrations/{integrationKey} Create a new integration subscription of a given kind.
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.
RelayProxyConfigurationsApi deleteRelayProxyConfig DELETE /account/relay-auto-configs/{id} Delete a relay proxy configuration by ID.
RelayProxyConfigurationsApi getRelayProxyConfig GET /account/relay-auto-configs/{id} Get a single relay proxy configuration by ID.
RelayProxyConfigurationsApi getRelayProxyConfigs GET /account/relay-auto-configs Returns a list of relay proxy configurations in the account.
RelayProxyConfigurationsApi patchRelayProxyConfig PATCH /account/relay-auto-configs/{id} Modify a relay proxy configuration by ID.
RelayProxyConfigurationsApi postRelayAutoConfig POST /account/relay-auto-configs Create a new relay proxy config.
RelayProxyConfigurationsApi resetRelayProxyConfig POST /account/relay-auto-configs/{id}/reset Reset a relay proxy configuration's secret key with an optional expiry time for the old key.
RootApi getRoot GET /
TeamMembersApi deleteMember DELETE /members/{memberId} Delete a team member by ID.
TeamMembersApi getMe GET /members/me Get the current team member associated with the token
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 getExpiringUserTargetsOnSegment GET /segments/{projectKey}/{userSegmentKey}/expiring-user-targets/{environmentKey} Get expiring user targets for 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 patchExpiringUserTargetsOnSegment PATCH /segments/{projectKey}/{userSegmentKey}/expiring-user-targets/{environmentKey} Update, add, or delete expiring user targets on user segment
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.
UserSegmentsApi updatedUnboundedSegmentTargets POST /segments/{projectKey}/{environmentKey}/{userSegmentKey}/unbounded-users Update targets included or excluded in an unbounded segment
UserSettingsApi getExpiringUserTargetsForUser GET /users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey} Get expiring dates on flags for user
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 patchExpiringUserTargetsForFlags PATCH /users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey} Update, add, or delete expiring user targets for a single user on all flags
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

Documentation for Authorization

Authentication schemes defined for the API:

Token

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]

com.launchdarkly

LaunchDarkly

Fast and reliable feature management for the modern enterprise

Versions

Version
1.0.0