Skip to content

Commit

Permalink
feat: automated openapi client update
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger authored and kleisterz committed Oct 17, 2024
1 parent 01d00e5 commit 0bcb784
Show file tree
Hide file tree
Showing 10 changed files with 711 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ docs/PackUsers.md
docs/Packs.md
docs/Profile.md
docs/ProfileApi.md
docs/Provider.md
docs/Providers.md
docs/Quilt.md
docs/QuiltApi.md
docs/QuiltBuildParams.md
Expand Down Expand Up @@ -143,6 +145,8 @@ lib/kleister/models/pack_user_params.rb
lib/kleister/models/pack_users.rb
lib/kleister/models/packs.rb
lib/kleister/models/profile.rb
lib/kleister/models/provider.rb
lib/kleister/models/providers.rb
lib/kleister/models/quilt.rb
lib/kleister/models/quilt_build_params.rb
lib/kleister/models/quilt_builds.rb
Expand Down Expand Up @@ -176,4 +180,6 @@ lib/kleister/models/version_builds.rb
lib/kleister/models/version_file.rb
lib/kleister/models/versions.rb
lib/kleister/version.rb
spec/models/provider_spec.rb
spec/models/providers_spec.rb
spec/spec_helper.rb
60 changes: 60 additions & 0 deletions docs/AuthApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All URIs are relative to *https://try.kleister.eu/api/v1*
| ------ | ------------ | ----------- |
| [**external_callback**](AuthApi.md#external_callback) | **GET** /auth/{provider}/callback | Callback for external authentication |
| [**external_initialize**](AuthApi.md#external_initialize) | **GET** /auth/{provider}/initialize | Initialize the external authentication |
| [**external_providers**](AuthApi.md#external_providers) | **GET** /auth/providers | Fetch the available auth providers |
| [**login_auth**](AuthApi.md#login_auth) | **POST** /auth/login | Authenticate an user by credentials |
| [**refresh_auth**](AuthApi.md#refresh_auth) | **GET** /auth/refresh | Refresh an auth token before it expires |
| [**verify_auth**](AuthApi.md#verify_auth) | **GET** /auth/verify | Verify validity for an authentication token |
Expand Down Expand Up @@ -145,6 +146,65 @@ No authorization required
- **Accept**: application/json


## external_providers

> <Providers> external_providers
Fetch the available auth providers

### Examples

```ruby
require 'time'
require 'kleister'

api_instance = Kleister::AuthApi.new

begin
# Fetch the available auth providers
result = api_instance.external_providers
p result
rescue Kleister::ApiError => e
puts "Error when calling AuthApi->external_providers: #{e}"
end
```

#### Using the external_providers_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> <Array(<Providers>, Integer, Hash)> external_providers_with_http_info
```ruby
begin
# Fetch the available auth providers
data, status_code, headers = api_instance.external_providers_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <Providers>
rescue Kleister::ApiError => e
puts "Error when calling AuthApi->external_providers_with_http_info: #{e}"
end
```

### Parameters

This endpoint does not need any parameter.

### Return type

[**Providers**](Providers.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## login_auth

> <AuthToken> login_auth(auth_login)
Expand Down
24 changes: 24 additions & 0 deletions docs/Provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Kleister::Provider

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **name** | **String** | | [optional][readonly] |
| **driver** | **String** | | [optional][readonly] |
| **display** | **String** | | [optional][readonly] |
| **icon** | **String** | | [optional][readonly] |

## Example

```ruby
require 'kleister'

instance = Kleister::Provider.new(
name: null,
driver: null,
display: null,
icon: null
)
```

20 changes: 20 additions & 0 deletions docs/Providers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kleister::Providers

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **total** | **Integer** | | [optional] |
| **listing** | [**Array&lt;Provider&gt;**](Provider.md) | | [optional] |

## Example

```ruby
require 'kleister'

instance = Kleister::Providers.new(
total: null,
listing: null
)
```

2 changes: 2 additions & 0 deletions lib/kleister.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
require 'kleister/models/pack_users'
require 'kleister/models/packs'
require 'kleister/models/profile'
require 'kleister/models/provider'
require 'kleister/models/providers'
require 'kleister/models/quilt'
require 'kleister/models/quilt_build_params'
require 'kleister/models/quilt_builds'
Expand Down
55 changes: 55 additions & 0 deletions lib/kleister/api/auth_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,61 @@ def external_initialize_with_http_info(provider, opts = {})
[data, status_code, headers]
end

# Fetch the available auth providers
# @param [Hash] opts the optional parameters
# @return [Providers]
def external_providers(opts = {})
data, _status_code, _headers = external_providers_with_http_info(opts)
data
end

# Fetch the available auth providers
# @param [Hash] opts the optional parameters
# @return [Array<(Providers, Integer, Hash)>] Providers data, response status code and response headers
def external_providers_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AuthApi.external_providers ...'
end
# resource path
local_var_path = '/auth/providers'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'Providers'

# auth_names
auth_names = opts[:debug_auth_names] || []

new_options = opts.merge(
operation: :'AuthApi.external_providers',
header_params: header_params,
query_params: query_params,
form_params: form_params,
body: post_body,
auth_names: auth_names,
return_type: return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: AuthApi#external_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
[data, status_code, headers]
end

# Authenticate an user by credentials
# @param auth_login [AuthLogin] The credentials to authenticate
# @param [Hash] opts the optional parameters
Expand Down
Loading

0 comments on commit 0bcb784

Please sign in to comment.