Skip to content

Commit

Permalink
fix: add missing PermissionResource types from Cloud definition (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Feb 1, 2022
1 parent 615e64f commit c969998
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
name: Install Maven & Curl
command: |
apt-get update
apt-get install maven curl --yes
apt-get install maven curl wget --yes
- run:
name: Checks generating sources from swagger
command: |
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ SourceKitten/

# Junit
junit.xml
tests.xml
tests.xml

Scripts/cloud.yml
Scripts/oss.yml
Scripts/influxdb-clients-apigen/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 1.0.0 [unreleased]

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

## 0.9.0 [2021-11-26]

### Documentation
Expand Down
11 changes: 10 additions & 1 deletion Scripts/generate-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

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

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 org.openapitools:openapi-generator-maven-plugin:generate
Expand Down
2 changes: 1 addition & 1 deletion Scripts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.1.0</version>
<configuration>
<inputSpec>https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml</inputSpec>
<inputSpec>./oss.yml</inputSpec>
<generatorName>swift5</generatorName>
<configOptions>
<projectName>InfluxDB2</projectName>
Expand Down
5 changes: 5 additions & 0 deletions Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public struct Resource: Codable {
case checks = "checks"
case dbrp = "dbrp"
case notebooks = "notebooks"
case annotations = "annotations"
case remotes = "remotes"
case replications = "replications"
case flows = "flows"
case functions = "functions"
}
public var type: ModelType
/** 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. */
Expand Down

0 comments on commit c969998

Please sign in to comment.