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

fix: add missing PermissionResource types from Cloud definition #35

Merged
merged 2 commits into from
Feb 3, 2022
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading