Module optimizely

ballerinax/optimizely Ballerina library

1.5.1

Overview

This is a generated connector for Optimizely API v2 OpenAPI specification.

Optimizely Agent is a stand-alone, open-source microservice that provides major benefits over using Optimizely SDKs in certain use cases. Its REST API offers consolidated and simplified endpoints for accessing all the functionality of Optimizely Full Stack SDKs. Use this API the control experiments (such as a feature tests).

Prerequisites

Before using this connector in your Ballerina application, complete the following:

Quickstart

To use the Optimizely connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

First, import the ballerinax/optimizely module into the Ballerina project.

Copy
import ballerinax/optimizely;

Step 2: Create a new connector instance

Create a optimizely:CredentialsConfig with the <TOKEN> obtained, and initialize the connector with it.

Copy
optimizely:ClientConfig clientConfig = {
    auth : {
        token: `<TOKEN>`
    }
};

optimizely:Client baseClient = check new Client(clientConfig);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.

    Following is an example to list attributes under a project using the connector.

    Copy
    public function main() {
        int projectId = 231112;
        optimizely:Attribute[]|error response = baseClient->listAttributes(projectId);
        if (response is optimizely:Attribute[]) {
            log:printInfo(response.toString());
        } else {
            log:printError(response.message());
        }
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/optimizely;Copy

Metadata

Released date: 12 months ago

Version: 1.5.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.4.1

GraalVM compatible: Yes


Pull count

Total: 0

Current verison: 0


Weekly downloads


Source repository


Keywords

IT Operations/Testing Tools

Cost/Paid


Contributors

Other versions