Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Kotlin v4 client #4

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions kotlin/commissioning/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
132 changes: 132 additions & 0 deletions kotlin/commissioning/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
README.md
build.gradle
docs/ClientError.md
docs/ConflictError.md
docs/ConnectionType.md
docs/ConsumptionLifetimeResponse.md
docs/ConsumptionStatsResponse.md
docs/ConsumptionStatsResponseIntervalsInner.md
docs/DefaultApi.md
docs/EnergyLifetimeResponse.md
docs/EnvoysResponse.md
docs/EnvoysResponseEnvoysInner.md
docs/InventoryResponse.md
docs/InventoryResponseEnvoysInner.md
docs/InventoryResponseMetersInner.md
docs/InvertersSummaryByEnvoyOrSiteResponse.md
docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInner.md
docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerEnergy.md
docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerPowerProduced.md
docs/Meta.md
docs/MonthlyProductionResponse.md
docs/MonthlyProductionResponseMeterReadingsInner.md
docs/NotFoundError.md
docs/ProductionMeterReadingsResponse.md
docs/ProductionMeterReadingsResponseMeterReadingsInner.md
docs/RgmStatsResponse.md
docs/RgmStatsResponseIntervalsInner.md
docs/RgmStatsResponseMeterIntervalsInner.md
docs/RgmStatsResponseMeterIntervalsInnerIntervalsInner.md
docs/SearchSystemIdResponse.md
docs/ServerError.md
docs/StatsResponse.md
docs/StatsResponseIntervalsInner.md
docs/Status.md
docs/SummaryResponse.md
docs/SystemsResponse.md
docs/SystemsResponseSystemsInner.md
docs/UnprocessableEntityError.md
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
settings.gradle
src/main/kotlin/enlighten/apis/DefaultApi.kt
src/main/kotlin/enlighten/infrastructure/ApiAbstractions.kt
src/main/kotlin/enlighten/infrastructure/ApiClient.kt
src/main/kotlin/enlighten/infrastructure/ApiResponse.kt
src/main/kotlin/enlighten/infrastructure/BigDecimalAdapter.kt
src/main/kotlin/enlighten/infrastructure/BigIntegerAdapter.kt
src/main/kotlin/enlighten/infrastructure/ByteArrayAdapter.kt
src/main/kotlin/enlighten/infrastructure/Errors.kt
src/main/kotlin/enlighten/infrastructure/LocalDateAdapter.kt
src/main/kotlin/enlighten/infrastructure/LocalDateTimeAdapter.kt
src/main/kotlin/enlighten/infrastructure/OffsetDateTimeAdapter.kt
src/main/kotlin/enlighten/infrastructure/PartConfig.kt
src/main/kotlin/enlighten/infrastructure/RequestConfig.kt
src/main/kotlin/enlighten/infrastructure/RequestMethod.kt
src/main/kotlin/enlighten/infrastructure/ResponseExtensions.kt
src/main/kotlin/enlighten/infrastructure/Serializer.kt
src/main/kotlin/enlighten/infrastructure/URIAdapter.kt
src/main/kotlin/enlighten/infrastructure/UUIDAdapter.kt
src/main/kotlin/enlighten/models/ClientError.kt
src/main/kotlin/enlighten/models/ConflictError.kt
src/main/kotlin/enlighten/models/ConnectionType.kt
src/main/kotlin/enlighten/models/ConsumptionLifetimeResponse.kt
src/main/kotlin/enlighten/models/ConsumptionStatsResponse.kt
src/main/kotlin/enlighten/models/ConsumptionStatsResponseIntervalsInner.kt
src/main/kotlin/enlighten/models/EnergyLifetimeResponse.kt
src/main/kotlin/enlighten/models/EnvoysResponse.kt
src/main/kotlin/enlighten/models/EnvoysResponseEnvoysInner.kt
src/main/kotlin/enlighten/models/InventoryResponse.kt
src/main/kotlin/enlighten/models/InventoryResponseEnvoysInner.kt
src/main/kotlin/enlighten/models/InventoryResponseMetersInner.kt
src/main/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponse.kt
src/main/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInner.kt
src/main/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerEnergy.kt
src/main/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerPowerProduced.kt
src/main/kotlin/enlighten/models/Meta.kt
src/main/kotlin/enlighten/models/MonthlyProductionResponse.kt
src/main/kotlin/enlighten/models/MonthlyProductionResponseMeterReadingsInner.kt
src/main/kotlin/enlighten/models/NotFoundError.kt
src/main/kotlin/enlighten/models/ProductionMeterReadingsResponse.kt
src/main/kotlin/enlighten/models/ProductionMeterReadingsResponseMeterReadingsInner.kt
src/main/kotlin/enlighten/models/RgmStatsResponse.kt
src/main/kotlin/enlighten/models/RgmStatsResponseIntervalsInner.kt
src/main/kotlin/enlighten/models/RgmStatsResponseMeterIntervalsInner.kt
src/main/kotlin/enlighten/models/RgmStatsResponseMeterIntervalsInnerIntervalsInner.kt
src/main/kotlin/enlighten/models/SearchSystemIdResponse.kt
src/main/kotlin/enlighten/models/ServerError.kt
src/main/kotlin/enlighten/models/StatsResponse.kt
src/main/kotlin/enlighten/models/StatsResponseIntervalsInner.kt
src/main/kotlin/enlighten/models/Status.kt
src/main/kotlin/enlighten/models/SummaryResponse.kt
src/main/kotlin/enlighten/models/SystemsResponse.kt
src/main/kotlin/enlighten/models/SystemsResponseSystemsInner.kt
src/main/kotlin/enlighten/models/UnprocessableEntityError.kt
src/test/kotlin/enlighten/apis/DefaultApiTest.kt
src/test/kotlin/enlighten/models/ClientErrorTest.kt
src/test/kotlin/enlighten/models/ConflictErrorTest.kt
src/test/kotlin/enlighten/models/ConnectionTypeTest.kt
src/test/kotlin/enlighten/models/ConsumptionLifetimeResponseTest.kt
src/test/kotlin/enlighten/models/ConsumptionStatsResponseIntervalsInnerTest.kt
src/test/kotlin/enlighten/models/ConsumptionStatsResponseTest.kt
src/test/kotlin/enlighten/models/EnergyLifetimeResponseTest.kt
src/test/kotlin/enlighten/models/EnvoysResponseEnvoysInnerTest.kt
src/test/kotlin/enlighten/models/EnvoysResponseTest.kt
src/test/kotlin/enlighten/models/InventoryResponseEnvoysInnerTest.kt
src/test/kotlin/enlighten/models/InventoryResponseMetersInnerTest.kt
src/test/kotlin/enlighten/models/InventoryResponseTest.kt
src/test/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerEnergyTest.kt
src/test/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerPowerProducedTest.kt
src/test/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerTest.kt
src/test/kotlin/enlighten/models/InvertersSummaryByEnvoyOrSiteResponseTest.kt
src/test/kotlin/enlighten/models/MetaTest.kt
src/test/kotlin/enlighten/models/MonthlyProductionResponseMeterReadingsInnerTest.kt
src/test/kotlin/enlighten/models/MonthlyProductionResponseTest.kt
src/test/kotlin/enlighten/models/NotFoundErrorTest.kt
src/test/kotlin/enlighten/models/ProductionMeterReadingsResponseMeterReadingsInnerTest.kt
src/test/kotlin/enlighten/models/ProductionMeterReadingsResponseTest.kt
src/test/kotlin/enlighten/models/RgmStatsResponseIntervalsInnerTest.kt
src/test/kotlin/enlighten/models/RgmStatsResponseMeterIntervalsInnerIntervalsInnerTest.kt
src/test/kotlin/enlighten/models/RgmStatsResponseMeterIntervalsInnerTest.kt
src/test/kotlin/enlighten/models/RgmStatsResponseTest.kt
src/test/kotlin/enlighten/models/SearchSystemIdResponseTest.kt
src/test/kotlin/enlighten/models/ServerErrorTest.kt
src/test/kotlin/enlighten/models/StatsResponseIntervalsInnerTest.kt
src/test/kotlin/enlighten/models/StatsResponseTest.kt
src/test/kotlin/enlighten/models/StatusTest.kt
src/test/kotlin/enlighten/models/SummaryResponseTest.kt
src/test/kotlin/enlighten/models/SystemsResponseSystemsInnerTest.kt
src/test/kotlin/enlighten/models/SystemsResponseTest.kt
src/test/kotlin/enlighten/models/UnprocessableEntityErrorTest.kt
1 change: 1 addition & 0 deletions kotlin/commissioning/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.6.0
116 changes: 116 additions & 0 deletions kotlin/commissioning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# enlighten - Kotlin client library for The Enlighten Systems API

The Enlighten Systems API is a JSON-based API that provides access to performance data for a PV system. By using the Enlighten Systems API, you agree to the Enphase Energy API License Agreement.

Please note that the Enlighten Systems API does not provide performance data at a panel or microinverter level.

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.

- API version: 2.0
- Package version:
- Generator version: 7.6.0
- Build package: org.openapitools.codegen.languages.KotlinClientCodegen

## Requires

* Kotlin 1.7.21
* Gradle 7.5

## Build

First, create the gradle wrapper script:

```
gradle wrapper
```

Then, run:

```
./gradlew check assemble
```

This runs all tests and packages the library.

## Features/Implementation Notes

* Supports JSON inputs/outputs, File inputs, and Form inputs.
* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.

<a id="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

All URIs are relative to *https://api.enphaseenergy.com/api/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**consumptionLifetime**](docs/DefaultApi.md#consumptionlifetime) | **GET** /systems/{system_id}/consumption_lifetime |
*DefaultApi* | [**consumptionStats**](docs/DefaultApi.md#consumptionstats) | **GET** /systems/{system_id}/consumption_stats |
*DefaultApi* | [**energyLifetime**](docs/DefaultApi.md#energylifetime) | **GET** /systems/{system_id}/energy_lifetime |
*DefaultApi* | [**envoys**](docs/DefaultApi.md#envoys) | **GET** /systems/{system_id}/envoys |
*DefaultApi* | [**inventory**](docs/DefaultApi.md#inventory) | **GET** /systems/{system_id}/inventory |
*DefaultApi* | [**invertersSummaryByEnvoyOrSite**](docs/DefaultApi.md#inverterssummarybyenvoyorsite) | **GET** /systems/inverters_summary_by_envoy_or_site |
*DefaultApi* | [**monthlyProduction**](docs/DefaultApi.md#monthlyproduction) | **GET** /systems/{system_id}/monthly_production |
*DefaultApi* | [**productionMeterReadings**](docs/DefaultApi.md#productionmeterreadings) | **GET** /systems/{system_id}/production_meter_readings |
*DefaultApi* | [**rgmStats**](docs/DefaultApi.md#rgmstats) | **GET** /systems/{system_id}/rgm_stats |
*DefaultApi* | [**searchSystemId**](docs/DefaultApi.md#searchsystemid) | **GET** /systems/search_system_id |
*DefaultApi* | [**stats**](docs/DefaultApi.md#stats) | **GET** /systems/{system_id}/stats |
*DefaultApi* | [**summary**](docs/DefaultApi.md#summary) | **GET** /systems/{system_id}/summary |
*DefaultApi* | [**systems**](docs/DefaultApi.md#systems) | **GET** /systems |


<a id="documentation-for-models"></a>
## Documentation for Models

- [enlighten.models.ClientError](docs/ClientError.md)
- [enlighten.models.ConflictError](docs/ConflictError.md)
- [enlighten.models.ConnectionType](docs/ConnectionType.md)
- [enlighten.models.ConsumptionLifetimeResponse](docs/ConsumptionLifetimeResponse.md)
- [enlighten.models.ConsumptionStatsResponse](docs/ConsumptionStatsResponse.md)
- [enlighten.models.ConsumptionStatsResponseIntervalsInner](docs/ConsumptionStatsResponseIntervalsInner.md)
- [enlighten.models.EnergyLifetimeResponse](docs/EnergyLifetimeResponse.md)
- [enlighten.models.EnvoysResponse](docs/EnvoysResponse.md)
- [enlighten.models.EnvoysResponseEnvoysInner](docs/EnvoysResponseEnvoysInner.md)
- [enlighten.models.InventoryResponse](docs/InventoryResponse.md)
- [enlighten.models.InventoryResponseEnvoysInner](docs/InventoryResponseEnvoysInner.md)
- [enlighten.models.InventoryResponseMetersInner](docs/InventoryResponseMetersInner.md)
- [enlighten.models.InvertersSummaryByEnvoyOrSiteResponse](docs/InvertersSummaryByEnvoyOrSiteResponse.md)
- [enlighten.models.InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInner](docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInner.md)
- [enlighten.models.InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerEnergy](docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerEnergy.md)
- [enlighten.models.InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerPowerProduced](docs/InvertersSummaryByEnvoyOrSiteResponseMicroInvertersInnerPowerProduced.md)
- [enlighten.models.Meta](docs/Meta.md)
- [enlighten.models.MonthlyProductionResponse](docs/MonthlyProductionResponse.md)
- [enlighten.models.MonthlyProductionResponseMeterReadingsInner](docs/MonthlyProductionResponseMeterReadingsInner.md)
- [enlighten.models.NotFoundError](docs/NotFoundError.md)
- [enlighten.models.ProductionMeterReadingsResponse](docs/ProductionMeterReadingsResponse.md)
- [enlighten.models.ProductionMeterReadingsResponseMeterReadingsInner](docs/ProductionMeterReadingsResponseMeterReadingsInner.md)
- [enlighten.models.RgmStatsResponse](docs/RgmStatsResponse.md)
- [enlighten.models.RgmStatsResponseIntervalsInner](docs/RgmStatsResponseIntervalsInner.md)
- [enlighten.models.RgmStatsResponseMeterIntervalsInner](docs/RgmStatsResponseMeterIntervalsInner.md)
- [enlighten.models.RgmStatsResponseMeterIntervalsInnerIntervalsInner](docs/RgmStatsResponseMeterIntervalsInnerIntervalsInner.md)
- [enlighten.models.SearchSystemIdResponse](docs/SearchSystemIdResponse.md)
- [enlighten.models.ServerError](docs/ServerError.md)
- [enlighten.models.StatsResponse](docs/StatsResponse.md)
- [enlighten.models.StatsResponseIntervalsInner](docs/StatsResponseIntervalsInner.md)
- [enlighten.models.Status](docs/Status.md)
- [enlighten.models.SummaryResponse](docs/SummaryResponse.md)
- [enlighten.models.SystemsResponse](docs/SystemsResponse.md)
- [enlighten.models.SystemsResponseSystemsInner](docs/SystemsResponseSystemsInner.md)
- [enlighten.models.UnprocessableEntityError](docs/UnprocessableEntityError.md)


<a id="documentation-for-authorization"></a>
## Documentation for Authorization


Authentication schemes defined for the API:
<a id="ApiKey"></a>
### ApiKey

- **Type**: API key
- **API key parameter name**: key
- **Location**: URL query string

62 changes: 62 additions & 0 deletions kotlin/commissioning/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
group 'org.openapitools'
version '1.0.0'

wrapper {
gradleVersion = '8.7'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}

buildscript {
ext.kotlin_version = '1.9.23'
ext.spotless_version = "6.25.0"

repositories {
maven { url "https://repo1.maven.org/maven2" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
}
}

apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'com.diffplug.spotless'

repositories {
maven { url "https://repo1.maven.org/maven2" }
}

// Use spotless plugin to automatically format code, remove unused import, etc
// To apply changes directly to the file, run `gradlew spotlessApply`
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
// comment out below to run spotless as part of the `check` task
enforceCheck false

format 'misc', {
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
target '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // Takes an integer argument if you don't like 4
endWithNewline()
}
kotlin {
ktfmt()
}
}

test {
useJUnitPlatform()
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.squareup.moshi:moshi-kotlin:1.15.1"
implementation "com.squareup.moshi:moshi-adapters:1.15.1"
implementation "com.squareup.okhttp3:okhttp:4.12.0"
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
}
Loading