Skip to content

Commit c969998

Browse files
authored
fix: add missing PermissionResource types from Cloud definition (#46)
1 parent 615e64f commit c969998

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ jobs:
214214
name: Install Maven & Curl
215215
command: |
216216
apt-get update
217-
apt-get install maven curl --yes
217+
apt-get install maven curl wget --yes
218218
- run:
219219
name: Checks generating sources from swagger
220220
command: |

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,8 @@ SourceKitten/
102102

103103
# Junit
104104
junit.xml
105-
tests.xml
105+
tests.xml
106+
107+
Scripts/cloud.yml
108+
Scripts/oss.yml
109+
Scripts/influxdb-clients-apigen/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.0.0 [unreleased]
22

3+
### Bug Fixes
4+
1. [#46](https://github.com/influxdata/influxdb-client-swift/pull/46): Add missing PermissionResources from Cloud API definition
5+
36
## 0.9.0 [2021-11-26]
47

58
### Documentation

Scripts/generate-sources.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
#
44
# How to run script from ROOT path:
5-
# docker run --rm -it -v "${PWD}":/code -v ~/.m2:/root/.m2 -w /code maven:3.6-slim /code/Scripts/generate-sources.sh
5+
# docker run --rm -it -v "${PWD}":/code -v ~/.m2:/root/.m2 -w /code maven:3-openjdk-8 /code/Scripts/generate-sources.sh
66
#
77

88
SCRIPT_PATH="$( cd "$(dirname "$0")" || exit ; pwd -P )"
99

1010
rm -rf "${SCRIPT_PATH}"/generated
1111

12+
# Download and merge OSS and Cloud definition
13+
rm -rf "${SCRIPT_PATH}"/oss.yml || true
14+
rm -rf "${SCRIPT_PATH}"/cloud.yml || true
15+
rm -rf "${SCRIPT_PATH}"/influxdb-clients-apigen || true
16+
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml -O "${SCRIPT_PATH}/oss.yml"
17+
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/cloud.yml -O "${SCRIPT_PATH}/cloud.yml"
18+
git clone --single-branch --branch master https://github.com/bonitoo-io/influxdb-clients-apigen "${SCRIPT_PATH}/influxdb-clients-apigen"
19+
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"
20+
1221
# Generate client
1322
cd "${SCRIPT_PATH}"/ || exit
1423
mvn org.openapitools:openapi-generator-maven-plugin:generate

Scripts/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<artifactId>openapi-generator-maven-plugin</artifactId>
1515
<version>5.1.0</version>
1616
<configuration>
17-
<inputSpec>https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml</inputSpec>
17+
<inputSpec>./oss.yml</inputSpec>
1818
<generatorName>swift5</generatorName>
1919
<configOptions>
2020
<projectName>InfluxDB2</projectName>

Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public struct Resource: Codable {
2929
case checks = "checks"
3030
case dbrp = "dbrp"
3131
case notebooks = "notebooks"
32+
case annotations = "annotations"
33+
case remotes = "remotes"
34+
case replications = "replications"
35+
case flows = "flows"
36+
case functions = "functions"
3237
}
3338
public var type: ModelType
3439
/** If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. */

0 commit comments

Comments
 (0)