Skip to content

Commit

Permalink
chore: update Swagger API to latest version (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Apr 22, 2021
1 parent 252cad4 commit b0e23a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### API
1. [#31](https://github.com/influxdata/influxdb-client-swift/pull/31): Update management API to code produced by `openapi-generator` v5.1.0
1. [#32](https://github.com/influxdata/influxdb-client-ruby/pull/32): Update swagger to latest version

## 0.3.0 [2021-04-01]

Expand Down
5 changes: 5 additions & 0 deletions Scripts/generate-sources.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

#
# 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
#

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

rm -rf "${SCRIPT_PATH}"/generated
Expand Down
11 changes: 7 additions & 4 deletions Sources/InfluxDBSwiftApis/Generated/APIs/AuthorizationsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ public class AuthorizationsAPI {
- parameter user: (query) Only show authorizations that belong to a user name. (optional)
- parameter orgID: (query) Only show authorizations that belong to an organization ID. (optional)
- parameter org: (query) Only show authorizations that belong to a organization name. (optional)
- parameter token: (query) Find a token by value. (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
public func getAuthorizations(zapTraceSpan: String? = nil, userID: String? = nil, user: String? = nil, orgID: String? = nil, org: String? = nil, apiResponseQueue: DispatchQueue? = nil, completion: @escaping (_ data: Authorizations?,_ error: InfluxDBClient.InfluxDBError?) -> Void) {
getAuthorizationsWithRequestBuilder(zapTraceSpan: zapTraceSpan, userID: userID, user: user, orgID: orgID, org: org).execute(apiResponseQueue ?? self.influxDB2API.apiResponseQueue) { result -> Void in
public func getAuthorizations(zapTraceSpan: String? = nil, userID: String? = nil, user: String? = nil, orgID: String? = nil, org: String? = nil, token: String? = nil, apiResponseQueue: DispatchQueue? = nil, completion: @escaping (_ data: Authorizations?,_ error: InfluxDBClient.InfluxDBError?) -> Void) {
getAuthorizationsWithRequestBuilder(zapTraceSpan: zapTraceSpan, userID: userID, user: user, orgID: orgID, org: org, token: token).execute(apiResponseQueue ?? self.influxDB2API.apiResponseQueue) { result -> Void in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -93,9 +94,10 @@ public class AuthorizationsAPI {
- parameter user: (query) Only show authorizations that belong to a user name. (optional)
- parameter orgID: (query) Only show authorizations that belong to an organization ID. (optional)
- parameter org: (query) Only show authorizations that belong to a organization name. (optional)
- parameter token: (query) Find a token by value. (optional)
- returns: RequestBuilder<Authorizations>
*/
internal func getAuthorizationsWithRequestBuilder(zapTraceSpan: String? = nil, userID: String? = nil, user: String? = nil, orgID: String? = nil, org: String? = nil) -> RequestBuilder<Authorizations> {
internal func getAuthorizationsWithRequestBuilder(zapTraceSpan: String? = nil, userID: String? = nil, user: String? = nil, orgID: String? = nil, org: String? = nil, token: String? = nil) -> RequestBuilder<Authorizations> {
let path = "/authorizations"
let URLString = influxDB2API.basePath + "/api/v2" + path
let parameters: [String:Any]? = nil
Expand All @@ -105,7 +107,8 @@ public class AuthorizationsAPI {
"userID": userID?.encodeToJSON(),
"user": user?.encodeToJSON(),
"orgID": orgID?.encodeToJSON(),
"org": org?.encodeToJSON()
"org": org?.encodeToJSON(),
"token": token?.encodeToJSON()
])
let nillableHeaders: [String: Any?] = [
"Zap-Trace-Span": zapTraceSpan?.encodeToJSON()
Expand Down

0 comments on commit b0e23a7

Please sign in to comment.