Skip to content

Commit

Permalink
fix: add missing PermissionResource types from Cloud definition (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Feb 3, 2022
1 parent ffb88c5 commit c22aa71
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11,885 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ test-results
*.js_
*.js.deps
*.js.map
scripts/cloud.yml
scripts/oss.yml
scripts/generated
scripts/influxdb-clients-apigen
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
### Features
1. [#33](https://github.com/influxdata/influxdb-client-dart/pull/33): Add support for Parameterized Queries

### Bug Fixes
1. [#35](https://github.com/influxdata/influxdb-client-dart/pull/35): Add missing PermissionResources from Cloud API definition

### Documentation
1. [#33](https://github.com/influxdata/influxdb-client-dart/pull/33): Add Parameterized Queries example

Expand Down
8 changes: 8 additions & 0 deletions lib/model/resource.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class ResourceTypeEnum {
static const annotations = ResourceTypeEnum._(r'annotations');
static const remotes = ResourceTypeEnum._(r'remotes');
static const replications = ResourceTypeEnum._(r'replications');
static const flows = ResourceTypeEnum._(r'flows');
static const functions = ResourceTypeEnum._(r'functions');

/// List of all possible values in this [enum][ResourceTypeEnum].
static const values = <ResourceTypeEnum>[
Expand All @@ -187,6 +189,8 @@ class ResourceTypeEnum {
annotations,
remotes,
replications,
flows,
functions,
];

static ResourceTypeEnum? fromJson(dynamic value) =>
Expand Down Expand Up @@ -271,6 +275,10 @@ class ResourceTypeEnumTypeTransformer {
return ResourceTypeEnum.remotes;
case r'replications':
return ResourceTypeEnum.replications;
case r'flows':
return ResourceTypeEnum.flows;
case r'functions':
return ResourceTypeEnum.functions;
default:
return ResourceTypeEnum._(data.toString());
}
Expand Down
9 changes: 9 additions & 0 deletions scripts/generate-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ SCRIPT_PATH="$( cd "$(dirname "$0")" || exit ; pwd -P )"

rm -rf "${SCRIPT_PATH}"/generated

# Download and merge OSS and Cloud definition
rm -rf "${SCRIPT_PATH}"/oss.yml || true
rm -rf "${SCRIPT_PATH}"/cloud.yml || true
rm -rf "${SCRIPT_PATH}"/influxdb-clients-apigen || true
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml -O "${SCRIPT_PATH}/oss.yml"
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/cloud.yml -O "${SCRIPT_PATH}/cloud.yml"
git clone --single-branch --branch master https://github.com/bonitoo-io/influxdb-clients-apigen "${SCRIPT_PATH}/influxdb-clients-apigen"
mvn -f "$SCRIPT_PATH"/influxdb-clients-apigen/openapi-generator/pom.xml compile exec:java -Dexec.mainClass="com.influxdb.AppendCloudDefinitions" -Dexec.args="$SCRIPT_PATH/oss.yml $SCRIPT_PATH/cloud.yml"

# Generate client
cd "${SCRIPT_PATH}"/ || exit
mvn -U -Dskip-validate-spec org.openapitools:openapi-generator-maven-plugin:generate
Expand Down
4 changes: 1 addition & 3 deletions scripts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ http://maven.apache.org/POM/4.0.0 ">
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.3.0</version>
<configuration>
<inputSpec>
https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml
</inputSpec>
<inputSpec>./oss.yml</inputSpec>
<generatorName>dart</generatorName>
<configOptions>
<projectName>InfluxDB2</projectName>
Expand Down

0 comments on commit c22aa71

Please sign in to comment.