mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[ruby] document the *_with_http_info methods (#8094)
This commit is contained in:
@@ -16,20 +16,37 @@ Use custom server
|
||||
|
||||
Use custom server
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'dynamic_servers'
|
||||
|
||||
api_instance = DynamicServers::UsageApi.new
|
||||
|
||||
begin
|
||||
#Use custom server
|
||||
# Use custom server
|
||||
result = api_instance.custom_server
|
||||
p result
|
||||
rescue DynamicServers::ApiError => e
|
||||
puts "Exception when calling UsageApi->custom_server: #{e}"
|
||||
puts "Error when calling UsageApi->custom_server: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the custom_server_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(Object, Integer, Hash)> custom_server_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Use custom server
|
||||
data, status_code, headers = api_instance.custom_server_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => Object
|
||||
rescue DynamicServers::ApiError => e
|
||||
puts "Error when calling UsageApi->custom_server_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
@@ -59,20 +76,37 @@ Use default server
|
||||
|
||||
Use default server
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
# load the gem
|
||||
require 'dynamic_servers'
|
||||
|
||||
api_instance = DynamicServers::UsageApi.new
|
||||
|
||||
begin
|
||||
#Use default server
|
||||
# Use default server
|
||||
result = api_instance.default_server
|
||||
p result
|
||||
rescue DynamicServers::ApiError => e
|
||||
puts "Exception when calling UsageApi->default_server: #{e}"
|
||||
puts "Error when calling UsageApi->default_server: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the default_server_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(Object, Integer, Hash)> default_server_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Use default server
|
||||
data, status_code, headers = api_instance.default_server_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => Object
|
||||
rescue DynamicServers::ApiError => e
|
||||
puts "Error when calling UsageApi->default_server_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user