Skip to content

Java/Kotlin client library

To use this library you first need to connect to our Maven feed. Generate a personal access token and then add it to your Maven configuration (~/.m2/settings.xml):

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>enpxio</id>
      <username>enbw</username>
      <password>[PERSONAL_ACCESS_TOKEN]</password>
    </server>
  </servers>
</settings>

You can then consume the library using Maven by adding this to your pom.xml:

<repository>
  <id>enpxio</id>
  <url>https://pkgs.dev.azure.com/enbw/EnPowerX/_packaging/enpxio/maven/v1</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

<dependencies>
  <dependency>
    <groupId>io.enpowerx</groupId>
    <artifactId>apis</artifactId>
    <version>0.1.0-beta0000-5e1b2ba</version>
  </dependency>
</dependencies>

You can then consume the library using Gradle by adding this to your build.gradle:

maven {
    url 'https://pkgs.dev.azure.com/enbw/EnPowerX/_packaging/enpxio/maven/v1'
    name 'enpxio'
    authentication {
        basic(BasicAuthentication)
    }
}

dependencies {
    compile(group: 'io.enpowerx', name: 'apis', version: '0.1.0-beta0000-5e1b2ba')
}

Sample code to list Offers:

ManagedChannel channel = EnPowerX.channel("dev.enpowerx.io", clientId, clientSecret);
OffersGrpc.OffersBlockingStub offers = OffersGrpc.newBlockingStub(channel);
var channel = EnPowerX.channel("dev.enpowerx.io", clientId, clientSecret)
var offers = OffersGrpc.newBlockingStub(channel)