mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[Ruby] add file download tests (#17362)
* add new ruby echo api clients * add tests for ruby faraday file download * add file download test to ruby Typhoeus * add ruby workflow, add tests for ruby httpx * update * fix
This commit is contained in:
parent
dd36fa09f8
commit
10da7a3c5a
43
.github/workflows/samples-ruby.yaml
vendored
Normal file
43
.github/workflows/samples-ruby.yaml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: Samples Ruby
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/client/echo_api/ruby-httpx/**'
|
||||
- 'samples/client/echo_api/ruby-faraday/**'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Ruby
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sample:
|
||||
- 'samples/client/echo_api/ruby-httpx/'
|
||||
- 'samples/client/echo_api/ruby-faraday/'
|
||||
- 'samples/client/echo_api/ruby-typhoeus/'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: actions/setup-node@v4
|
||||
- name: Run echo server
|
||||
run: |
|
||||
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server
|
||||
(cd http-echo-server && npm install && npm start &)
|
||||
- uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.0
|
||||
bundler-cache: true
|
||||
- name: Install bundle
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: bundle install
|
||||
- name: Run rspec
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: rspec
|
7
bin/configs/ruby-faraday-echo-api.yaml
Normal file
7
bin/configs/ruby-faraday-echo-api.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
generatorName: ruby
|
||||
outputDir: samples/client/echo_api/ruby-faraday
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ruby-client
|
||||
library: faraday
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
7
bin/configs/ruby-typhoeus-echo-api.yaml
Normal file
7
bin/configs/ruby-typhoeus-echo-api.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
generatorName: ruby
|
||||
outputDir: samples/client/echo_api/ruby-typhoeus
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/ruby-client
|
||||
library: typhoeus
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
@ -145,14 +145,16 @@
|
||||
chunk.force_encoding(encoding)
|
||||
tempfile.write(chunk)
|
||||
end
|
||||
request.on_complete do |response|
|
||||
if tempfile
|
||||
tempfile.close
|
||||
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
||||
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
||||
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
||||
"explicitly with `tempfile.delete`"
|
||||
end
|
||||
# run the request to ensure the tempfile is created successfully before returning it
|
||||
request.run
|
||||
if tempfile
|
||||
tempfile.close
|
||||
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
||||
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
||||
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
||||
"explicitly with `tempfile.delete`"
|
||||
else
|
||||
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
||||
end
|
||||
|
||||
tempfile
|
||||
|
39
samples/client/echo_api/ruby-faraday/.gitignore
vendored
Normal file
39
samples/client/echo_api/ruby-faraday/.gitignore
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# Generated by: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
*.gem
|
||||
*.rbc
|
||||
/.config
|
||||
/coverage/
|
||||
/InstalledFiles
|
||||
/pkg/
|
||||
/spec/reports/
|
||||
/spec/examples.txt
|
||||
/test/tmp/
|
||||
/test/version_tmp/
|
||||
/tmp/
|
||||
|
||||
## Specific to RubyMotion:
|
||||
.dat*
|
||||
.repl_history
|
||||
build/
|
||||
|
||||
## Documentation cache and generated files:
|
||||
/.yardoc/
|
||||
/_yardoc/
|
||||
/doc/
|
||||
/rdoc/
|
||||
|
||||
## Environment normalization:
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
# for a library or gem, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# Gemfile.lock
|
||||
# .ruby-version
|
||||
# .ruby-gemset
|
||||
|
||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||
.rvmrc
|
26
samples/client/echo_api/ruby-faraday/.gitlab-ci.yml
Normal file
26
samples/client/echo_api/ruby-faraday/.gitlab-ci.yml
Normal file
@ -0,0 +1,26 @@
|
||||
.ruby: &ruby
|
||||
variables:
|
||||
LANG: "C.UTF-8"
|
||||
before_script:
|
||||
- ruby -v
|
||||
- bundle config set --local deployment true
|
||||
- bundle install -j $(nproc)
|
||||
parallel:
|
||||
matrix:
|
||||
- RUBY_VERSION: ['2.7', '3.0', '3.1']
|
||||
image: "ruby:$RUBY_VERSION"
|
||||
cache:
|
||||
paths:
|
||||
- vendor/ruby
|
||||
key: 'ruby-$RUBY_VERSION'
|
||||
|
||||
gem:
|
||||
extends: .ruby
|
||||
script:
|
||||
- bundle exec rspec
|
||||
- bundle exec rake build
|
||||
- bundle exec rake install
|
||||
artifacts:
|
||||
paths:
|
||||
- pkg/*.gem
|
||||
|
@ -0,0 +1,25 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
spec/api_client_spec.rb
|
||||
spec/configuration_spec.rb
|
@ -0,0 +1,50 @@
|
||||
.gitignore
|
||||
.gitlab-ci.yml
|
||||
.rspec
|
||||
.rubocop.yml
|
||||
.travis.yml
|
||||
Gemfile
|
||||
README.md
|
||||
Rakefile
|
||||
docs/AuthApi.md
|
||||
docs/Bird.md
|
||||
docs/BodyApi.md
|
||||
docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DefaultValue.md
|
||||
docs/FormApi.md
|
||||
docs/HeaderApi.md
|
||||
docs/NumberPropertiesOnly.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
docs/QueryApi.md
|
||||
docs/StringEnumRef.md
|
||||
docs/Tag.md
|
||||
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
|
||||
git_push.sh
|
||||
lib/openapi_client.rb
|
||||
lib/openapi_client/api/auth_api.rb
|
||||
lib/openapi_client/api/body_api.rb
|
||||
lib/openapi_client/api/form_api.rb
|
||||
lib/openapi_client/api/header_api.rb
|
||||
lib/openapi_client/api/path_api.rb
|
||||
lib/openapi_client/api/query_api.rb
|
||||
lib/openapi_client/api_client.rb
|
||||
lib/openapi_client/api_error.rb
|
||||
lib/openapi_client/configuration.rb
|
||||
lib/openapi_client/models/bird.rb
|
||||
lib/openapi_client/models/category.rb
|
||||
lib/openapi_client/models/data_query.rb
|
||||
lib/openapi_client/models/default_value.rb
|
||||
lib/openapi_client/models/number_properties_only.rb
|
||||
lib/openapi_client/models/pet.rb
|
||||
lib/openapi_client/models/query.rb
|
||||
lib/openapi_client/models/string_enum_ref.rb
|
||||
lib/openapi_client/models/tag.rb
|
||||
lib/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.rb
|
||||
lib/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.rb
|
||||
lib/openapi_client/version.rb
|
||||
openapi_client.gemspec
|
||||
spec/spec_helper.rb
|
@ -0,0 +1 @@
|
||||
7.2.0-SNAPSHOT
|
2
samples/client/echo_api/ruby-faraday/.rspec
Normal file
2
samples/client/echo_api/ruby-faraday/.rspec
Normal file
@ -0,0 +1,2 @@
|
||||
--color
|
||||
--require spec_helper
|
148
samples/client/echo_api/ruby-faraday/.rubocop.yml
Normal file
148
samples/client/echo_api/ruby-faraday/.rubocop.yml
Normal file
@ -0,0 +1,148 @@
|
||||
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
||||
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||
DisabledByDefault: true
|
||||
Exclude:
|
||||
- '**/templates/**/*'
|
||||
- '**/vendor/**/*'
|
||||
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||
|
||||
# Prefer &&/|| over and/or.
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
# Align `when` with `case`.
|
||||
Layout/CaseIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Align comments with method definitions.
|
||||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ElseAlignment:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLineAfterMagicComment:
|
||||
Enabled: true
|
||||
|
||||
# In a regular class definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundClassBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular method definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular module definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
|
||||
Layout/FirstArgumentIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||
Style/HashSyntax:
|
||||
Enabled: false
|
||||
|
||||
# Method definitions after `private` or `protected` isolated calls need one
|
||||
# extra level of indentation.
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: true
|
||||
EnforcedStyle: indented_internal_methods
|
||||
|
||||
# Two spaces, no tabs (for indentation).
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
Layout/LeadingCommentSpace:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundEqualsInParameterDefault:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundKeyword:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeFirstArg:
|
||||
Enabled: true
|
||||
|
||||
Style/DefWithParentheses:
|
||||
Enabled: true
|
||||
|
||||
# Defining a method with parameters needs parentheses.
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
EnforcedStyle: always
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo { bar }` not `foo {bar}`.
|
||||
Layout/SpaceInsideBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `{ a: 1 }` not `{a:1}`.
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceInsideParens:
|
||||
Enabled: true
|
||||
|
||||
# Check quotes usage according to lint rule below.
|
||||
#Style/StringLiterals:
|
||||
# Enabled: true
|
||||
# EnforcedStyle: single_quotes
|
||||
|
||||
# Detect hard tabs, no hard tabs.
|
||||
Layout/IndentationStyle:
|
||||
Enabled: true
|
||||
|
||||
# Blank lines should not have any spaces.
|
||||
Layout/TrailingEmptyLines:
|
||||
Enabled: true
|
||||
|
||||
# No trailing whitespace.
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: false
|
||||
|
||||
# Use quotes for string literals when they are enough.
|
||||
Style/RedundantPercentQ:
|
||||
Enabled: true
|
||||
|
||||
# Align `end` with the matching keyword or starting expression except for
|
||||
# assignments, where it should be aligned with the LHS.
|
||||
Layout/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
AutoCorrect: true
|
||||
|
||||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||
Lint/RequireParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMultipleReturnValues: true
|
||||
|
||||
Style/Semicolon:
|
||||
Enabled: true
|
||||
AllowAsExpressionSeparator: true
|
11
samples/client/echo_api/ruby-faraday/.travis.yml
Normal file
11
samples/client/echo_api/ruby-faraday/.travis.yml
Normal file
@ -0,0 +1,11 @@
|
||||
language: ruby
|
||||
cache: bundler
|
||||
rvm:
|
||||
- 2.7
|
||||
- 3.0
|
||||
- 3.1
|
||||
script:
|
||||
- bundle install --path vendor/bundle
|
||||
- bundle exec rspec
|
||||
- gem build openapi_client.gemspec
|
||||
- gem install ./openapi_client-1.0.0.gem
|
9
samples/client/echo_api/ruby-faraday/Gemfile
Normal file
9
samples/client/echo_api/ruby-faraday/Gemfile
Normal file
@ -0,0 +1,9 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gemspec
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake', '~> 13.0.1'
|
||||
gem 'pry-byebug'
|
||||
gem 'rubocop', '~> 0.66.0'
|
||||
end
|
136
samples/client/echo_api/ruby-faraday/README.md
Normal file
136
samples/client/echo_api/ruby-faraday/README.md
Normal file
@ -0,0 +1,136 @@
|
||||
# openapi_client
|
||||
|
||||
OpenapiClient - the Ruby gem for the Echo Server API
|
||||
|
||||
Echo Server API
|
||||
|
||||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 0.1.0
|
||||
- Package version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
### Build a gem
|
||||
|
||||
To build the Ruby code into a gem:
|
||||
|
||||
```shell
|
||||
gem build openapi_client.gemspec
|
||||
```
|
||||
|
||||
Then either install the gem locally:
|
||||
|
||||
```shell
|
||||
gem install ./openapi_client-1.0.0.gem
|
||||
```
|
||||
|
||||
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
|
||||
|
||||
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
||||
|
||||
Finally add this to the Gemfile:
|
||||
|
||||
gem 'openapi_client', '~> 1.0.0'
|
||||
|
||||
### Install from Git
|
||||
|
||||
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
||||
|
||||
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
||||
|
||||
### Include the Ruby code directly
|
||||
|
||||
Include the Ruby code directly using `-I` as follows:
|
||||
|
||||
```shell
|
||||
ruby -Ilib script.rb
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) procedure and then run the following code:
|
||||
|
||||
```ruby
|
||||
# Load the gem
|
||||
require 'openapi_client'
|
||||
|
||||
# Setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure HTTP basic authorization: http_auth
|
||||
config.username = 'YOUR_USERNAME'
|
||||
config.password = 'YOUR_PASSWORD'
|
||||
# Configure faraday connection
|
||||
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
#To test HTTP basic authentication
|
||||
result = api_instance.test_auth_http_basic
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Exception when calling AuthApi->test_auth_http_basic: #{e}"
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*OpenapiClient::AuthApi* | [**test_auth_http_basic**](docs/AuthApi.md#test_auth_http_basic) | **POST** /auth/http/basic | To test HTTP basic authentication
|
||||
*OpenapiClient::AuthApi* | [**test_auth_http_bearer**](docs/AuthApi.md#test_auth_http_bearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication
|
||||
*OpenapiClient::BodyApi* | [**test_binary_gif**](docs/BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*OpenapiClient::BodyApi* | [**test_body_application_octetstream_binary**](docs/BodyApi.md#test_body_application_octetstream_binary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_body_multipart_formdata_array_of_binary**](docs/BodyApi.md#test_body_multipart_formdata_array_of_binary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_all_of_pet**](docs/BodyApi.md#test_echo_body_all_of_pet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_free_form_object_response_string**](docs/BodyApi.md#test_echo_body_free_form_object_response_string) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_pet**](docs/BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_pet_response_string**](docs/BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_tag_response_string**](docs/BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
|
||||
*OpenapiClient::FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
|
||||
*OpenapiClient::FormApi* | [**test_form_oneof**](docs/FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
|
||||
*OpenapiClient::HeaderApi* | [**test_header_integer_boolean_string_enums**](docs/HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
|
||||
*OpenapiClient::PathApi* | [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](docs/PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_enum_ref_string**](docs/QueryApi.md#test_enum_ref_string) | **GET** /query/enum_ref_string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_datetime_date_string**](docs/QueryApi.md#test_query_datetime_date_string) | **GET** /query/datetime/date/string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_integer_boolean_string**](docs/QueryApi.md#test_query_integer_boolean_string) | **GET** /query/integer/boolean/string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_deep_object_explode_true_object**](docs/QueryApi.md#test_query_style_deep_object_explode_true_object) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_deep_object_explode_true_object_all_of**](docs/QueryApi.md#test_query_style_deep_object_explode_true_object_all_of) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_array_string**](docs/QueryApi.md#test_query_style_form_explode_true_array_string) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object**](docs/QueryApi.md#test_query_style_form_explode_true_object) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object_all_of**](docs/QueryApi.md#test_query_style_form_explode_true_object_all_of) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [OpenapiClient::Bird](docs/Bird.md)
|
||||
- [OpenapiClient::Category](docs/Category.md)
|
||||
- [OpenapiClient::DataQuery](docs/DataQuery.md)
|
||||
- [OpenapiClient::DefaultValue](docs/DefaultValue.md)
|
||||
- [OpenapiClient::NumberPropertiesOnly](docs/NumberPropertiesOnly.md)
|
||||
- [OpenapiClient::Pet](docs/Pet.md)
|
||||
- [OpenapiClient::Query](docs/Query.md)
|
||||
- [OpenapiClient::StringEnumRef](docs/StringEnumRef.md)
|
||||
- [OpenapiClient::Tag](docs/Tag.md)
|
||||
- [OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### http_auth
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### http_bearer_auth
|
||||
|
||||
- **Type**: Bearer authentication
|
||||
|
10
samples/client/echo_api/ruby-faraday/Rakefile
Normal file
10
samples/client/echo_api/ruby-faraday/Rakefile
Normal file
@ -0,0 +1,10 @@
|
||||
require "bundler/gem_tasks"
|
||||
|
||||
begin
|
||||
require 'rspec/core/rake_task'
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
task default: :spec
|
||||
rescue LoadError
|
||||
# no rspec available
|
||||
end
|
142
samples/client/echo_api/ruby-faraday/docs/AuthApi.md
Normal file
142
samples/client/echo_api/ruby-faraday/docs/AuthApi.md
Normal file
@ -0,0 +1,142 @@
|
||||
# OpenapiClient::AuthApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_auth_http_basic**](AuthApi.md#test_auth_http_basic) | **POST** /auth/http/basic | To test HTTP basic authentication |
|
||||
| [**test_auth_http_bearer**](AuthApi.md#test_auth_http_bearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication |
|
||||
|
||||
|
||||
## test_auth_http_basic
|
||||
|
||||
> String test_auth_http_basic
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
# setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure HTTP basic authorization: http_auth
|
||||
config.username = 'YOUR USERNAME'
|
||||
config.password = 'YOUR PASSWORD'
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
# To test HTTP basic authentication
|
||||
result = api_instance.test_auth_http_basic
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_basic: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_auth_http_basic_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_auth_http_basic_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# To test HTTP basic authentication
|
||||
data, status_code, headers = api_instance.test_auth_http_basic_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_basic_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_auth](../README.md#http_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_auth_http_bearer
|
||||
|
||||
> String test_auth_http_bearer
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
# setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure Bearer authorization: http_bearer_auth
|
||||
config.access_token = 'YOUR_BEARER_TOKEN'
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
# To test HTTP bearer authentication
|
||||
result = api_instance.test_auth_http_bearer
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_bearer: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_auth_http_bearer_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_auth_http_bearer_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# To test HTTP bearer authentication
|
||||
data, status_code, headers = api_instance.test_auth_http_bearer_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_bearer_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_bearer_auth](../README.md#http_bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
20
samples/client/echo_api/ruby-faraday/docs/Bird.md
Normal file
20
samples/client/echo_api/ruby-faraday/docs/Bird.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Bird
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **size** | **String** | | [optional] |
|
||||
| **color** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Bird.new(
|
||||
size: null,
|
||||
color: null
|
||||
)
|
||||
```
|
||||
|
536
samples/client/echo_api/ruby-faraday/docs/BodyApi.md
Normal file
536
samples/client/echo_api/ruby-faraday/docs/BodyApi.md
Normal file
@ -0,0 +1,536 @@
|
||||
# OpenapiClient::BodyApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_binary_gif**](BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**test_body_application_octetstream_binary**](BodyApi.md#test_body_application_octetstream_binary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**test_body_multipart_formdata_array_of_binary**](BodyApi.md#test_body_multipart_formdata_array_of_binary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
|
||||
| [**test_echo_body_all_of_pet**](BodyApi.md#test_echo_body_all_of_pet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) |
|
||||
| [**test_echo_body_free_form_object_response_string**](BodyApi.md#test_echo_body_free_form_object_response_string) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**test_echo_body_pet**](BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**test_echo_body_pet_response_string**](BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
| [**test_echo_body_tag_response_string**](BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
|
||||
|
||||
|
||||
## test_binary_gif
|
||||
|
||||
> File test_binary_gif
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
|
||||
begin
|
||||
# Test binary (gif) response body
|
||||
result = api_instance.test_binary_gif
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_binary_gif: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_binary_gif_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(File, Integer, Hash)> test_binary_gif_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test binary (gif) response body
|
||||
data, status_code, headers = api_instance.test_binary_gif_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => File
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_binary_gif_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**File**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: image/gif
|
||||
|
||||
|
||||
## test_body_application_octetstream_binary
|
||||
|
||||
> String test_body_application_octetstream_binary(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
body: File.new('/path/to/some/file') # File |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_body_application_octetstream_binary(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_application_octetstream_binary: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_body_application_octetstream_binary_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_body_application_octetstream_binary_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_body_application_octetstream_binary_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_application_octetstream_binary_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **body** | **File** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_body_multipart_formdata_array_of_binary
|
||||
|
||||
> String test_body_multipart_formdata_array_of_binary(files)
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
files = [File.new('/path/to/some/file')] # Array<File> |
|
||||
|
||||
begin
|
||||
# Test array of binary in multipart mime
|
||||
result = api_instance.test_body_multipart_formdata_array_of_binary(files)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_multipart_formdata_array_of_binary: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_body_multipart_formdata_array_of_binary_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_body_multipart_formdata_array_of_binary_with_http_info(files)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test array of binary in multipart mime
|
||||
data, status_code, headers = api_instance.test_body_multipart_formdata_array_of_binary_with_http_info(files)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_multipart_formdata_array_of_binary_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **files** | **Array<File>** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_all_of_pet
|
||||
|
||||
> <Pet> test_echo_body_all_of_pet(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_echo_body_all_of_pet(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_all_of_pet: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_all_of_pet_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(<Pet>, Integer, Hash)> test_echo_body_all_of_pet_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_echo_body_all_of_pet_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => <Pet>
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_all_of_pet_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## test_echo_body_free_form_object_response_string
|
||||
|
||||
> String test_echo_body_free_form_object_response_string(opts)
|
||||
|
||||
Test free form object
|
||||
|
||||
Test free form object
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
body: { ... } # Object | Free form object
|
||||
}
|
||||
|
||||
begin
|
||||
# Test free form object
|
||||
result = api_instance.test_echo_body_free_form_object_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_free_form_object_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_free_form_object_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_free_form_object_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test free form object
|
||||
data, status_code, headers = api_instance.test_echo_body_free_form_object_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_free_form_object_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **body** | **Object** | Free form object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_pet
|
||||
|
||||
> <Pet> test_echo_body_pet(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_echo_body_pet(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_pet_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(<Pet>, Integer, Hash)> test_echo_body_pet_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_echo_body_pet_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => <Pet>
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## test_echo_body_pet_response_string
|
||||
|
||||
> String test_echo_body_pet_response_string(opts)
|
||||
|
||||
Test empty response body
|
||||
|
||||
Test empty response body
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test empty response body
|
||||
result = api_instance.test_echo_body_pet_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_pet_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_pet_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test empty response body
|
||||
data, status_code, headers = api_instance.test_echo_body_pet_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_tag_response_string
|
||||
|
||||
> String test_echo_body_tag_response_string(opts)
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
tag: OpenapiClient::Tag.new # Tag | Tag object
|
||||
}
|
||||
|
||||
begin
|
||||
# Test empty json (request body)
|
||||
result = api_instance.test_echo_body_tag_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_tag_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_tag_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_tag_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test empty json (request body)
|
||||
data, status_code, headers = api_instance.test_echo_body_tag_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_tag_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **tag** | [**Tag**](Tag.md) | Tag object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
20
samples/client/echo_api/ruby-faraday/docs/Category.md
Normal file
20
samples/client/echo_api/ruby-faraday/docs/Category.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Category
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Category.new(
|
||||
id: 1,
|
||||
name: Dogs
|
||||
)
|
||||
```
|
||||
|
22
samples/client/echo_api/ruby-faraday/docs/DataQuery.md
Normal file
22
samples/client/echo_api/ruby-faraday/docs/DataQuery.md
Normal file
@ -0,0 +1,22 @@
|
||||
# OpenapiClient::DataQuery
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **suffix** | **String** | test suffix | [optional] |
|
||||
| **text** | **String** | Some text containing white spaces | [optional] |
|
||||
| **date** | **Time** | A date | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::DataQuery.new(
|
||||
suffix: null,
|
||||
text: Some text,
|
||||
date: null
|
||||
)
|
||||
```
|
||||
|
32
samples/client/echo_api/ruby-faraday/docs/DefaultValue.md
Normal file
32
samples/client/echo_api/ruby-faraday/docs/DefaultValue.md
Normal file
@ -0,0 +1,32 @@
|
||||
# OpenapiClient::DefaultValue
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **array_string_enum_ref_default** | [**Array<StringEnumRef>**](StringEnumRef.md) | | [optional] |
|
||||
| **array_string_enum_default** | **Array<String>** | | [optional] |
|
||||
| **array_string_default** | **Array<String>** | | [optional] |
|
||||
| **array_integer_default** | **Array<Integer>** | | [optional] |
|
||||
| **array_string** | **Array<String>** | | [optional] |
|
||||
| **array_string_nullable** | **Array<String>** | | [optional] |
|
||||
| **array_string_extension_nullable** | **Array<String>** | | [optional] |
|
||||
| **string_nullable** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::DefaultValue.new(
|
||||
array_string_enum_ref_default: null,
|
||||
array_string_enum_default: null,
|
||||
array_string_default: null,
|
||||
array_integer_default: null,
|
||||
array_string: null,
|
||||
array_string_nullable: null,
|
||||
array_string_extension_nullable: null,
|
||||
string_nullable: null
|
||||
)
|
||||
```
|
||||
|
155
samples/client/echo_api/ruby-faraday/docs/FormApi.md
Normal file
155
samples/client/echo_api/ruby-faraday/docs/FormApi.md
Normal file
@ -0,0 +1,155 @@
|
||||
# OpenapiClient::FormApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_form_integer_boolean_string**](FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s) |
|
||||
| [**test_form_oneof**](FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
|
||||
|
||||
|
||||
## test_form_integer_boolean_string
|
||||
|
||||
> String test_form_integer_boolean_string(opts)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::FormApi.new
|
||||
opts = {
|
||||
integer_form: 56, # Integer |
|
||||
boolean_form: true, # Boolean |
|
||||
string_form: 'string_form_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test form parameter(s)
|
||||
result = api_instance.test_form_integer_boolean_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_integer_boolean_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_form_integer_boolean_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_form_integer_boolean_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test form parameter(s)
|
||||
data, status_code, headers = api_instance.test_form_integer_boolean_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_integer_boolean_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **integer_form** | **Integer** | | [optional] |
|
||||
| **boolean_form** | **Boolean** | | [optional] |
|
||||
| **string_form** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_form_oneof
|
||||
|
||||
> String test_form_oneof(opts)
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::FormApi.new
|
||||
opts = {
|
||||
form1: 'form1_example', # String |
|
||||
form2: 56, # Integer |
|
||||
form3: 'form3_example', # String |
|
||||
form4: true, # Boolean |
|
||||
id: 789, # Integer |
|
||||
name: 'name_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test form parameter(s) for oneOf schema
|
||||
result = api_instance.test_form_oneof(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_oneof: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_form_oneof_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_form_oneof_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test form parameter(s) for oneOf schema
|
||||
data, status_code, headers = api_instance.test_form_oneof_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_oneof_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **form1** | **String** | | [optional] |
|
||||
| **form2** | **Integer** | | [optional] |
|
||||
| **form3** | **String** | | [optional] |
|
||||
| **form4** | **Boolean** | | [optional] |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: text/plain
|
||||
|
82
samples/client/echo_api/ruby-faraday/docs/HeaderApi.md
Normal file
82
samples/client/echo_api/ruby-faraday/docs/HeaderApi.md
Normal file
@ -0,0 +1,82 @@
|
||||
# OpenapiClient::HeaderApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_header_integer_boolean_string_enums**](HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) |
|
||||
|
||||
|
||||
## test_header_integer_boolean_string_enums
|
||||
|
||||
> String test_header_integer_boolean_string_enums(opts)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::HeaderApi.new
|
||||
opts = {
|
||||
integer_header: 56, # Integer |
|
||||
boolean_header: true, # Boolean |
|
||||
string_header: 'string_header_example', # String |
|
||||
enum_nonref_string_header: 'success', # String |
|
||||
enum_ref_string_header: OpenapiClient::StringEnumRef::SUCCESS # StringEnumRef |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test header parameter(s)
|
||||
result = api_instance.test_header_integer_boolean_string_enums(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling HeaderApi->test_header_integer_boolean_string_enums: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_header_integer_boolean_string_enums_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_header_integer_boolean_string_enums_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test header parameter(s)
|
||||
data, status_code, headers = api_instance.test_header_integer_boolean_string_enums_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling HeaderApi->test_header_integer_boolean_string_enums_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **integer_header** | **Integer** | | [optional] |
|
||||
| **boolean_header** | **Boolean** | | [optional] |
|
||||
| **string_header** | **String** | | [optional] |
|
||||
| **enum_nonref_string_header** | **String** | | [optional] |
|
||||
| **enum_ref_string_header** | [**StringEnumRef**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
@ -0,0 +1,22 @@
|
||||
# OpenapiClient::NumberPropertiesOnly
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **number** | **Float** | | [optional] |
|
||||
| **float** | **Float** | | [optional] |
|
||||
| **double** | **Float** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::NumberPropertiesOnly.new(
|
||||
number: null,
|
||||
float: null,
|
||||
double: null
|
||||
)
|
||||
```
|
||||
|
78
samples/client/echo_api/ruby-faraday/docs/PathApi.md
Normal file
78
samples/client/echo_api/ruby-faraday/docs/PathApi.md
Normal file
@ -0,0 +1,78 @@
|
||||
# OpenapiClient::PathApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) |
|
||||
|
||||
|
||||
## tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path
|
||||
|
||||
> String tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
|
||||
Test path parameter(s)
|
||||
|
||||
Test path parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::PathApi.new
|
||||
path_string = 'path_string_example' # String |
|
||||
path_integer = 56 # Integer |
|
||||
enum_nonref_string_path = 'success' # String |
|
||||
enum_ref_string_path = OpenapiClient::StringEnumRef::SUCCESS # StringEnumRef |
|
||||
|
||||
begin
|
||||
# Test path parameter(s)
|
||||
result = api_instance.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling PathApi->tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test path parameter(s)
|
||||
data, status_code, headers = api_instance.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling PathApi->tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **path_string** | **String** | | |
|
||||
| **path_integer** | **Integer** | | |
|
||||
| **enum_nonref_string_path** | **String** | | |
|
||||
| **enum_ref_string_path** | [**StringEnumRef**](.md) | | |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
28
samples/client/echo_api/ruby-faraday/docs/Pet.md
Normal file
28
samples/client/echo_api/ruby-faraday/docs/Pet.md
Normal file
@ -0,0 +1,28 @@
|
||||
# OpenapiClient::Pet
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | |
|
||||
| **category** | [**Category**](Category.md) | | [optional] |
|
||||
| **photo_urls** | **Array<String>** | | |
|
||||
| **tags** | [**Array<Tag>**](Tag.md) | | [optional] |
|
||||
| **status** | **String** | pet status in the store | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Pet.new(
|
||||
id: 10,
|
||||
name: doggie,
|
||||
category: null,
|
||||
photo_urls: null,
|
||||
tags: null,
|
||||
status: null
|
||||
)
|
||||
```
|
||||
|
20
samples/client/echo_api/ruby-faraday/docs/Query.md
Normal file
20
samples/client/echo_api/ruby-faraday/docs/Query.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Query
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **id** | **Integer** | Query | [optional] |
|
||||
| **outcomes** | **Array<String>** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Query.new(
|
||||
id: null,
|
||||
outcomes: null
|
||||
)
|
||||
```
|
||||
|
553
samples/client/echo_api/ruby-faraday/docs/QueryApi.md
Normal file
553
samples/client/echo_api/ruby-faraday/docs/QueryApi.md
Normal file
@ -0,0 +1,553 @@
|
||||
# OpenapiClient::QueryApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_enum_ref_string**](QueryApi.md#test_enum_ref_string) | **GET** /query/enum_ref_string | Test query parameter(s) |
|
||||
| [**test_query_datetime_date_string**](QueryApi.md#test_query_datetime_date_string) | **GET** /query/datetime/date/string | Test query parameter(s) |
|
||||
| [**test_query_integer_boolean_string**](QueryApi.md#test_query_integer_boolean_string) | **GET** /query/integer/boolean/string | Test query parameter(s) |
|
||||
| [**test_query_style_deep_object_explode_true_object**](QueryApi.md#test_query_style_deep_object_explode_true_object) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
|
||||
| [**test_query_style_deep_object_explode_true_object_all_of**](QueryApi.md#test_query_style_deep_object_explode_true_object_all_of) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
|
||||
| [**test_query_style_form_explode_true_array_string**](QueryApi.md#test_query_style_form_explode_true_array_string) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
|
||||
| [**test_query_style_form_explode_true_object**](QueryApi.md#test_query_style_form_explode_true_object) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**test_query_style_form_explode_true_object_all_of**](QueryApi.md#test_query_style_form_explode_true_object_all_of) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
|
||||
|
||||
## test_enum_ref_string
|
||||
|
||||
> String test_enum_ref_string(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
enum_nonref_string_query: 'success', # String |
|
||||
enum_ref_string_query: OpenapiClient::StringEnumRef::SUCCESS # StringEnumRef |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_enum_ref_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_enum_ref_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_enum_ref_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_enum_ref_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_enum_ref_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_enum_ref_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **enum_nonref_string_query** | **String** | | [optional] |
|
||||
| **enum_ref_string_query** | [**StringEnumRef**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_datetime_date_string
|
||||
|
||||
> String test_query_datetime_date_string(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
datetime_query: Time.parse('2013-10-20T19:20:30+01:00'), # Time |
|
||||
date_query: Date.parse('2013-10-20'), # Date |
|
||||
string_query: 'string_query_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_datetime_date_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_datetime_date_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_datetime_date_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_datetime_date_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_datetime_date_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_datetime_date_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **datetime_query** | **Time** | | [optional] |
|
||||
| **date_query** | **Date** | | [optional] |
|
||||
| **string_query** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_integer_boolean_string
|
||||
|
||||
> String test_query_integer_boolean_string(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
integer_query: 56, # Integer |
|
||||
boolean_query: true, # Boolean |
|
||||
string_query: 'string_query_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_integer_boolean_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_integer_boolean_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_integer_boolean_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_integer_boolean_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_integer_boolean_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_integer_boolean_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **integer_query** | **Integer** | | [optional] |
|
||||
| **boolean_query** | **Boolean** | | [optional] |
|
||||
| **string_query** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_style_deep_object_explode_true_object
|
||||
|
||||
> String test_query_style_deep_object_explode_true_object(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
query_object: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_style_deep_object_explode_true_object(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_deep_object_explode_true_object: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_style_deep_object_explode_true_object_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_style_deep_object_explode_true_object_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_style_deep_object_explode_true_object_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_deep_object_explode_true_object_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **query_object** | [**Pet**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_style_deep_object_explode_true_object_all_of
|
||||
|
||||
> String test_query_style_deep_object_explode_true_object_all_of(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
query_object: OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.new # TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_style_deep_object_explode_true_object_all_of(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_deep_object_explode_true_object_all_of: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_style_deep_object_explode_true_object_all_of_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_style_deep_object_explode_true_object_all_of_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_style_deep_object_explode_true_object_all_of_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_deep_object_explode_true_object_all_of_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **query_object** | [**TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_style_form_explode_true_array_string
|
||||
|
||||
> String test_query_style_form_explode_true_array_string(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
query_object: OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.new # TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_style_form_explode_true_array_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_array_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_style_form_explode_true_array_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_style_form_explode_true_array_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_style_form_explode_true_array_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_array_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **query_object** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_style_form_explode_true_object
|
||||
|
||||
> String test_query_style_form_explode_true_object(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
query_object: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_style_form_explode_true_object(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_object: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_style_form_explode_true_object_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_style_form_explode_true_object_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_style_form_explode_true_object_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_object_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **query_object** | [**Pet**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_query_style_form_explode_true_object_all_of
|
||||
|
||||
> String test_query_style_form_explode_true_object_all_of(opts)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::QueryApi.new
|
||||
opts = {
|
||||
query_object: OpenapiClient::DataQuery.new # DataQuery |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
result = api_instance.test_query_style_form_explode_true_object_all_of(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_object_all_of: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_query_style_form_explode_true_object_all_of_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_query_style_form_explode_true_object_all_of_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test query parameter(s)
|
||||
data, status_code, headers = api_instance.test_query_style_form_explode_true_object_all_of_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling QueryApi->test_query_style_form_explode_true_object_all_of_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **query_object** | [**DataQuery**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
15
samples/client/echo_api/ruby-faraday/docs/StringEnumRef.md
Normal file
15
samples/client/echo_api/ruby-faraday/docs/StringEnumRef.md
Normal file
@ -0,0 +1,15 @@
|
||||
# OpenapiClient::StringEnumRef
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::StringEnumRef.new()
|
||||
```
|
||||
|
20
samples/client/echo_api/ruby-faraday/docs/Tag.md
Normal file
20
samples/client/echo_api/ruby-faraday/docs/Tag.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Tag
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Tag.new(
|
||||
id: null,
|
||||
name: null
|
||||
)
|
||||
```
|
||||
|
@ -0,0 +1,24 @@
|
||||
# OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **size** | **String** | | [optional] |
|
||||
| **color** | **String** | | [optional] |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.new(
|
||||
size: null,
|
||||
color: null,
|
||||
id: 1,
|
||||
name: Dogs
|
||||
)
|
||||
```
|
||||
|
@ -0,0 +1,18 @@
|
||||
# OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **values** | **Array<String>** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.new(
|
||||
values: null
|
||||
)
|
||||
```
|
||||
|
57
samples/client/echo_api/ruby-faraday/git_push.sh
Normal file
57
samples/client/echo_api/ruby-faraday/git_push.sh
Normal file
@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
git_host=$4
|
||||
|
||||
if [ "$git_host" = "" ]; then
|
||||
git_host="github.com"
|
||||
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||
fi
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="GIT_USER_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=$(git remote)
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
56
samples/client/echo_api/ruby-faraday/lib/openapi_client.rb
Normal file
56
samples/client/echo_api/ruby-faraday/lib/openapi_client.rb
Normal file
@ -0,0 +1,56 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
# Common files
|
||||
require 'openapi_client/api_client'
|
||||
require 'openapi_client/api_error'
|
||||
require 'openapi_client/version'
|
||||
require 'openapi_client/configuration'
|
||||
|
||||
# Models
|
||||
require 'openapi_client/models/bird'
|
||||
require 'openapi_client/models/category'
|
||||
require 'openapi_client/models/default_value'
|
||||
require 'openapi_client/models/number_properties_only'
|
||||
require 'openapi_client/models/pet'
|
||||
require 'openapi_client/models/query'
|
||||
require 'openapi_client/models/string_enum_ref'
|
||||
require 'openapi_client/models/tag'
|
||||
require 'openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter'
|
||||
require 'openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter'
|
||||
require 'openapi_client/models/data_query'
|
||||
|
||||
# APIs
|
||||
require 'openapi_client/api/auth_api'
|
||||
require 'openapi_client/api/body_api'
|
||||
require 'openapi_client/api/form_api'
|
||||
require 'openapi_client/api/header_api'
|
||||
require 'openapi_client/api/path_api'
|
||||
require 'openapi_client/api/query_api'
|
||||
|
||||
module OpenapiClient
|
||||
class << self
|
||||
# Customize default settings for the SDK using block.
|
||||
# OpenapiClient.configure do |config|
|
||||
# config.username = "xxx"
|
||||
# config.password = "xxx"
|
||||
# end
|
||||
# If no block given, return the default Configuration object.
|
||||
def configure
|
||||
if block_given?
|
||||
yield(Configuration.default)
|
||||
else
|
||||
Configuration.default
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,136 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class AuthApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# To test HTTP basic authentication
|
||||
# To test HTTP basic authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
def test_auth_http_basic(opts = {})
|
||||
data, _status_code, _headers = test_auth_http_basic_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# To test HTTP basic authentication
|
||||
# To test HTTP basic authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_auth_http_basic_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: AuthApi.test_auth_http_basic ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/auth/http/basic'
|
||||
|
||||
# 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(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || ['http_auth']
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"AuthApi.test_auth_http_basic",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: AuthApi#test_auth_http_basic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# To test HTTP bearer authentication
|
||||
# To test HTTP bearer authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
def test_auth_http_bearer(opts = {})
|
||||
data, _status_code, _headers = test_auth_http_bearer_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# To test HTTP bearer authentication
|
||||
# To test HTTP bearer authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_auth_http_bearer_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: AuthApi.test_auth_http_bearer ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/auth/http/bearer'
|
||||
|
||||
# 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(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || ['http_bearer_auth']
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"AuthApi.test_auth_http_bearer",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: AuthApi#test_auth_http_bearer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,532 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class BodyApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# Test binary (gif) response body
|
||||
# Test binary (gif) response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [File]
|
||||
def test_binary_gif(opts = {})
|
||||
data, _status_code, _headers = test_binary_gif_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test binary (gif) response body
|
||||
# Test binary (gif) response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
||||
def test_binary_gif_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_binary_gif ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/binary/gif'
|
||||
|
||||
# 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(['image/gif'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'File'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_binary_gif",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_binary_gif\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [File] :body
|
||||
# @return [String]
|
||||
def test_body_application_octetstream_binary(opts = {})
|
||||
data, _status_code, _headers = test_body_application_octetstream_binary_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [File] :body
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_body_application_octetstream_binary_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_body_application_octetstream_binary ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/body/application/octetstream/binary'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/octet-stream'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_body_application_octetstream_binary",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_body_application_octetstream_binary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test array of binary in multipart mime
|
||||
# Test array of binary in multipart mime
|
||||
# @param files [Array<File>]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
def test_body_multipart_formdata_array_of_binary(files, opts = {})
|
||||
data, _status_code, _headers = test_body_multipart_formdata_array_of_binary_with_http_info(files, opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test array of binary in multipart mime
|
||||
# Test array of binary in multipart mime
|
||||
# @param files [Array<File>]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_body_multipart_formdata_array_of_binary_with_http_info(files, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_body_multipart_formdata_array_of_binary ...'
|
||||
end
|
||||
# verify the required parameter 'files' is set
|
||||
if @api_client.config.client_side_validation && files.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'files' when calling BodyApi.test_body_multipart_formdata_array_of_binary"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/body/application/octetstream/array_of_binary'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
form_params['files'] = @api_client.build_collection_param(files, :csv)
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_body_multipart_formdata_array_of_binary",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_body_multipart_formdata_array_of_binary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Pet]
|
||||
def test_echo_body_all_of_pet(opts = {})
|
||||
data, _status_code, _headers = test_echo_body_all_of_pet_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers
|
||||
def test_echo_body_all_of_pet_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_all_of_pet ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/echo/body/allOf/Pet'
|
||||
|
||||
# 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'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/json'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'pet'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'Pet'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_echo_body_all_of_pet",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_all_of_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test free form object
|
||||
# Test free form object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Object] :body Free form object
|
||||
# @return [String]
|
||||
def test_echo_body_free_form_object_response_string(opts = {})
|
||||
data, _status_code, _headers = test_echo_body_free_form_object_response_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test free form object
|
||||
# Test free form object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Object] :body Free form object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_echo_body_free_form_object_response_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_free_form_object_response_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/echo/body/FreeFormObject/response_string'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/json'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_echo_body_free_form_object_response_string",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_free_form_object_response_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Pet]
|
||||
def test_echo_body_pet(opts = {})
|
||||
data, _status_code, _headers = test_echo_body_pet_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers
|
||||
def test_echo_body_pet_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_pet ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/echo/body/Pet'
|
||||
|
||||
# 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'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/json'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'pet'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'Pet'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_echo_body_pet",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test empty response body
|
||||
# Test empty response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [String]
|
||||
def test_echo_body_pet_response_string(opts = {})
|
||||
data, _status_code, _headers = test_echo_body_pet_response_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test empty response body
|
||||
# Test empty response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_echo_body_pet_response_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_pet_response_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/echo/body/Pet/response_string'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/json'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'pet'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_echo_body_pet_response_string",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_pet_response_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test empty json (request body)
|
||||
# Test empty json (request body)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Tag] :tag Tag object
|
||||
# @return [String]
|
||||
def test_echo_body_tag_response_string(opts = {})
|
||||
data, _status_code, _headers = test_echo_body_tag_response_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test empty json (request body)
|
||||
# Test empty json (request body)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Tag] :tag Tag object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_echo_body_tag_response_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: BodyApi.test_echo_body_tag_response_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/echo/body/Tag/response_string'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/json'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'tag'])
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"BodyApi.test_echo_body_tag_response_string",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: BodyApi#test_echo_body_tag_response_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,173 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class FormApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# Test form parameter(s)
|
||||
# Test form parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_form
|
||||
# @option opts [Boolean] :boolean_form
|
||||
# @option opts [String] :string_form
|
||||
# @return [String]
|
||||
def test_form_integer_boolean_string(opts = {})
|
||||
data, _status_code, _headers = test_form_integer_boolean_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test form parameter(s)
|
||||
# Test form parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_form
|
||||
# @option opts [Boolean] :boolean_form
|
||||
# @option opts [String] :string_form
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_form_integer_boolean_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: FormApi.test_form_integer_boolean_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/form/integer/boolean/string'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
form_params['integer_form'] = opts[:'integer_form'] if !opts[:'integer_form'].nil?
|
||||
form_params['boolean_form'] = opts[:'boolean_form'] if !opts[:'boolean_form'].nil?
|
||||
form_params['string_form'] = opts[:'string_form'] if !opts[:'string_form'].nil?
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"FormApi.test_form_integer_boolean_string",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: FormApi#test_form_integer_boolean_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :form1
|
||||
# @option opts [Integer] :form2
|
||||
# @option opts [String] :form3
|
||||
# @option opts [Boolean] :form4
|
||||
# @option opts [Integer] :id
|
||||
# @option opts [String] :name
|
||||
# @return [String]
|
||||
def test_form_oneof(opts = {})
|
||||
data, _status_code, _headers = test_form_oneof_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :form1
|
||||
# @option opts [Integer] :form2
|
||||
# @option opts [String] :form3
|
||||
# @option opts [Boolean] :form4
|
||||
# @option opts [Integer] :id
|
||||
# @option opts [String] :name
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_form_oneof_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: FormApi.test_form_oneof ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/form/oneof'
|
||||
|
||||
# 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(['text/plain'])
|
||||
# HTTP header 'Content-Type'
|
||||
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
||||
if !content_type.nil?
|
||||
header_params['Content-Type'] = content_type
|
||||
end
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
form_params['form1'] = opts[:'form1'] if !opts[:'form1'].nil?
|
||||
form_params['form2'] = opts[:'form2'] if !opts[:'form2'].nil?
|
||||
form_params['form3'] = opts[:'form3'] if !opts[:'form3'].nil?
|
||||
form_params['form4'] = opts[:'form4'] if !opts[:'form4'].nil?
|
||||
form_params['id'] = opts[:'id'] if !opts[:'id'].nil?
|
||||
form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"FormApi.test_form_oneof",
|
||||
: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(:POST, local_var_path, new_options)
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug "API called: FormApi#test_form_oneof\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,98 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class HeaderApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# Test header parameter(s)
|
||||
# Test header parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_header
|
||||
# @option opts [Boolean] :boolean_header
|
||||
# @option opts [String] :string_header
|
||||
# @option opts [String] :enum_nonref_string_header
|
||||
# @option opts [StringEnumRef] :enum_ref_string_header
|
||||
# @return [String]
|
||||
def test_header_integer_boolean_string_enums(opts = {})
|
||||
data, _status_code, _headers = test_header_integer_boolean_string_enums_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test header parameter(s)
|
||||
# Test header parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_header
|
||||
# @option opts [Boolean] :boolean_header
|
||||
# @option opts [String] :string_header
|
||||
# @option opts [String] :enum_nonref_string_header
|
||||
# @option opts [StringEnumRef] :enum_ref_string_header
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_header_integer_boolean_string_enums_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: HeaderApi.test_header_integer_boolean_string_enums ...'
|
||||
end
|
||||
allowable_values = ["success", "failure", "unclassified"]
|
||||
if @api_client.config.client_side_validation && opts[:'enum_nonref_string_header'] && !allowable_values.include?(opts[:'enum_nonref_string_header'])
|
||||
fail ArgumentError, "invalid value for \"enum_nonref_string_header\", must be one of #{allowable_values}"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/header/integer/boolean/string/enums'
|
||||
|
||||
# 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(['text/plain'])
|
||||
header_params['integer_header'] = opts[:'integer_header'] if !opts[:'integer_header'].nil?
|
||||
header_params['boolean_header'] = opts[:'boolean_header'] if !opts[:'boolean_header'].nil?
|
||||
header_params['string_header'] = opts[:'string_header'] if !opts[:'string_header'].nil?
|
||||
header_params['enum_nonref_string_header'] = opts[:'enum_nonref_string_header'] if !opts[:'enum_nonref_string_header'].nil?
|
||||
header_params['enum_ref_string_header'] = opts[:'enum_ref_string_header'] if !opts[:'enum_ref_string_header'].nil?
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"HeaderApi.test_header_integer_boolean_string_enums",
|
||||
: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: HeaderApi#test_header_integer_boolean_string_enums\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,108 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class PathApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# Test path parameter(s)
|
||||
# Test path parameter(s)
|
||||
# @param path_string [String]
|
||||
# @param path_integer [Integer]
|
||||
# @param enum_nonref_string_path [String]
|
||||
# @param enum_ref_string_path [StringEnumRef]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, opts = {})
|
||||
data, _status_code, _headers = tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test path parameter(s)
|
||||
# Test path parameter(s)
|
||||
# @param path_string [String]
|
||||
# @param path_integer [Integer]
|
||||
# @param enum_nonref_string_path [String]
|
||||
# @param enum_ref_string_path [StringEnumRef]
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path_with_http_info(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path, opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path ...'
|
||||
end
|
||||
# verify the required parameter 'path_string' is set
|
||||
if @api_client.config.client_side_validation && path_string.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'path_string' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
|
||||
end
|
||||
# verify the required parameter 'path_integer' is set
|
||||
if @api_client.config.client_side_validation && path_integer.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'path_integer' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
|
||||
end
|
||||
# verify the required parameter 'enum_nonref_string_path' is set
|
||||
if @api_client.config.client_side_validation && enum_nonref_string_path.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'enum_nonref_string_path' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
|
||||
end
|
||||
# verify enum value
|
||||
allowable_values = ["success", "failure", "unclassified"]
|
||||
if @api_client.config.client_side_validation && !allowable_values.include?(enum_nonref_string_path)
|
||||
fail ArgumentError, "invalid value for \"enum_nonref_string_path\", must be one of #{allowable_values}"
|
||||
end
|
||||
# verify the required parameter 'enum_ref_string_path' is set
|
||||
if @api_client.config.client_side_validation && enum_ref_string_path.nil?
|
||||
fail ArgumentError, "Missing the required parameter 'enum_ref_string_path' when calling PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}'.sub('{' + 'path_string' + '}', CGI.escape(path_string.to_s)).sub('{' + 'path_integer' + '}', CGI.escape(path_integer.to_s)).sub('{' + 'enum_nonref_string_path' + '}', CGI.escape(enum_nonref_string_path.to_s)).sub('{' + 'enum_ref_string_path' + '}', CGI.escape(enum_ref_string_path.to_s))
|
||||
|
||||
# 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(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"PathApi.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path",
|
||||
: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: PathApi#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,521 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
module OpenapiClient
|
||||
class QueryApi
|
||||
attr_accessor :api_client
|
||||
|
||||
def initialize(api_client = ApiClient.default)
|
||||
@api_client = api_client
|
||||
end
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :enum_nonref_string_query
|
||||
# @option opts [StringEnumRef] :enum_ref_string_query
|
||||
# @return [String]
|
||||
def test_enum_ref_string(opts = {})
|
||||
data, _status_code, _headers = test_enum_ref_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :enum_nonref_string_query
|
||||
# @option opts [StringEnumRef] :enum_ref_string_query
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_enum_ref_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_enum_ref_string ...'
|
||||
end
|
||||
allowable_values = ["success", "failure", "unclassified"]
|
||||
if @api_client.config.client_side_validation && opts[:'enum_nonref_string_query'] && !allowable_values.include?(opts[:'enum_nonref_string_query'])
|
||||
fail ArgumentError, "invalid value for \"enum_nonref_string_query\", must be one of #{allowable_values}"
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/enum_ref_string'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'enum_nonref_string_query'] = opts[:'enum_nonref_string_query'] if !opts[:'enum_nonref_string_query'].nil?
|
||||
query_params[:'enum_ref_string_query'] = opts[:'enum_ref_string_query'] if !opts[:'enum_ref_string_query'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_enum_ref_string",
|
||||
: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: QueryApi#test_enum_ref_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Time] :datetime_query
|
||||
# @option opts [Date] :date_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [String]
|
||||
def test_query_datetime_date_string(opts = {})
|
||||
data, _status_code, _headers = test_query_datetime_date_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Time] :datetime_query
|
||||
# @option opts [Date] :date_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_datetime_date_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_datetime_date_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/datetime/date/string'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'datetime_query'] = opts[:'datetime_query'] if !opts[:'datetime_query'].nil?
|
||||
query_params[:'date_query'] = opts[:'date_query'] if !opts[:'date_query'].nil?
|
||||
query_params[:'string_query'] = opts[:'string_query'] if !opts[:'string_query'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_datetime_date_string",
|
||||
: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: QueryApi#test_query_datetime_date_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_query
|
||||
# @option opts [Boolean] :boolean_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [String]
|
||||
def test_query_integer_boolean_string(opts = {})
|
||||
data, _status_code, _headers = test_query_integer_boolean_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_query
|
||||
# @option opts [Boolean] :boolean_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_integer_boolean_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_integer_boolean_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/integer/boolean/string'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'integer_query'] = opts[:'integer_query'] if !opts[:'integer_query'].nil?
|
||||
query_params[:'boolean_query'] = opts[:'boolean_query'] if !opts[:'boolean_query'].nil?
|
||||
query_params[:'string_query'] = opts[:'string_query'] if !opts[:'string_query'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_integer_boolean_string",
|
||||
: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: QueryApi#test_query_integer_boolean_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [String]
|
||||
def test_query_style_deep_object_explode_true_object(opts = {})
|
||||
data, _status_code, _headers = test_query_style_deep_object_explode_true_object_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_style_deep_object_explode_true_object_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_deep_object_explode_true_object ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/style_deepObject/explode_true/object'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'query_object'] = opts[:'query_object'] if !opts[:'query_object'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_style_deep_object_explode_true_object",
|
||||
: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: QueryApi#test_query_style_deep_object_explode_true_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter] :query_object
|
||||
# @return [String]
|
||||
def test_query_style_deep_object_explode_true_object_all_of(opts = {})
|
||||
data, _status_code, _headers = test_query_style_deep_object_explode_true_object_all_of_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter] :query_object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_style_deep_object_explode_true_object_all_of_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_deep_object_explode_true_object_all_of ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/style_deepObject/explode_true/object/allOf'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'query_object'] = opts[:'query_object'] if !opts[:'query_object'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_style_deep_object_explode_true_object_all_of",
|
||||
: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: QueryApi#test_query_style_deep_object_explode_true_object_all_of\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter] :query_object
|
||||
# @return [String]
|
||||
def test_query_style_form_explode_true_array_string(opts = {})
|
||||
data, _status_code, _headers = test_query_style_form_explode_true_array_string_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter] :query_object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_style_form_explode_true_array_string_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_form_explode_true_array_string ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/style_form/explode_true/array_string'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'query_object'] = opts[:'query_object'] if !opts[:'query_object'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_style_form_explode_true_array_string",
|
||||
: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: QueryApi#test_query_style_form_explode_true_array_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [String]
|
||||
def test_query_style_form_explode_true_object(opts = {})
|
||||
data, _status_code, _headers = test_query_style_form_explode_true_object_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_style_form_explode_true_object_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_form_explode_true_object ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/style_form/explode_true/object'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'query_object'] = opts[:'query_object'] if !opts[:'query_object'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_style_form_explode_true_object",
|
||||
: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: QueryApi#test_query_style_form_explode_true_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [DataQuery] :query_object
|
||||
# @return [String]
|
||||
def test_query_style_form_explode_true_object_all_of(opts = {})
|
||||
data, _status_code, _headers = test_query_style_form_explode_true_object_all_of_with_http_info(opts)
|
||||
data
|
||||
end
|
||||
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [DataQuery] :query_object
|
||||
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
||||
def test_query_style_form_explode_true_object_all_of_with_http_info(opts = {})
|
||||
if @api_client.config.debugging
|
||||
@api_client.config.logger.debug 'Calling API: QueryApi.test_query_style_form_explode_true_object_all_of ...'
|
||||
end
|
||||
# resource path
|
||||
local_var_path = '/query/style_form/explode_true/object/allOf'
|
||||
|
||||
# query parameters
|
||||
query_params = opts[:query_params] || {}
|
||||
query_params[:'query_object'] = opts[:'query_object'] if !opts[:'query_object'].nil?
|
||||
|
||||
# header parameters
|
||||
header_params = opts[:header_params] || {}
|
||||
# HTTP header 'Accept' (if needed)
|
||||
header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
|
||||
|
||||
# form parameters
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
# http body (model)
|
||||
post_body = opts[:debug_body]
|
||||
|
||||
# return_type
|
||||
return_type = opts[:debug_return_type] || 'String'
|
||||
|
||||
# auth_names
|
||||
auth_names = opts[:debug_auth_names] || []
|
||||
|
||||
new_options = opts.merge(
|
||||
:operation => :"QueryApi.test_query_style_form_explode_true_object_all_of",
|
||||
: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: QueryApi#test_query_style_form_explode_true_object_all_of\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
||||
end
|
||||
return data, status_code, headers
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,431 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'json'
|
||||
require 'logger'
|
||||
require 'tempfile'
|
||||
require 'time'
|
||||
require 'faraday'
|
||||
require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
|
||||
|
||||
|
||||
module OpenapiClient
|
||||
class ApiClient
|
||||
# The Configuration object holding settings to be used in the API client.
|
||||
attr_accessor :config
|
||||
|
||||
# Defines the headers to be used in HTTP requests of all API calls by default.
|
||||
#
|
||||
# @return [Hash]
|
||||
attr_accessor :default_headers
|
||||
|
||||
# Initializes the ApiClient
|
||||
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
||||
def initialize(config = Configuration.default)
|
||||
@config = config
|
||||
@user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
|
||||
@default_headers = {
|
||||
'Content-Type' => 'application/json',
|
||||
'User-Agent' => @user_agent
|
||||
}
|
||||
end
|
||||
|
||||
def self.default
|
||||
@@default ||= ApiClient.new
|
||||
end
|
||||
|
||||
# Call an API with given options.
|
||||
#
|
||||
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
||||
# the data deserialized from response body (could be nil), response status code and response headers.
|
||||
def call_api(http_method, path, opts = {})
|
||||
stream = nil
|
||||
begin
|
||||
response = connection(opts).public_send(http_method.to_sym.downcase) do |req|
|
||||
request = build_request(http_method, path, req, opts)
|
||||
stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
|
||||
end
|
||||
|
||||
if config.debugging
|
||||
config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
||||
end
|
||||
|
||||
unless response.success?
|
||||
if response.status == 0 && response.respond_to?(:return_message)
|
||||
# Errors from libcurl will be made visible here
|
||||
fail ApiError.new(code: 0,
|
||||
message: response.return_message)
|
||||
else
|
||||
fail ApiError.new(code: response.status,
|
||||
response_headers: response.headers,
|
||||
response_body: response.body),
|
||||
response.reason_phrase
|
||||
end
|
||||
end
|
||||
rescue Faraday::TimeoutError
|
||||
fail ApiError.new('Connection timed out')
|
||||
rescue Faraday::ConnectionFailed
|
||||
fail ApiError.new('Connection failed')
|
||||
end
|
||||
|
||||
if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
|
||||
data = deserialize_file(response, stream)
|
||||
elsif opts[:return_type]
|
||||
data = deserialize(response, opts[:return_type])
|
||||
else
|
||||
data = nil
|
||||
end
|
||||
return data, response.status, response.headers
|
||||
end
|
||||
|
||||
# Builds the HTTP request
|
||||
#
|
||||
# @param [String] http_method HTTP method/verb (e.g. POST)
|
||||
# @param [String] path URL path (e.g. /account/new)
|
||||
# @option opts [Hash] :header_params Header parameters
|
||||
# @option opts [Hash] :query_params Query parameters
|
||||
# @option opts [Hash] :form_params Query parameters
|
||||
# @option opts [Object] :body HTTP body (JSON/XML)
|
||||
# @return [Faraday::Request] A Faraday Request
|
||||
def build_request(http_method, path, request, opts = {})
|
||||
url = build_request_url(path, opts)
|
||||
http_method = http_method.to_sym.downcase
|
||||
|
||||
header_params = @default_headers.merge(opts[:header_params] || {})
|
||||
query_params = opts[:query_params] || {}
|
||||
form_params = opts[:form_params] || {}
|
||||
|
||||
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
||||
|
||||
if [:post, :patch, :put, :delete].include?(http_method)
|
||||
req_body = build_request_body(header_params, form_params, opts[:body])
|
||||
if config.debugging
|
||||
config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
||||
end
|
||||
end
|
||||
request.headers = header_params
|
||||
request.body = req_body
|
||||
|
||||
# Overload default options only if provided
|
||||
request.options.params_encoder = config.params_encoder if config.params_encoder
|
||||
request.options.timeout = config.timeout if config.timeout
|
||||
|
||||
request.url url
|
||||
request.params = query_params
|
||||
request
|
||||
end
|
||||
|
||||
# Builds the HTTP request body
|
||||
#
|
||||
# @param [Hash] header_params Header parameters
|
||||
# @param [Hash] form_params Query parameters
|
||||
# @param [Object] body HTTP body (JSON/XML)
|
||||
# @return [String] HTTP body data in the form of string
|
||||
def build_request_body(header_params, form_params, body)
|
||||
# http form
|
||||
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
||||
data = URI.encode_www_form(form_params)
|
||||
elsif header_params['Content-Type'] == 'multipart/form-data'
|
||||
data = {}
|
||||
form_params.each do |key, value|
|
||||
case value
|
||||
when ::File, ::Tempfile
|
||||
# TODO hardcode to application/octet-stream, need better way to detect content type
|
||||
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
|
||||
when ::Array, nil
|
||||
# let Faraday handle Array and nil parameters
|
||||
data[key] = value
|
||||
else
|
||||
data[key] = value.to_s
|
||||
end
|
||||
end
|
||||
elsif body
|
||||
data = body.is_a?(String) ? body : body.to_json
|
||||
else
|
||||
data = nil
|
||||
end
|
||||
data
|
||||
end
|
||||
|
||||
def download_file(request)
|
||||
stream = []
|
||||
|
||||
# handle streaming Responses
|
||||
request.options.on_data = Proc.new do |chunk, overall_received_bytes|
|
||||
stream << chunk
|
||||
end
|
||||
stream
|
||||
end
|
||||
|
||||
def deserialize_file(response, stream)
|
||||
body = response.body
|
||||
if @config.return_binary_data == true
|
||||
# return byte stream
|
||||
encoding = body.encoding
|
||||
stream.join.force_encoding(encoding)
|
||||
else
|
||||
# return file instead of binary data
|
||||
content_disposition = response.headers['Content-Disposition']
|
||||
if content_disposition && content_disposition =~ /filename=/i
|
||||
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
||||
prefix = sanitize_filename(filename)
|
||||
else
|
||||
prefix = 'download-'
|
||||
end
|
||||
prefix = prefix + '-' unless prefix.end_with?('-')
|
||||
encoding = body.encoding
|
||||
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
||||
tempfile.write(stream.join.force_encoding(encoding))
|
||||
tempfile.close
|
||||
config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
||||
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
||||
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
||||
"explicitly with `tempfile.delete`"
|
||||
tempfile
|
||||
end
|
||||
end
|
||||
|
||||
def connection(opts)
|
||||
opts[:header_params]['Content-Type'] == 'multipart/form-data' ? connection_multipart : connection_regular
|
||||
end
|
||||
|
||||
def connection_multipart
|
||||
@connection_multipart ||= build_connection do |conn|
|
||||
conn.request :multipart
|
||||
conn.request :url_encoded
|
||||
end
|
||||
end
|
||||
|
||||
def connection_regular
|
||||
@connection_regular ||= build_connection
|
||||
end
|
||||
|
||||
def build_connection
|
||||
Faraday.new(url: config.base_url, ssl: ssl_options, proxy: config.proxy) do |conn|
|
||||
basic_auth(conn)
|
||||
config.configure_middleware(conn)
|
||||
yield(conn) if block_given?
|
||||
conn.adapter(Faraday.default_adapter)
|
||||
config.configure_connection(conn)
|
||||
end
|
||||
end
|
||||
|
||||
def ssl_options
|
||||
{
|
||||
ca_file: config.ssl_ca_file,
|
||||
verify: config.ssl_verify,
|
||||
verify_mode: config.ssl_verify_mode,
|
||||
client_cert: config.ssl_client_cert,
|
||||
client_key: config.ssl_client_key
|
||||
}
|
||||
end
|
||||
|
||||
def basic_auth(conn)
|
||||
if config.username && config.password
|
||||
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
|
||||
conn.request(:authorization, :basic, config.username, config.password)
|
||||
else
|
||||
conn.request(:basic_auth, config.username, config.password)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Check if the given MIME is a JSON MIME.
|
||||
# JSON MIME examples:
|
||||
# application/json
|
||||
# application/json; charset=UTF8
|
||||
# APPLICATION/JSON
|
||||
# */*
|
||||
# @param [String] mime MIME
|
||||
# @return [Boolean] True if the MIME is application/json
|
||||
def json_mime?(mime)
|
||||
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
||||
end
|
||||
|
||||
# Deserialize the response to the given return type.
|
||||
#
|
||||
# @param [Response] response HTTP response
|
||||
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
||||
def deserialize(response, return_type)
|
||||
body = response.body
|
||||
return nil if body.nil? || body.empty?
|
||||
|
||||
# return response body directly for String return type
|
||||
return body.to_s if return_type == 'String'
|
||||
|
||||
# ensuring a default content type
|
||||
content_type = response.headers['Content-Type'] || 'application/json'
|
||||
|
||||
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
||||
|
||||
begin
|
||||
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
||||
rescue JSON::ParserError => e
|
||||
if %w(String Date Time).include?(return_type)
|
||||
data = body
|
||||
else
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
convert_to_type data, return_type
|
||||
end
|
||||
|
||||
# Convert data to the given return type.
|
||||
# @param [Object] data Data to be converted
|
||||
# @param [String] return_type Return type
|
||||
# @return [Mixed] Data in a particular type
|
||||
def convert_to_type(data, return_type)
|
||||
return nil if data.nil?
|
||||
case return_type
|
||||
when 'String'
|
||||
data.to_s
|
||||
when 'Integer'
|
||||
data.to_i
|
||||
when 'Float'
|
||||
data.to_f
|
||||
when 'Boolean'
|
||||
data == true
|
||||
when 'Time'
|
||||
# parse date time (expecting ISO 8601 format)
|
||||
Time.parse data
|
||||
when 'Date'
|
||||
# parse date time (expecting ISO 8601 format)
|
||||
Date.parse data
|
||||
when 'Object'
|
||||
# generic object (usually a Hash), return directly
|
||||
data
|
||||
when /\AArray<(.+)>\z/
|
||||
# e.g. Array<Pet>
|
||||
sub_type = $1
|
||||
data.map { |item| convert_to_type(item, sub_type) }
|
||||
when /\AHash\<String, (.+)\>\z/
|
||||
# e.g. Hash<String, Integer>
|
||||
sub_type = $1
|
||||
{}.tap do |hash|
|
||||
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
||||
end
|
||||
else
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(return_type)
|
||||
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
||||
end
|
||||
end
|
||||
|
||||
# Sanitize filename by removing path.
|
||||
# e.g. ../../sun.gif becomes sun.gif
|
||||
#
|
||||
# @param [String] filename the filename to be sanitized
|
||||
# @return [String] the sanitized filename
|
||||
def sanitize_filename(filename)
|
||||
filename.gsub(/.*[\/\\]/, '')
|
||||
end
|
||||
|
||||
def build_request_url(path, opts = {})
|
||||
# Add leading and trailing slashes to path
|
||||
path = "/#{path}".gsub(/\/+/, '/')
|
||||
@config.base_url(opts[:operation]) + path
|
||||
end
|
||||
|
||||
# Update header and query params based on authentication settings.
|
||||
#
|
||||
# @param [Hash] header_params Header parameters
|
||||
# @param [Hash] query_params Query parameters
|
||||
# @param [String] auth_names Authentication scheme name
|
||||
def update_params_for_auth!(header_params, query_params, auth_names)
|
||||
Array(auth_names).each do |auth_name|
|
||||
auth_setting = @config.auth_settings[auth_name]
|
||||
next unless auth_setting
|
||||
case auth_setting[:in]
|
||||
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
||||
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
||||
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Sets user agent in HTTP header
|
||||
#
|
||||
# @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
|
||||
def user_agent=(user_agent)
|
||||
@user_agent = user_agent
|
||||
@default_headers['User-Agent'] = @user_agent
|
||||
end
|
||||
|
||||
# Return Accept header based on an array of accepts provided.
|
||||
# @param [Array] accepts array for Accept
|
||||
# @return [String] the Accept header (e.g. application/json)
|
||||
def select_header_accept(accepts)
|
||||
return nil if accepts.nil? || accepts.empty?
|
||||
# use JSON when present, otherwise use all of the provided
|
||||
json_accept = accepts.find { |s| json_mime?(s) }
|
||||
json_accept || accepts.join(',')
|
||||
end
|
||||
|
||||
# Return Content-Type header based on an array of content types provided.
|
||||
# @param [Array] content_types array for Content-Type
|
||||
# @return [String] the Content-Type header (e.g. application/json)
|
||||
def select_header_content_type(content_types)
|
||||
# return nil by default
|
||||
return if content_types.nil? || content_types.empty?
|
||||
# use JSON when present, otherwise use the first one
|
||||
json_content_type = content_types.find { |s| json_mime?(s) }
|
||||
json_content_type || content_types.first
|
||||
end
|
||||
|
||||
# Convert object (array, hash, object, etc) to JSON string.
|
||||
# @param [Object] model object to be converted into JSON string
|
||||
# @return [String] JSON string representation of the object
|
||||
def object_to_http_body(model)
|
||||
return model if model.nil? || model.is_a?(String)
|
||||
local_body = nil
|
||||
if model.is_a?(Array)
|
||||
local_body = model.map { |m| object_to_hash(m) }
|
||||
else
|
||||
local_body = object_to_hash(model)
|
||||
end
|
||||
local_body.to_json
|
||||
end
|
||||
|
||||
# Convert object(non-array) to hash.
|
||||
# @param [Object] obj object to be converted into JSON string
|
||||
# @return [String] JSON string representation of the object
|
||||
def object_to_hash(obj)
|
||||
if obj.respond_to?(:to_hash)
|
||||
obj.to_hash
|
||||
else
|
||||
obj
|
||||
end
|
||||
end
|
||||
|
||||
# Build parameter value according to the given collection format.
|
||||
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
||||
def build_collection_param(param, collection_format)
|
||||
case collection_format
|
||||
when :csv
|
||||
param.join(',')
|
||||
when :ssv
|
||||
param.join(' ')
|
||||
when :tsv
|
||||
param.join("\t")
|
||||
when :pipes
|
||||
param.join('|')
|
||||
when :multi
|
||||
# return the array directly as typhoeus will handle it as expected
|
||||
param
|
||||
else
|
||||
fail "unknown collection format: #{collection_format.inspect}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,58 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
module OpenapiClient
|
||||
class ApiError < StandardError
|
||||
attr_reader :code, :response_headers, :response_body
|
||||
|
||||
# Usage examples:
|
||||
# ApiError.new
|
||||
# ApiError.new("message")
|
||||
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
||||
# ApiError.new(:code => 404, :message => "Not Found")
|
||||
def initialize(arg = nil)
|
||||
if arg.is_a? Hash
|
||||
if arg.key?(:message) || arg.key?('message')
|
||||
super(arg[:message] || arg['message'])
|
||||
else
|
||||
super arg
|
||||
end
|
||||
|
||||
arg.each do |k, v|
|
||||
instance_variable_set "@#{k}", v
|
||||
end
|
||||
else
|
||||
super arg
|
||||
@message = arg
|
||||
end
|
||||
end
|
||||
|
||||
# Override to_s to display a friendly error message
|
||||
def to_s
|
||||
message
|
||||
end
|
||||
|
||||
def message
|
||||
if @message.nil?
|
||||
msg = "Error message: the server returns an error"
|
||||
else
|
||||
msg = @message
|
||||
end
|
||||
|
||||
msg += "\nHTTP status code: #{code}" if code
|
||||
msg += "\nResponse headers: #{response_headers}" if response_headers
|
||||
msg += "\nResponse body: #{response_body}" if response_body
|
||||
|
||||
msg
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,389 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
module OpenapiClient
|
||||
class Configuration
|
||||
# Defines url scheme
|
||||
attr_accessor :scheme
|
||||
|
||||
# Defines url host
|
||||
attr_accessor :host
|
||||
|
||||
# Defines url base path
|
||||
attr_accessor :base_path
|
||||
|
||||
# Define server configuration index
|
||||
attr_accessor :server_index
|
||||
|
||||
# Define server operation configuration index
|
||||
attr_accessor :server_operation_index
|
||||
|
||||
# Default server variables
|
||||
attr_accessor :server_variables
|
||||
|
||||
# Default server operation variables
|
||||
attr_accessor :server_operation_variables
|
||||
|
||||
# Defines API keys used with API Key authentications.
|
||||
#
|
||||
# @return [Hash] key: parameter name, value: parameter value (API key)
|
||||
#
|
||||
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
||||
# config.api_key['api_key'] = 'xxx'
|
||||
attr_accessor :api_key
|
||||
|
||||
# Defines API key prefixes used with API Key authentications.
|
||||
#
|
||||
# @return [Hash] key: parameter name, value: API key prefix
|
||||
#
|
||||
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
||||
# config.api_key_prefix['api_key'] = 'Token'
|
||||
attr_accessor :api_key_prefix
|
||||
|
||||
# Defines the username used with HTTP basic authentication.
|
||||
#
|
||||
# @return [String]
|
||||
attr_accessor :username
|
||||
|
||||
# Defines the password used with HTTP basic authentication.
|
||||
#
|
||||
# @return [String]
|
||||
attr_accessor :password
|
||||
|
||||
# Defines the access token (Bearer) used with OAuth2.
|
||||
attr_accessor :access_token
|
||||
|
||||
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
||||
# Overrides the access_token if set
|
||||
# @return [Proc]
|
||||
attr_accessor :access_token_getter
|
||||
|
||||
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
||||
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
||||
# Default to false.
|
||||
attr_accessor :return_binary_data
|
||||
|
||||
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
||||
# details will be logged with `logger.debug` (see the `logger` attribute).
|
||||
# Default to false.
|
||||
#
|
||||
# @return [true, false]
|
||||
attr_accessor :debugging
|
||||
|
||||
# Defines the logger used for debugging.
|
||||
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
||||
#
|
||||
# @return [#debug]
|
||||
attr_accessor :logger
|
||||
|
||||
# Defines the temporary folder to store downloaded files
|
||||
# (for API endpoints that have file response).
|
||||
# Default to use `Tempfile`.
|
||||
#
|
||||
# @return [String]
|
||||
attr_accessor :temp_folder_path
|
||||
|
||||
# The time limit for HTTP request in seconds.
|
||||
# Default to 0 (never times out).
|
||||
attr_accessor :timeout
|
||||
|
||||
# Set this to false to skip client side validation in the operation.
|
||||
# Default to true.
|
||||
# @return [true, false]
|
||||
attr_accessor :client_side_validation
|
||||
|
||||
### TLS/SSL setting
|
||||
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
||||
# Default to true.
|
||||
#
|
||||
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||
#
|
||||
# @return [true, false]
|
||||
attr_accessor :ssl_verify
|
||||
|
||||
### TLS/SSL setting
|
||||
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
||||
#
|
||||
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
||||
#
|
||||
attr_accessor :ssl_verify_mode
|
||||
|
||||
### TLS/SSL setting
|
||||
# Set this to customize the certificate file to verify the peer.
|
||||
#
|
||||
# @return [String] the path to the certificate file
|
||||
attr_accessor :ssl_ca_file
|
||||
|
||||
### TLS/SSL setting
|
||||
# Client certificate file (for client certificate)
|
||||
attr_accessor :ssl_client_cert
|
||||
|
||||
### TLS/SSL setting
|
||||
# Client private key file (for client certificate)
|
||||
attr_accessor :ssl_client_key
|
||||
|
||||
### Proxy setting
|
||||
# HTTP Proxy settings
|
||||
attr_accessor :proxy
|
||||
|
||||
# Set this to customize parameters encoder of array parameter.
|
||||
# Default to nil. Faraday uses NestedParamsEncoder when nil.
|
||||
#
|
||||
# @see The params_encoder option of Faraday. Related source code:
|
||||
# https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
|
||||
attr_accessor :params_encoder
|
||||
|
||||
|
||||
attr_accessor :inject_format
|
||||
|
||||
attr_accessor :force_ending_format
|
||||
|
||||
def initialize
|
||||
@scheme = 'http'
|
||||
@host = 'localhost:3000'
|
||||
@base_path = ''
|
||||
@server_index = nil
|
||||
@server_operation_index = {}
|
||||
@server_variables = {}
|
||||
@server_operation_variables = {}
|
||||
@api_key = {}
|
||||
@api_key_prefix = {}
|
||||
@client_side_validation = true
|
||||
@ssl_verify = true
|
||||
@ssl_verify_mode = nil
|
||||
@ssl_ca_file = nil
|
||||
@ssl_client_cert = nil
|
||||
@ssl_client_key = nil
|
||||
@middlewares = Hash.new { |h, k| h[k] = [] }
|
||||
@configure_connection_blocks = []
|
||||
@timeout = 60
|
||||
# return data as binary instead of file
|
||||
@return_binary_data = false
|
||||
@params_encoder = nil
|
||||
@debugging = false
|
||||
@inject_format = false
|
||||
@force_ending_format = false
|
||||
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
||||
|
||||
yield(self) if block_given?
|
||||
end
|
||||
|
||||
# The default Configuration object.
|
||||
def self.default
|
||||
@@default ||= Configuration.new
|
||||
end
|
||||
|
||||
def configure
|
||||
yield(self) if block_given?
|
||||
end
|
||||
|
||||
def scheme=(scheme)
|
||||
# remove :// from scheme
|
||||
@scheme = scheme.sub(/:\/\//, '')
|
||||
end
|
||||
|
||||
def host=(host)
|
||||
# remove http(s):// and anything after a slash
|
||||
@host = host.sub(/https?:\/\//, '').split('/').first
|
||||
end
|
||||
|
||||
def base_path=(base_path)
|
||||
# Add leading and trailing slashes to base_path
|
||||
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
||||
@base_path = '' if @base_path == '/'
|
||||
end
|
||||
|
||||
# Returns base URL for specified operation based on server settings
|
||||
def base_url(operation = nil)
|
||||
if operation_server_settings.key?(operation) then
|
||||
index = server_operation_index.fetch(operation, server_index)
|
||||
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
||||
else
|
||||
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
||||
end
|
||||
end
|
||||
|
||||
# Gets API key (with prefix if set).
|
||||
# @param [String] param_name the parameter name of API key auth
|
||||
def api_key_with_prefix(param_name, param_alias = nil)
|
||||
key = @api_key[param_name]
|
||||
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
||||
if @api_key_prefix[param_name]
|
||||
"#{@api_key_prefix[param_name]} #{key}"
|
||||
else
|
||||
key
|
||||
end
|
||||
end
|
||||
|
||||
# Gets access_token using access_token_getter or uses the static access_token
|
||||
def access_token_with_refresh
|
||||
return access_token if access_token_getter.nil?
|
||||
access_token_getter.call
|
||||
end
|
||||
|
||||
# Gets Basic Auth token string
|
||||
def basic_auth_token
|
||||
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
||||
end
|
||||
|
||||
# Returns Auth Settings hash for api client.
|
||||
def auth_settings
|
||||
{
|
||||
'http_auth' =>
|
||||
{
|
||||
type: 'basic',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: basic_auth_token
|
||||
},
|
||||
'http_bearer_auth' =>
|
||||
{
|
||||
type: 'bearer',
|
||||
in: 'header',
|
||||
key: 'Authorization',
|
||||
value: "Bearer #{access_token_with_refresh}"
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
# Returns an array of Server setting
|
||||
def server_settings
|
||||
[
|
||||
{
|
||||
url: "http://localhost:3000",
|
||||
description: "No description provided",
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
def operation_server_settings
|
||||
{
|
||||
}
|
||||
end
|
||||
|
||||
# Returns URL based on server settings
|
||||
#
|
||||
# @param index array index of the server settings
|
||||
# @param variables hash of variable and the corresponding value
|
||||
def server_url(index, variables = {}, servers = nil)
|
||||
servers = server_settings if servers == nil
|
||||
|
||||
# check array index out of bound
|
||||
if (index.nil? || index < 0 || index >= servers.size)
|
||||
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
||||
end
|
||||
|
||||
server = servers[index]
|
||||
url = server[:url]
|
||||
|
||||
return url unless server.key? :variables
|
||||
|
||||
# go through variable and assign a value
|
||||
server[:variables].each do |name, variable|
|
||||
if variables.key?(name)
|
||||
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
||||
url.gsub! "{" + name.to_s + "}", variables[name]
|
||||
else
|
||||
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
||||
end
|
||||
else
|
||||
# use default value
|
||||
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
||||
end
|
||||
end
|
||||
|
||||
url
|
||||
end
|
||||
|
||||
# Configure Faraday connection directly.
|
||||
#
|
||||
# ```
|
||||
# c.configure_faraday_connection do |conn|
|
||||
# conn.use Faraday::HttpCache, shared_cache: false, logger: logger
|
||||
# conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
|
||||
# logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# c.configure_faraday_connection do |conn|
|
||||
# conn.adapter :typhoeus
|
||||
# end
|
||||
# ```
|
||||
#
|
||||
# @param block [Proc] `#call`able object that takes one arg, the connection
|
||||
def configure_faraday_connection(&block)
|
||||
@configure_connection_blocks << block
|
||||
end
|
||||
|
||||
def configure_connection(conn)
|
||||
@configure_connection_blocks.each do |block|
|
||||
block.call(conn)
|
||||
end
|
||||
end
|
||||
|
||||
# Adds middleware to the stack
|
||||
def use(*middleware)
|
||||
set_faraday_middleware(:use, *middleware)
|
||||
end
|
||||
|
||||
# Adds request middleware to the stack
|
||||
def request(*middleware)
|
||||
set_faraday_middleware(:request, *middleware)
|
||||
end
|
||||
|
||||
# Adds response middleware to the stack
|
||||
def response(*middleware)
|
||||
set_faraday_middleware(:response, *middleware)
|
||||
end
|
||||
|
||||
# Adds Faraday middleware setting information to the stack
|
||||
#
|
||||
# @example Use the `set_faraday_middleware` method to set middleware information
|
||||
# config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
|
||||
# config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
|
||||
# config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
|
||||
# config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
|
||||
# config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
|
||||
# config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
|
||||
#
|
||||
# @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
|
||||
def set_faraday_middleware(operation, key, *args, &block)
|
||||
unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
|
||||
fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
|
||||
" :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
|
||||
end
|
||||
|
||||
@middlewares[operation] << [key, args, block]
|
||||
end
|
||||
ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
|
||||
|
||||
# Set up middleware on the connection
|
||||
def configure_middleware(connection)
|
||||
return if @middlewares.empty?
|
||||
|
||||
[:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
|
||||
next unless @middlewares.key?(operation)
|
||||
|
||||
@middlewares[operation].each do |key, args, block|
|
||||
connection.builder.send(operation, key, *args, &block)
|
||||
end
|
||||
end
|
||||
|
||||
if @middlewares.key?(:delete)
|
||||
@middlewares[:delete].each do |key, _args, _block|
|
||||
connection.builder.delete(key)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,223 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class Bird
|
||||
attr_accessor :size
|
||||
|
||||
attr_accessor :color
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'size' => :'size',
|
||||
:'color' => :'color'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'size' => :'String',
|
||||
:'color' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Bird` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'size')
|
||||
self.size = attributes[:'size']
|
||||
end
|
||||
|
||||
if attributes.key?(:'color')
|
||||
self.color = attributes[:'color']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
size == o.size &&
|
||||
color == o.color
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[size, color].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,223 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class Category
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'id' => :'id',
|
||||
:'name' => :'name'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'id' => :'Integer',
|
||||
:'name' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Category` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'id')
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
|
||||
if attributes.key?(:'name')
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
id == o.id &&
|
||||
name == o.name
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[id, name].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,268 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class DataQuery < Query
|
||||
# test suffix
|
||||
attr_accessor :suffix
|
||||
|
||||
# Some text containing white spaces
|
||||
attr_accessor :text
|
||||
|
||||
# A date
|
||||
attr_accessor :date
|
||||
|
||||
class EnumAttributeValidator
|
||||
attr_reader :datatype
|
||||
attr_reader :allowable_values
|
||||
|
||||
def initialize(datatype, allowable_values)
|
||||
@allowable_values = allowable_values.map do |value|
|
||||
case datatype.to_s
|
||||
when /Integer/i
|
||||
value.to_i
|
||||
when /Float/i
|
||||
value.to_f
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid?(value)
|
||||
!value || allowable_values.include?(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'suffix' => :'suffix',
|
||||
:'text' => :'text',
|
||||
:'date' => :'date'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values.concat(superclass.acceptable_attributes)
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'suffix' => :'String',
|
||||
:'text' => :'String',
|
||||
:'date' => :'Time'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# List of class defined in allOf (OpenAPI v3)
|
||||
def self.openapi_all_of
|
||||
[
|
||||
:'Query'
|
||||
]
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::DataQuery` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
# call parent's initialize
|
||||
super(attributes)
|
||||
|
||||
if attributes.key?(:'suffix')
|
||||
self.suffix = attributes[:'suffix']
|
||||
end
|
||||
|
||||
if attributes.key?(:'text')
|
||||
self.text = attributes[:'text']
|
||||
end
|
||||
|
||||
if attributes.key?(:'date')
|
||||
self.date = attributes[:'date']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = super
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true && super
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
suffix == o.suffix &&
|
||||
text == o.text &&
|
||||
date == o.date && super(o)
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[suffix, text, date].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
super(attributes)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = super
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,317 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
# to test the default value of properties
|
||||
class DefaultValue
|
||||
attr_accessor :array_string_enum_ref_default
|
||||
|
||||
attr_accessor :array_string_enum_default
|
||||
|
||||
attr_accessor :array_string_default
|
||||
|
||||
attr_accessor :array_integer_default
|
||||
|
||||
attr_accessor :array_string
|
||||
|
||||
attr_accessor :array_string_nullable
|
||||
|
||||
attr_accessor :array_string_extension_nullable
|
||||
|
||||
attr_accessor :string_nullable
|
||||
|
||||
class EnumAttributeValidator
|
||||
attr_reader :datatype
|
||||
attr_reader :allowable_values
|
||||
|
||||
def initialize(datatype, allowable_values)
|
||||
@allowable_values = allowable_values.map do |value|
|
||||
case datatype.to_s
|
||||
when /Integer/i
|
||||
value.to_i
|
||||
when /Float/i
|
||||
value.to_f
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid?(value)
|
||||
!value || allowable_values.include?(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'array_string_enum_ref_default' => :'array_string_enum_ref_default',
|
||||
:'array_string_enum_default' => :'array_string_enum_default',
|
||||
:'array_string_default' => :'array_string_default',
|
||||
:'array_integer_default' => :'array_integer_default',
|
||||
:'array_string' => :'array_string',
|
||||
:'array_string_nullable' => :'array_string_nullable',
|
||||
:'array_string_extension_nullable' => :'array_string_extension_nullable',
|
||||
:'string_nullable' => :'string_nullable'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'array_string_enum_ref_default' => :'Array<StringEnumRef>',
|
||||
:'array_string_enum_default' => :'Array<String>',
|
||||
:'array_string_default' => :'Array<String>',
|
||||
:'array_integer_default' => :'Array<Integer>',
|
||||
:'array_string' => :'Array<String>',
|
||||
:'array_string_nullable' => :'Array<String>',
|
||||
:'array_string_extension_nullable' => :'Array<String>',
|
||||
:'string_nullable' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
:'array_string_nullable',
|
||||
:'array_string_extension_nullable',
|
||||
:'string_nullable'
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::DefaultValue` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'array_string_enum_ref_default')
|
||||
if (value = attributes[:'array_string_enum_ref_default']).is_a?(Array)
|
||||
self.array_string_enum_ref_default = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_string_enum_default')
|
||||
if (value = attributes[:'array_string_enum_default']).is_a?(Array)
|
||||
self.array_string_enum_default = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_string_default')
|
||||
if (value = attributes[:'array_string_default']).is_a?(Array)
|
||||
self.array_string_default = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_integer_default')
|
||||
if (value = attributes[:'array_integer_default']).is_a?(Array)
|
||||
self.array_integer_default = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_string')
|
||||
if (value = attributes[:'array_string']).is_a?(Array)
|
||||
self.array_string = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_string_nullable')
|
||||
if (value = attributes[:'array_string_nullable']).is_a?(Array)
|
||||
self.array_string_nullable = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'array_string_extension_nullable')
|
||||
if (value = attributes[:'array_string_extension_nullable']).is_a?(Array)
|
||||
self.array_string_extension_nullable = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'string_nullable')
|
||||
self.string_nullable = attributes[:'string_nullable']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
array_string_enum_ref_default == o.array_string_enum_ref_default &&
|
||||
array_string_enum_default == o.array_string_enum_default &&
|
||||
array_string_default == o.array_string_default &&
|
||||
array_integer_default == o.array_integer_default &&
|
||||
array_string == o.array_string &&
|
||||
array_string_nullable == o.array_string_nullable &&
|
||||
array_string_extension_nullable == o.array_string_extension_nullable &&
|
||||
string_nullable == o.string_nullable
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[array_string_enum_ref_default, array_string_enum_default, array_string_default, array_integer_default, array_string, array_string_nullable, array_string_extension_nullable, string_nullable].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,260 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class NumberPropertiesOnly
|
||||
attr_accessor :number
|
||||
|
||||
attr_accessor :float
|
||||
|
||||
attr_accessor :double
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'number' => :'number',
|
||||
:'float' => :'float',
|
||||
:'double' => :'double'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'number' => :'Float',
|
||||
:'float' => :'Float',
|
||||
:'double' => :'Float'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::NumberPropertiesOnly` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'number')
|
||||
self.number = attributes[:'number']
|
||||
end
|
||||
|
||||
if attributes.key?(:'float')
|
||||
self.float = attributes[:'float']
|
||||
end
|
||||
|
||||
if attributes.key?(:'double')
|
||||
self.double = attributes[:'double']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
if !@double.nil? && @double > 50.2
|
||||
invalid_properties.push('invalid value for "double", must be smaller than or equal to 50.2.')
|
||||
end
|
||||
|
||||
if !@double.nil? && @double < 0.8
|
||||
invalid_properties.push('invalid value for "double", must be greater than or equal to 0.8.')
|
||||
end
|
||||
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
return false if !@double.nil? && @double > 50.2
|
||||
return false if !@double.nil? && @double < 0.8
|
||||
true
|
||||
end
|
||||
|
||||
# Custom attribute writer method with validation
|
||||
# @param [Object] double Value to be assigned
|
||||
def double=(double)
|
||||
if double.nil?
|
||||
fail ArgumentError, 'double cannot be nil'
|
||||
end
|
||||
|
||||
if double > 50.2
|
||||
fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 50.2.'
|
||||
end
|
||||
|
||||
if double < 0.8
|
||||
fail ArgumentError, 'invalid value for "double", must be greater than or equal to 0.8.'
|
||||
end
|
||||
|
||||
@double = double
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
number == o.number &&
|
||||
float == o.float &&
|
||||
double == o.double
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[number, float, double].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,312 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class Pet
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
attr_accessor :category
|
||||
|
||||
attr_accessor :photo_urls
|
||||
|
||||
attr_accessor :tags
|
||||
|
||||
# pet status in the store
|
||||
attr_accessor :status
|
||||
|
||||
class EnumAttributeValidator
|
||||
attr_reader :datatype
|
||||
attr_reader :allowable_values
|
||||
|
||||
def initialize(datatype, allowable_values)
|
||||
@allowable_values = allowable_values.map do |value|
|
||||
case datatype.to_s
|
||||
when /Integer/i
|
||||
value.to_i
|
||||
when /Float/i
|
||||
value.to_f
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid?(value)
|
||||
!value || allowable_values.include?(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'id' => :'id',
|
||||
:'name' => :'name',
|
||||
:'category' => :'category',
|
||||
:'photo_urls' => :'photoUrls',
|
||||
:'tags' => :'tags',
|
||||
:'status' => :'status'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'id' => :'Integer',
|
||||
:'name' => :'String',
|
||||
:'category' => :'Category',
|
||||
:'photo_urls' => :'Array<String>',
|
||||
:'tags' => :'Array<Tag>',
|
||||
:'status' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Pet` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'id')
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
|
||||
if attributes.key?(:'name')
|
||||
self.name = attributes[:'name']
|
||||
else
|
||||
self.name = nil
|
||||
end
|
||||
|
||||
if attributes.key?(:'category')
|
||||
self.category = attributes[:'category']
|
||||
end
|
||||
|
||||
if attributes.key?(:'photo_urls')
|
||||
if (value = attributes[:'photo_urls']).is_a?(Array)
|
||||
self.photo_urls = value
|
||||
end
|
||||
else
|
||||
self.photo_urls = nil
|
||||
end
|
||||
|
||||
if attributes.key?(:'tags')
|
||||
if (value = attributes[:'tags']).is_a?(Array)
|
||||
self.tags = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.key?(:'status')
|
||||
self.status = attributes[:'status']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
if @name.nil?
|
||||
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
||||
end
|
||||
|
||||
if @photo_urls.nil?
|
||||
invalid_properties.push('invalid value for "photo_urls", photo_urls cannot be nil.')
|
||||
end
|
||||
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
return false if @name.nil?
|
||||
return false if @photo_urls.nil?
|
||||
status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"])
|
||||
return false unless status_validator.valid?(@status)
|
||||
true
|
||||
end
|
||||
|
||||
# Custom attribute writer method checking allowed values (enum).
|
||||
# @param [Object] status Object to be assigned
|
||||
def status=(status)
|
||||
validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"])
|
||||
unless validator.valid?(status)
|
||||
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
||||
end
|
||||
@status = status
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
id == o.id &&
|
||||
name == o.name &&
|
||||
category == o.category &&
|
||||
photo_urls == o.photo_urls &&
|
||||
tags == o.tags &&
|
||||
status == o.status
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[id, name, category, photo_urls, tags, status].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,248 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class Query
|
||||
# Query
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :outcomes
|
||||
|
||||
class EnumAttributeValidator
|
||||
attr_reader :datatype
|
||||
attr_reader :allowable_values
|
||||
|
||||
def initialize(datatype, allowable_values)
|
||||
@allowable_values = allowable_values.map do |value|
|
||||
case datatype.to_s
|
||||
when /Integer/i
|
||||
value.to_i
|
||||
when /Float/i
|
||||
value.to_f
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid?(value)
|
||||
!value || allowable_values.include?(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'id' => :'id',
|
||||
:'outcomes' => :'outcomes'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'id' => :'Integer',
|
||||
:'outcomes' => :'Array<String>'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Query` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'id')
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
|
||||
if attributes.key?(:'outcomes')
|
||||
if (value = attributes[:'outcomes']).is_a?(Array)
|
||||
self.outcomes = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
id == o.id &&
|
||||
outcomes == o.outcomes
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[id, outcomes].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,41 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class StringEnumRef
|
||||
SUCCESS = "success".freeze
|
||||
FAILURE = "failure".freeze
|
||||
UNCLASSIFIED = "unclassified".freeze
|
||||
|
||||
def self.all_vars
|
||||
@all_vars ||= [SUCCESS, FAILURE, UNCLASSIFIED].freeze
|
||||
end
|
||||
|
||||
# Builds the enum from string
|
||||
# @param [String] The enum value in the form of the string
|
||||
# @return [String] The enum value
|
||||
def self.build_from_hash(value)
|
||||
new.build_from_hash(value)
|
||||
end
|
||||
|
||||
# Builds the enum from string
|
||||
# @param [String] The enum value in the form of the string
|
||||
# @return [String] The enum value
|
||||
def build_from_hash(value)
|
||||
return value if StringEnumRef.all_vars.include?(value)
|
||||
raise "Invalid ENUM value #{value} for class #StringEnumRef"
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,223 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class Tag
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'id' => :'id',
|
||||
:'name' => :'name'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'id' => :'Integer',
|
||||
:'name' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Tag` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'id')
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
|
||||
if attributes.key?(:'name')
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
id == o.id &&
|
||||
name == o.name
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[id, name].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,249 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
attr_accessor :size
|
||||
|
||||
attr_accessor :color
|
||||
|
||||
attr_accessor :id
|
||||
|
||||
attr_accessor :name
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'size' => :'size',
|
||||
:'color' => :'color',
|
||||
:'id' => :'id',
|
||||
:'name' => :'name'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'size' => :'String',
|
||||
:'color' => :'String',
|
||||
:'id' => :'Integer',
|
||||
:'name' => :'String'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# List of class defined in allOf (OpenAPI v3)
|
||||
def self.openapi_all_of
|
||||
[
|
||||
:'Bird',
|
||||
:'Category'
|
||||
]
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'size')
|
||||
self.size = attributes[:'size']
|
||||
end
|
||||
|
||||
if attributes.key?(:'color')
|
||||
self.color = attributes[:'color']
|
||||
end
|
||||
|
||||
if attributes.key?(:'id')
|
||||
self.id = attributes[:'id']
|
||||
end
|
||||
|
||||
if attributes.key?(:'name')
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
size == o.size &&
|
||||
color == o.color &&
|
||||
id == o.id &&
|
||||
name == o.name
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[size, color, id, name].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,216 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
require 'time'
|
||||
|
||||
module OpenapiClient
|
||||
class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
attr_accessor :values
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'values' => :'values'
|
||||
}
|
||||
end
|
||||
|
||||
# Returns all the JSON keys this model knows about
|
||||
def self.acceptable_attributes
|
||||
attribute_map.values
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.openapi_types
|
||||
{
|
||||
:'values' => :'Array<String>'
|
||||
}
|
||||
end
|
||||
|
||||
# List of attributes with nullable: true
|
||||
def self.openapi_nullable
|
||||
Set.new([
|
||||
])
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
if (!attributes.is_a?(Hash))
|
||||
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter` initialize method"
|
||||
end
|
||||
|
||||
# check to see if the attribute exists and convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}) { |(k, v), h|
|
||||
if (!self.class.attribute_map.key?(k.to_sym))
|
||||
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
||||
end
|
||||
h[k.to_sym] = v
|
||||
}
|
||||
|
||||
if attributes.key?(:'values')
|
||||
if (value = attributes[:'values']).is_a?(Array)
|
||||
self.values = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properties with the reasons
|
||||
def list_invalid_properties
|
||||
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
||||
invalid_properties = Array.new
|
||||
invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
warn '[DEPRECATED] the `valid?` method is obsolete'
|
||||
true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
values == o.values
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[values].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def self.build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
attributes = attributes.transform_keys(&:to_sym)
|
||||
transformed_hash = {}
|
||||
openapi_types.each_pair do |key, type|
|
||||
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = nil
|
||||
elsif type =~ /\AArray<(.*)>/i
|
||||
# check to ensure the input is an array given that the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[attribute_map[key]].is_a?(Array)
|
||||
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
||||
end
|
||||
elsif !attributes[attribute_map[key]].nil?
|
||||
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
||||
end
|
||||
end
|
||||
new(transformed_hash)
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def self._deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :Time
|
||||
Time.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :Boolean
|
||||
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
# models (e.g. Pet) or oneOf
|
||||
klass = OpenapiClient.const_get(type)
|
||||
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
if value.nil?
|
||||
is_nullable = self.class.openapi_nullable.include?(attr)
|
||||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
||||
end
|
||||
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map { |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
module OpenapiClient
|
||||
VERSION = '1.0.0'
|
||||
end
|
40
samples/client/echo_api/ruby-faraday/openapi_client.gemspec
Normal file
40
samples/client/echo_api/ruby-faraday/openapi_client.gemspec
Normal file
@ -0,0 +1,40 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
require "openapi_client/version"
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "openapi_client"
|
||||
s.version = OpenapiClient::VERSION
|
||||
s.platform = Gem::Platform::RUBY
|
||||
s.authors = ["OpenAPI-Generator"]
|
||||
s.email = ["team@openapitools.org"]
|
||||
s.homepage = "https://openapi-generator.tech"
|
||||
s.summary = "Echo Server API Ruby Gem"
|
||||
s.description = "Echo Server API"
|
||||
s.license = "Unlicense"
|
||||
s.required_ruby_version = ">= 2.7"
|
||||
s.metadata = {}
|
||||
|
||||
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
|
||||
s.add_runtime_dependency 'faraday-multipart'
|
||||
|
||||
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
||||
|
||||
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
||||
s.test_files = `find spec/*`.split("\n")
|
||||
s.executables = []
|
||||
s.require_paths = ["lib"]
|
||||
end
|
@ -0,0 +1,57 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::AuthApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'AuthApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::AuthApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of AuthApi' do
|
||||
it 'should create an instance of AuthApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::AuthApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_auth_http_basic
|
||||
# To test HTTP basic authentication
|
||||
# To test HTTP basic authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
describe 'test_auth_http_basic test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_auth_http_bearer
|
||||
# To test HTTP bearer authentication
|
||||
# To test HTTP bearer authentication
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
describe 'test_auth_http_bearer test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
130
samples/client/echo_api/ruby-faraday/spec/api/body_api_spec.rb
Normal file
130
samples/client/echo_api/ruby-faraday/spec/api/body_api_spec.rb
Normal file
@ -0,0 +1,130 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::BodyApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'BodyApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::BodyApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of BodyApi' do
|
||||
it 'should create an instance of BodyApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::BodyApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_binary_gif
|
||||
# Test binary (gif) response body
|
||||
# Test binary (gif) response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [File]
|
||||
describe 'test_binary_gif test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_body_application_octetstream_binary
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [File] :body
|
||||
# @return [String]
|
||||
describe 'test_body_application_octetstream_binary test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_body_multipart_formdata_array_of_binary
|
||||
# Test array of binary in multipart mime
|
||||
# Test array of binary in multipart mime
|
||||
# @param files
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
describe 'test_body_multipart_formdata_array_of_binary test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_echo_body_all_of_pet
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Pet]
|
||||
describe 'test_echo_body_all_of_pet test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_echo_body_free_form_object_response_string
|
||||
# Test free form object
|
||||
# Test free form object
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Object] :body Free form object
|
||||
# @return [String]
|
||||
describe 'test_echo_body_free_form_object_response_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_echo_body_pet
|
||||
# Test body parameter(s)
|
||||
# Test body parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [Pet]
|
||||
describe 'test_echo_body_pet test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_echo_body_pet_response_string
|
||||
# Test empty response body
|
||||
# Test empty response body
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :pet Pet object that needs to be added to the store
|
||||
# @return [String]
|
||||
describe 'test_echo_body_pet_response_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_echo_body_tag_response_string
|
||||
# Test empty json (request body)
|
||||
# Test empty json (request body)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Tag] :tag Tag object
|
||||
# @return [String]
|
||||
describe 'test_echo_body_tag_response_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,66 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::FormApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'FormApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::FormApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of FormApi' do
|
||||
it 'should create an instance of FormApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::FormApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_form_integer_boolean_string
|
||||
# Test form parameter(s)
|
||||
# Test form parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_form
|
||||
# @option opts [Boolean] :boolean_form
|
||||
# @option opts [String] :string_form
|
||||
# @return [String]
|
||||
describe 'test_form_integer_boolean_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_form_oneof
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# Test form parameter(s) for oneOf schema
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :form1
|
||||
# @option opts [Integer] :form2
|
||||
# @option opts [String] :form3
|
||||
# @option opts [Boolean] :form4
|
||||
# @option opts [Integer] :id
|
||||
# @option opts [String] :name
|
||||
# @return [String]
|
||||
describe 'test_form_oneof test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,51 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::HeaderApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'HeaderApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::HeaderApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of HeaderApi' do
|
||||
it 'should create an instance of HeaderApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::HeaderApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_header_integer_boolean_string_enums
|
||||
# Test header parameter(s)
|
||||
# Test header parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_header
|
||||
# @option opts [Boolean] :boolean_header
|
||||
# @option opts [String] :string_header
|
||||
# @option opts [String] :enum_nonref_string_header
|
||||
# @option opts [StringEnumRef] :enum_ref_string_header
|
||||
# @return [String]
|
||||
describe 'test_header_integer_boolean_string_enums test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,50 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::PathApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'PathApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::PathApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of PathApi' do
|
||||
it 'should create an instance of PathApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::PathApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path
|
||||
# Test path parameter(s)
|
||||
# Test path parameter(s)
|
||||
# @param path_string
|
||||
# @param path_integer
|
||||
# @param enum_nonref_string_path
|
||||
# @param enum_ref_string_path
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [String]
|
||||
describe 'tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
136
samples/client/echo_api/ruby-faraday/spec/api/query_api_spec.rb
Normal file
136
samples/client/echo_api/ruby-faraday/spec/api/query_api_spec.rb
Normal file
@ -0,0 +1,136 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
|
||||
# Unit tests for OpenapiClient::QueryApi
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe 'QueryApi' do
|
||||
before do
|
||||
# run before each test
|
||||
@api_instance = OpenapiClient::QueryApi.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of QueryApi' do
|
||||
it 'should create an instance of QueryApi' do
|
||||
expect(@api_instance).to be_instance_of(OpenapiClient::QueryApi)
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_enum_ref_string
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :enum_nonref_string_query
|
||||
# @option opts [StringEnumRef] :enum_ref_string_query
|
||||
# @return [String]
|
||||
describe 'test_enum_ref_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_datetime_date_string
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Time] :datetime_query
|
||||
# @option opts [Date] :date_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [String]
|
||||
describe 'test_query_datetime_date_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_integer_boolean_string
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Integer] :integer_query
|
||||
# @option opts [Boolean] :boolean_query
|
||||
# @option opts [String] :string_query
|
||||
# @return [String]
|
||||
describe 'test_query_integer_boolean_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_style_deep_object_explode_true_object
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [String]
|
||||
describe 'test_query_style_deep_object_explode_true_object test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_style_deep_object_explode_true_object_all_of
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter] :query_object
|
||||
# @return [String]
|
||||
describe 'test_query_style_deep_object_explode_true_object_all_of test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_style_form_explode_true_array_string
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter] :query_object
|
||||
# @return [String]
|
||||
describe 'test_query_style_form_explode_true_array_string test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_style_form_explode_true_object
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :query_object
|
||||
# @return [String]
|
||||
describe 'test_query_style_form_explode_true_object test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
# unit tests for test_query_style_form_explode_true_object_all_of
|
||||
# Test query parameter(s)
|
||||
# Test query parameter(s)
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [DataQuery] :query_object
|
||||
# @return [String]
|
||||
describe 'test_query_style_form_explode_true_object_all_of test' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
26
samples/client/echo_api/ruby-faraday/spec/manual_spec.rb
Normal file
26
samples/client/echo_api/ruby-faraday/spec/manual_spec.rb
Normal file
@ -0,0 +1,26 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Body API tests" do
|
||||
describe 'the test_binary_gif method' do
|
||||
let(:body_api_instance) { OpenapiClient::BodyApi.new }
|
||||
|
||||
it 'can return file response' do
|
||||
gif_base64 = "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\n"
|
||||
response = body_api_instance.test_binary_gif()
|
||||
expect(Base64.encode64(File.read(response.path))).to eq(gif_base64)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::Bird
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::Bird do
|
||||
let(:instance) { OpenapiClient::Bird.new }
|
||||
|
||||
describe 'test an instance of Bird' do
|
||||
it 'should create an instance of Bird' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::Bird)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "size"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "color"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::Category
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::Category do
|
||||
let(:instance) { OpenapiClient::Category.new }
|
||||
|
||||
describe 'test an instance of Category' do
|
||||
it 'should create an instance of Category' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::Category)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "id"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,48 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::DataQuery
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::DataQuery do
|
||||
let(:instance) { OpenapiClient::DataQuery.new }
|
||||
|
||||
describe 'test an instance of DataQuery' do
|
||||
it 'should create an instance of DataQuery' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::DataQuery)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "suffix"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "text"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "date"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,82 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::DefaultValue
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::DefaultValue do
|
||||
let(:instance) { OpenapiClient::DefaultValue.new }
|
||||
|
||||
describe 'test an instance of DefaultValue' do
|
||||
it 'should create an instance of DefaultValue' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::DefaultValue)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string_enum_ref_default"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string_enum_default"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["success", "failure", "unclassified"])
|
||||
# validator.allowable_values.each do |value|
|
||||
# expect { instance.array_string_enum_default = value }.not_to raise_error
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string_default"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_integer_default"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string_nullable"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_string_extension_nullable"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "string_nullable"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,48 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::NumberPropertiesOnly
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::NumberPropertiesOnly do
|
||||
let(:instance) { OpenapiClient::NumberPropertiesOnly.new }
|
||||
|
||||
describe 'test an instance of NumberPropertiesOnly' do
|
||||
it 'should create an instance of NumberPropertiesOnly' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::NumberPropertiesOnly)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "number"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "float"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "double"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
70
samples/client/echo_api/ruby-faraday/spec/models/pet_spec.rb
Normal file
70
samples/client/echo_api/ruby-faraday/spec/models/pet_spec.rb
Normal file
@ -0,0 +1,70 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::Pet
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::Pet do
|
||||
let(:instance) { OpenapiClient::Pet.new }
|
||||
|
||||
describe 'test an instance of Pet' do
|
||||
it 'should create an instance of Pet' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::Pet)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "id"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "category"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "photo_urls"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "tags"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "status"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"])
|
||||
# validator.allowable_values.each do |value|
|
||||
# expect { instance.status = value }.not_to raise_error
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,46 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::Query
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::Query do
|
||||
let(:instance) { OpenapiClient::Query.new }
|
||||
|
||||
describe 'test an instance of Query' do
|
||||
it 'should create an instance of Query' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::Query)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "id"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "outcomes"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["SUCCESS", "FAILURE", "SKIPPED"])
|
||||
# validator.allowable_values.each do |value|
|
||||
# expect { instance.outcomes = value }.not_to raise_error
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,30 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::StringEnumRef
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::StringEnumRef do
|
||||
let(:instance) { OpenapiClient::StringEnumRef.new }
|
||||
|
||||
describe 'test an instance of StringEnumRef' do
|
||||
it 'should create an instance of StringEnumRef' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::StringEnumRef)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
42
samples/client/echo_api/ruby-faraday/spec/models/tag_spec.rb
Normal file
42
samples/client/echo_api/ruby-faraday/spec/models/tag_spec.rb
Normal file
@ -0,0 +1,42 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::Tag
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::Tag do
|
||||
let(:instance) { OpenapiClient::Tag.new }
|
||||
|
||||
describe 'test an instance of Tag' do
|
||||
it 'should create an instance of Tag' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::Tag)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "id"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,54 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter do
|
||||
let(:instance) { OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.new }
|
||||
|
||||
describe 'test an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter' do
|
||||
it 'should create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "size"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "color"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "id"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "name"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,36 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
describe OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter do
|
||||
let(:instance) { OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.new }
|
||||
|
||||
describe 'test an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter' do
|
||||
it 'should create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter' do
|
||||
# uncomment below to test the instance creation
|
||||
#expect(instance).to be_instance_of(OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "values"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
||||
end
|
||||
end
|
||||
|
||||
end
|
111
samples/client/echo_api/ruby-faraday/spec/spec_helper.rb
Normal file
111
samples/client/echo_api/ruby-faraday/spec/spec_helper.rb
Normal file
@ -0,0 +1,111 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
# load the gem
|
||||
require 'openapi_client'
|
||||
|
||||
# The following was generated by the `rspec --init` command. Conventionally, all
|
||||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
||||
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
||||
# this file to always be loaded, without a need to explicitly require it in any
|
||||
# files.
|
||||
#
|
||||
# Given that it is always loaded, you are encouraged to keep this file as
|
||||
# light-weight as possible. Requiring heavyweight dependencies from this file
|
||||
# will add to the boot time of your test suite on EVERY test run, even for an
|
||||
# individual file that may not need all of that loaded. Instead, consider making
|
||||
# a separate helper file that requires the additional dependencies and performs
|
||||
# the additional setup, and require it from the spec files that actually need
|
||||
# it.
|
||||
#
|
||||
# The `.rspec` file also contains a few flags that are not defaults but that
|
||||
# users commonly want.
|
||||
#
|
||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
RSpec.configure do |config|
|
||||
# rspec-expectations config goes here. You can use an alternate
|
||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
||||
# assertions if you prefer.
|
||||
config.expect_with :rspec do |expectations|
|
||||
# This option will default to `true` in RSpec 4. It makes the `description`
|
||||
# and `failure_message` of custom matchers include text for helper methods
|
||||
# defined using `chain`, e.g.:
|
||||
# be_bigger_than(2).and_smaller_than(4).description
|
||||
# # => "be bigger than 2 and smaller than 4"
|
||||
# ...rather than:
|
||||
# # => "be bigger than 2"
|
||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||
end
|
||||
|
||||
# rspec-mocks config goes here. You can use an alternate test double
|
||||
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
||||
config.mock_with :rspec do |mocks|
|
||||
# Prevents you from mocking or stubbing a method that does not exist on
|
||||
# a real object. This is generally recommended, and will default to
|
||||
# `true` in RSpec 4.
|
||||
mocks.verify_partial_doubles = true
|
||||
end
|
||||
|
||||
# The settings below are suggested to provide a good initial experience
|
||||
# with RSpec, but feel free to customize to your heart's content.
|
||||
=begin
|
||||
# These two settings work together to allow you to limit a spec run
|
||||
# to individual examples or groups you care about by tagging them with
|
||||
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
||||
# get run.
|
||||
config.filter_run :focus
|
||||
config.run_all_when_everything_filtered = true
|
||||
|
||||
# Allows RSpec to persist some state between runs in order to support
|
||||
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
||||
# you configure your source control system to ignore this file.
|
||||
config.example_status_persistence_file_path = "spec/examples.txt"
|
||||
|
||||
# Limits the available syntax to the non-monkey patched syntax that is
|
||||
# recommended. For more details, see:
|
||||
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
||||
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
||||
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
||||
config.disable_monkey_patching!
|
||||
|
||||
# This setting enables warnings. It's recommended, but in some cases may
|
||||
# be too noisy due to issues in dependencies.
|
||||
config.warnings = true
|
||||
|
||||
# Many RSpec users commonly either run the entire suite or an individual
|
||||
# file, and it's useful to allow more verbose output when running an
|
||||
# individual spec file.
|
||||
if config.files_to_run.one?
|
||||
# Use the documentation formatter for detailed output,
|
||||
# unless a formatter has already been configured
|
||||
# (e.g. via a command-line flag).
|
||||
config.default_formatter = 'doc'
|
||||
end
|
||||
|
||||
# Print the 10 slowest examples and example groups at the
|
||||
# end of the spec run, to help surface which specs are running
|
||||
# particularly slow.
|
||||
config.profile_examples = 10
|
||||
|
||||
# Run specs in random order to surface order dependencies. If you find an
|
||||
# order dependency and want to debug it, you can fix the order by providing
|
||||
# the seed, which is printed after each run.
|
||||
# --seed 1234
|
||||
config.order = :random
|
||||
|
||||
# Seed global randomization in this process using the `--seed` CLI option.
|
||||
# Setting this allows you to use `--seed` to deterministically reproduce
|
||||
# test failures related to randomization by passing the same `--seed` value
|
||||
# as the one that triggered the failure.
|
||||
Kernel.srand config.seed
|
||||
=end
|
||||
end
|
@ -21,3 +21,5 @@
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
spec/api_client_spec.rb
|
||||
spec/configuration_spec.rb
|
||||
|
@ -47,6 +47,4 @@ lib/openapi_client/models/test_query_style_deep_object_explode_true_object_all_o
|
||||
lib/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.rb
|
||||
lib/openapi_client/version.rb
|
||||
openapi_client.gemspec
|
||||
spec/api_client_spec.rb
|
||||
spec/configuration_spec.rb
|
||||
spec/spec_helper.rb
|
||||
|
@ -1,190 +0,0 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe OpenapiClient::ApiClient do
|
||||
context 'initialization' do
|
||||
context 'URL stuff' do
|
||||
context 'host' do
|
||||
it 'removes http from host' do
|
||||
OpenapiClient.configure { |c| c.host = 'http://example.com' }
|
||||
expect(OpenapiClient::Configuration.default.host).to eq('example.com')
|
||||
end
|
||||
|
||||
it 'removes https from host' do
|
||||
OpenapiClient.configure { |c| c.host = 'https://wookiee.com' }
|
||||
expect(OpenapiClient::ApiClient.default.config.host).to eq('wookiee.com')
|
||||
end
|
||||
|
||||
it 'removes trailing path from host' do
|
||||
OpenapiClient.configure { |c| c.host = 'hobo.com/v4' }
|
||||
expect(OpenapiClient::Configuration.default.host).to eq('hobo.com')
|
||||
end
|
||||
end
|
||||
|
||||
context 'base_path' do
|
||||
it "prepends a slash to base_path" do
|
||||
OpenapiClient.configure { |c| c.base_path = 'v4/dog' }
|
||||
expect(OpenapiClient::Configuration.default.base_path).to eq('/v4/dog')
|
||||
end
|
||||
|
||||
it "doesn't prepend a slash if one is already there" do
|
||||
OpenapiClient.configure { |c| c.base_path = '/v4/dog' }
|
||||
expect(OpenapiClient::Configuration.default.base_path).to eq('/v4/dog')
|
||||
end
|
||||
|
||||
it "ends up as a blank string if nil" do
|
||||
OpenapiClient.configure { |c| c.base_path = nil }
|
||||
expect(OpenapiClient::Configuration.default.base_path).to eq('')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
describe '#deserialize' do
|
||||
it "handles Array<Integer>" do
|
||||
api_client = OpenapiClient::ApiClient.new
|
||||
headers = { 'Content-Type' => 'application/json' }
|
||||
response = double('response', headers: headers, body: '[12, 34]')
|
||||
data = api_client.deserialize(response, 'Array<Integer>')
|
||||
expect(data).to be_instance_of(Array)
|
||||
expect(data).to eq([12, 34])
|
||||
end
|
||||
|
||||
it 'handles Array<Array<Integer>>' do
|
||||
api_client = OpenapiClient::ApiClient.new
|
||||
headers = { 'Content-Type' => 'application/json' }
|
||||
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
||||
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
||||
expect(data).to be_instance_of(Array)
|
||||
expect(data).to eq([[12, 34], [56]])
|
||||
end
|
||||
|
||||
it 'handles Hash<String, String>' do
|
||||
api_client = OpenapiClient::ApiClient.new
|
||||
headers = { 'Content-Type' => 'application/json' }
|
||||
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
||||
data = api_client.deserialize(response, 'Hash<String, String>')
|
||||
expect(data).to be_instance_of(Hash)
|
||||
expect(data).to eq(:message => 'Hello')
|
||||
end
|
||||
end
|
||||
|
||||
describe "#object_to_hash" do
|
||||
it 'ignores nils and includes empty arrays' do
|
||||
# uncomment below to test object_to_hash for model
|
||||
# api_client = OpenapiClient::ApiClient.new
|
||||
# _model = OpenapiClient::ModelName.new
|
||||
# update the model attribute below
|
||||
# _model.id = 1
|
||||
# update the expected value (hash) below
|
||||
# expected = {id: 1, name: '', tags: []}
|
||||
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#build_collection_param' do
|
||||
let(:param) { ['aa', 'bb', 'cc'] }
|
||||
let(:api_client) { OpenapiClient::ApiClient.new }
|
||||
|
||||
it 'works for csv' do
|
||||
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
||||
end
|
||||
|
||||
it 'works for ssv' do
|
||||
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
||||
end
|
||||
|
||||
it 'works for tsv' do
|
||||
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
||||
end
|
||||
|
||||
it 'works for pipes' do
|
||||
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
||||
end
|
||||
|
||||
it 'works for multi' do
|
||||
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
||||
end
|
||||
|
||||
it 'fails for invalid collection format' do
|
||||
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#json_mime?' do
|
||||
let(:api_client) { OpenapiClient::ApiClient.new }
|
||||
|
||||
it 'works' do
|
||||
expect(api_client.json_mime?(nil)).to eq false
|
||||
expect(api_client.json_mime?('')).to eq false
|
||||
|
||||
expect(api_client.json_mime?('application/json')).to eq true
|
||||
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
||||
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
||||
|
||||
expect(api_client.json_mime?('application/xml')).to eq false
|
||||
expect(api_client.json_mime?('text/plain')).to eq false
|
||||
expect(api_client.json_mime?('application/jsonp')).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
describe '#select_header_accept' do
|
||||
let(:api_client) { OpenapiClient::ApiClient.new }
|
||||
|
||||
it 'works' do
|
||||
expect(api_client.select_header_accept(nil)).to be_nil
|
||||
expect(api_client.select_header_accept([])).to be_nil
|
||||
|
||||
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
||||
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
||||
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
||||
|
||||
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
||||
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#select_header_content_type' do
|
||||
let(:api_client) { OpenapiClient::ApiClient.new }
|
||||
|
||||
it 'works' do
|
||||
expect(api_client.select_header_content_type(nil)).to be_nil
|
||||
expect(api_client.select_header_content_type([])).to be_nil
|
||||
|
||||
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
||||
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
||||
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
||||
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
||||
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#sanitize_filename' do
|
||||
let(:api_client) { OpenapiClient::ApiClient.new }
|
||||
|
||||
it 'works' do
|
||||
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
||||
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
||||
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,75 +0,0 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe OpenapiClient::Configuration do
|
||||
let(:config) { OpenapiClient::Configuration.default }
|
||||
|
||||
before(:each) do
|
||||
# uncomment below to setup host and base_path
|
||||
# require 'URI'
|
||||
# uri = URI.parse("http://localhost:3000")
|
||||
# OpenapiClient.configure do |c|
|
||||
# c.host = uri.host
|
||||
# c.base_path = uri.path
|
||||
# end
|
||||
end
|
||||
|
||||
describe '#base_url' do
|
||||
it 'should have the default value' do
|
||||
# uncomment below to test default value of the base path
|
||||
# expect(config.base_url).to eq("http://localhost:3000")
|
||||
end
|
||||
|
||||
it 'should remove trailing slashes' do
|
||||
[nil, '', '/', '//'].each do |base_path|
|
||||
config.base_path = base_path
|
||||
# uncomment below to test trailing slashes
|
||||
# expect(config.base_url).to eq("http://localhost:3000")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#configure' do
|
||||
let(:session) { HTTPX::Session.new }
|
||||
|
||||
before do
|
||||
module CustomPlugin
|
||||
module InstanceMethods; end
|
||||
end
|
||||
module AnotherCustomPlugin
|
||||
module InstanceMethods; end
|
||||
end
|
||||
|
||||
config.configure_session do |session|
|
||||
session.plugin(CustomPlugin)
|
||||
end
|
||||
end
|
||||
|
||||
it 'adds a block that will be used to configure the connection' do
|
||||
sess = config.configure(session)
|
||||
|
||||
expect(sess.class.ancestors).to include(CustomPlugin::InstanceMethods)
|
||||
end
|
||||
|
||||
it 'supports multiple configuration blocks' do
|
||||
config.configure_session do |session|
|
||||
session.plugin(AnotherCustomPlugin)
|
||||
end
|
||||
sess = config.configure(session)
|
||||
|
||||
expect(sess.class.ancestors).to include(CustomPlugin::InstanceMethods)
|
||||
expect(sess.class.ancestors).to include(AnotherCustomPlugin::InstanceMethods)
|
||||
end
|
||||
end
|
||||
end
|
27
samples/client/echo_api/ruby-httpx/spec/manual_spec.rb
Normal file
27
samples/client/echo_api/ruby-httpx/spec/manual_spec.rb
Normal file
@ -0,0 +1,27 @@
|
||||
=begin
|
||||
#Echo Server API
|
||||
|
||||
#Echo Server API
|
||||
|
||||
The version of the OpenAPI document: 0.1.0
|
||||
Contact: team@openapitools.org
|
||||
Generated by: https://openapi-generator.tech
|
||||
OpenAPI Generator version: 7.2.0-SNAPSHOT
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'base64'
|
||||
|
||||
describe "Body API tests" do
|
||||
describe 'the test_binary_gif method' do
|
||||
let(:body_api_instance) { OpenapiClient::BodyApi.new }
|
||||
|
||||
it 'can return file response' do
|
||||
gif_base64 = "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\n"
|
||||
response = body_api_instance.test_binary_gif()
|
||||
expect(Base64.encode64(File.read(response.path))).to eq(gif_base64)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
39
samples/client/echo_api/ruby-typhoeus/.gitignore
vendored
Normal file
39
samples/client/echo_api/ruby-typhoeus/.gitignore
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# Generated by: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
*.gem
|
||||
*.rbc
|
||||
/.config
|
||||
/coverage/
|
||||
/InstalledFiles
|
||||
/pkg/
|
||||
/spec/reports/
|
||||
/spec/examples.txt
|
||||
/test/tmp/
|
||||
/test/version_tmp/
|
||||
/tmp/
|
||||
|
||||
## Specific to RubyMotion:
|
||||
.dat*
|
||||
.repl_history
|
||||
build/
|
||||
|
||||
## Documentation cache and generated files:
|
||||
/.yardoc/
|
||||
/_yardoc/
|
||||
/doc/
|
||||
/rdoc/
|
||||
|
||||
## Environment normalization:
|
||||
/.bundle/
|
||||
/vendor/bundle
|
||||
/lib/bundler/man/
|
||||
|
||||
# for a library or gem, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# Gemfile.lock
|
||||
# .ruby-version
|
||||
# .ruby-gemset
|
||||
|
||||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
||||
.rvmrc
|
26
samples/client/echo_api/ruby-typhoeus/.gitlab-ci.yml
Normal file
26
samples/client/echo_api/ruby-typhoeus/.gitlab-ci.yml
Normal file
@ -0,0 +1,26 @@
|
||||
.ruby: &ruby
|
||||
variables:
|
||||
LANG: "C.UTF-8"
|
||||
before_script:
|
||||
- ruby -v
|
||||
- bundle config set --local deployment true
|
||||
- bundle install -j $(nproc)
|
||||
parallel:
|
||||
matrix:
|
||||
- RUBY_VERSION: ['2.7', '3.0', '3.1']
|
||||
image: "ruby:$RUBY_VERSION"
|
||||
cache:
|
||||
paths:
|
||||
- vendor/ruby
|
||||
key: 'ruby-$RUBY_VERSION'
|
||||
|
||||
gem:
|
||||
extends: .ruby
|
||||
script:
|
||||
- bundle exec rspec
|
||||
- bundle exec rake build
|
||||
- bundle exec rake install
|
||||
artifacts:
|
||||
paths:
|
||||
- pkg/*.gem
|
||||
|
@ -0,0 +1,25 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
spec/api_client_spec.rb
|
||||
spec/configuration_spec.rb
|
@ -0,0 +1,50 @@
|
||||
.gitignore
|
||||
.gitlab-ci.yml
|
||||
.rspec
|
||||
.rubocop.yml
|
||||
.travis.yml
|
||||
Gemfile
|
||||
README.md
|
||||
Rakefile
|
||||
docs/AuthApi.md
|
||||
docs/Bird.md
|
||||
docs/BodyApi.md
|
||||
docs/Category.md
|
||||
docs/DataQuery.md
|
||||
docs/DefaultValue.md
|
||||
docs/FormApi.md
|
||||
docs/HeaderApi.md
|
||||
docs/NumberPropertiesOnly.md
|
||||
docs/PathApi.md
|
||||
docs/Pet.md
|
||||
docs/Query.md
|
||||
docs/QueryApi.md
|
||||
docs/StringEnumRef.md
|
||||
docs/Tag.md
|
||||
docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
|
||||
git_push.sh
|
||||
lib/openapi_client.rb
|
||||
lib/openapi_client/api/auth_api.rb
|
||||
lib/openapi_client/api/body_api.rb
|
||||
lib/openapi_client/api/form_api.rb
|
||||
lib/openapi_client/api/header_api.rb
|
||||
lib/openapi_client/api/path_api.rb
|
||||
lib/openapi_client/api/query_api.rb
|
||||
lib/openapi_client/api_client.rb
|
||||
lib/openapi_client/api_error.rb
|
||||
lib/openapi_client/configuration.rb
|
||||
lib/openapi_client/models/bird.rb
|
||||
lib/openapi_client/models/category.rb
|
||||
lib/openapi_client/models/data_query.rb
|
||||
lib/openapi_client/models/default_value.rb
|
||||
lib/openapi_client/models/number_properties_only.rb
|
||||
lib/openapi_client/models/pet.rb
|
||||
lib/openapi_client/models/query.rb
|
||||
lib/openapi_client/models/string_enum_ref.rb
|
||||
lib/openapi_client/models/tag.rb
|
||||
lib/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.rb
|
||||
lib/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.rb
|
||||
lib/openapi_client/version.rb
|
||||
openapi_client.gemspec
|
||||
spec/spec_helper.rb
|
@ -0,0 +1 @@
|
||||
7.2.0-SNAPSHOT
|
2
samples/client/echo_api/ruby-typhoeus/.rspec
Normal file
2
samples/client/echo_api/ruby-typhoeus/.rspec
Normal file
@ -0,0 +1,2 @@
|
||||
--color
|
||||
--require spec_helper
|
148
samples/client/echo_api/ruby-typhoeus/.rubocop.yml
Normal file
148
samples/client/echo_api/ruby-typhoeus/.rubocop.yml
Normal file
@ -0,0 +1,148 @@
|
||||
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
||||
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||
DisabledByDefault: true
|
||||
Exclude:
|
||||
- '**/templates/**/*'
|
||||
- '**/vendor/**/*'
|
||||
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||
|
||||
# Prefer &&/|| over and/or.
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
# Align `when` with `case`.
|
||||
Layout/CaseIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Align comments with method definitions.
|
||||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ElseAlignment:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLineAfterMagicComment:
|
||||
Enabled: true
|
||||
|
||||
# In a regular class definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundClassBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular method definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
Enabled: true
|
||||
|
||||
# In a regular module definition, no empty lines around the body.
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
|
||||
Layout/FirstArgumentIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||
Style/HashSyntax:
|
||||
Enabled: false
|
||||
|
||||
# Method definitions after `private` or `protected` isolated calls need one
|
||||
# extra level of indentation.
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: true
|
||||
EnforcedStyle: indented_internal_methods
|
||||
|
||||
# Two spaces, no tabs (for indentation).
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
Layout/LeadingCommentSpace:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundEqualsInParameterDefault:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundKeyword:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeFirstArg:
|
||||
Enabled: true
|
||||
|
||||
Style/DefWithParentheses:
|
||||
Enabled: true
|
||||
|
||||
# Defining a method with parameters needs parentheses.
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
EnforcedStyle: always
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo { bar }` not `foo {bar}`.
|
||||
Layout/SpaceInsideBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `{ a: 1 }` not `{a:1}`.
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceInsideParens:
|
||||
Enabled: true
|
||||
|
||||
# Check quotes usage according to lint rule below.
|
||||
#Style/StringLiterals:
|
||||
# Enabled: true
|
||||
# EnforcedStyle: single_quotes
|
||||
|
||||
# Detect hard tabs, no hard tabs.
|
||||
Layout/IndentationStyle:
|
||||
Enabled: true
|
||||
|
||||
# Blank lines should not have any spaces.
|
||||
Layout/TrailingEmptyLines:
|
||||
Enabled: true
|
||||
|
||||
# No trailing whitespace.
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: false
|
||||
|
||||
# Use quotes for string literals when they are enough.
|
||||
Style/RedundantPercentQ:
|
||||
Enabled: true
|
||||
|
||||
# Align `end` with the matching keyword or starting expression except for
|
||||
# assignments, where it should be aligned with the LHS.
|
||||
Layout/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
AutoCorrect: true
|
||||
|
||||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||
Lint/RequireParentheses:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMultipleReturnValues: true
|
||||
|
||||
Style/Semicolon:
|
||||
Enabled: true
|
||||
AllowAsExpressionSeparator: true
|
11
samples/client/echo_api/ruby-typhoeus/.travis.yml
Normal file
11
samples/client/echo_api/ruby-typhoeus/.travis.yml
Normal file
@ -0,0 +1,11 @@
|
||||
language: ruby
|
||||
cache: bundler
|
||||
rvm:
|
||||
- 2.7
|
||||
- 3.0
|
||||
- 3.1
|
||||
script:
|
||||
- bundle install --path vendor/bundle
|
||||
- bundle exec rspec
|
||||
- gem build openapi_client.gemspec
|
||||
- gem install ./openapi_client-1.0.0.gem
|
9
samples/client/echo_api/ruby-typhoeus/Gemfile
Normal file
9
samples/client/echo_api/ruby-typhoeus/Gemfile
Normal file
@ -0,0 +1,9 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gemspec
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake', '~> 13.0.1'
|
||||
gem 'pry-byebug'
|
||||
gem 'rubocop', '~> 0.66.0'
|
||||
end
|
134
samples/client/echo_api/ruby-typhoeus/README.md
Normal file
134
samples/client/echo_api/ruby-typhoeus/README.md
Normal file
@ -0,0 +1,134 @@
|
||||
# openapi_client
|
||||
|
||||
OpenapiClient - the Ruby gem for the Echo Server API
|
||||
|
||||
Echo Server API
|
||||
|
||||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 0.1.0
|
||||
- Package version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
### Build a gem
|
||||
|
||||
To build the Ruby code into a gem:
|
||||
|
||||
```shell
|
||||
gem build openapi_client.gemspec
|
||||
```
|
||||
|
||||
Then either install the gem locally:
|
||||
|
||||
```shell
|
||||
gem install ./openapi_client-1.0.0.gem
|
||||
```
|
||||
|
||||
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
|
||||
|
||||
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
||||
|
||||
Finally add this to the Gemfile:
|
||||
|
||||
gem 'openapi_client', '~> 1.0.0'
|
||||
|
||||
### Install from Git
|
||||
|
||||
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
||||
|
||||
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
||||
|
||||
### Include the Ruby code directly
|
||||
|
||||
Include the Ruby code directly using `-I` as follows:
|
||||
|
||||
```shell
|
||||
ruby -Ilib script.rb
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) procedure and then run the following code:
|
||||
|
||||
```ruby
|
||||
# Load the gem
|
||||
require 'openapi_client'
|
||||
|
||||
# Setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure HTTP basic authorization: http_auth
|
||||
config.username = 'YOUR_USERNAME'
|
||||
config.password = 'YOUR_PASSWORD'
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
#To test HTTP basic authentication
|
||||
result = api_instance.test_auth_http_basic
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Exception when calling AuthApi->test_auth_http_basic: #{e}"
|
||||
end
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*OpenapiClient::AuthApi* | [**test_auth_http_basic**](docs/AuthApi.md#test_auth_http_basic) | **POST** /auth/http/basic | To test HTTP basic authentication
|
||||
*OpenapiClient::AuthApi* | [**test_auth_http_bearer**](docs/AuthApi.md#test_auth_http_bearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication
|
||||
*OpenapiClient::BodyApi* | [**test_binary_gif**](docs/BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*OpenapiClient::BodyApi* | [**test_body_application_octetstream_binary**](docs/BodyApi.md#test_body_application_octetstream_binary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_body_multipart_formdata_array_of_binary**](docs/BodyApi.md#test_body_multipart_formdata_array_of_binary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_all_of_pet**](docs/BodyApi.md#test_echo_body_all_of_pet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_free_form_object_response_string**](docs/BodyApi.md#test_echo_body_free_form_object_response_string) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_pet**](docs/BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_pet_response_string**](docs/BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
*OpenapiClient::BodyApi* | [**test_echo_body_tag_response_string**](docs/BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
|
||||
*OpenapiClient::FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s)
|
||||
*OpenapiClient::FormApi* | [**test_form_oneof**](docs/FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
|
||||
*OpenapiClient::HeaderApi* | [**test_header_integer_boolean_string_enums**](docs/HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
|
||||
*OpenapiClient::PathApi* | [**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](docs/PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_enum_ref_string**](docs/QueryApi.md#test_enum_ref_string) | **GET** /query/enum_ref_string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_datetime_date_string**](docs/QueryApi.md#test_query_datetime_date_string) | **GET** /query/datetime/date/string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_integer_boolean_string**](docs/QueryApi.md#test_query_integer_boolean_string) | **GET** /query/integer/boolean/string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_deep_object_explode_true_object**](docs/QueryApi.md#test_query_style_deep_object_explode_true_object) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_deep_object_explode_true_object_all_of**](docs/QueryApi.md#test_query_style_deep_object_explode_true_object_all_of) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_array_string**](docs/QueryApi.md#test_query_style_form_explode_true_array_string) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object**](docs/QueryApi.md#test_query_style_form_explode_true_object) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*OpenapiClient::QueryApi* | [**test_query_style_form_explode_true_object_all_of**](docs/QueryApi.md#test_query_style_form_explode_true_object_all_of) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [OpenapiClient::Bird](docs/Bird.md)
|
||||
- [OpenapiClient::Category](docs/Category.md)
|
||||
- [OpenapiClient::DataQuery](docs/DataQuery.md)
|
||||
- [OpenapiClient::DefaultValue](docs/DefaultValue.md)
|
||||
- [OpenapiClient::NumberPropertiesOnly](docs/NumberPropertiesOnly.md)
|
||||
- [OpenapiClient::Pet](docs/Pet.md)
|
||||
- [OpenapiClient::Query](docs/Query.md)
|
||||
- [OpenapiClient::StringEnumRef](docs/StringEnumRef.md)
|
||||
- [OpenapiClient::Tag](docs/Tag.md)
|
||||
- [OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### http_auth
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### http_bearer_auth
|
||||
|
||||
- **Type**: Bearer authentication
|
||||
|
10
samples/client/echo_api/ruby-typhoeus/Rakefile
Normal file
10
samples/client/echo_api/ruby-typhoeus/Rakefile
Normal file
@ -0,0 +1,10 @@
|
||||
require "bundler/gem_tasks"
|
||||
|
||||
begin
|
||||
require 'rspec/core/rake_task'
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
task default: :spec
|
||||
rescue LoadError
|
||||
# no rspec available
|
||||
end
|
142
samples/client/echo_api/ruby-typhoeus/docs/AuthApi.md
Normal file
142
samples/client/echo_api/ruby-typhoeus/docs/AuthApi.md
Normal file
@ -0,0 +1,142 @@
|
||||
# OpenapiClient::AuthApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_auth_http_basic**](AuthApi.md#test_auth_http_basic) | **POST** /auth/http/basic | To test HTTP basic authentication |
|
||||
| [**test_auth_http_bearer**](AuthApi.md#test_auth_http_bearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication |
|
||||
|
||||
|
||||
## test_auth_http_basic
|
||||
|
||||
> String test_auth_http_basic
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
# setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure HTTP basic authorization: http_auth
|
||||
config.username = 'YOUR USERNAME'
|
||||
config.password = 'YOUR PASSWORD'
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
# To test HTTP basic authentication
|
||||
result = api_instance.test_auth_http_basic
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_basic: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_auth_http_basic_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_auth_http_basic_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# To test HTTP basic authentication
|
||||
data, status_code, headers = api_instance.test_auth_http_basic_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_basic_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_auth](../README.md#http_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_auth_http_bearer
|
||||
|
||||
> String test_auth_http_bearer
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
# setup authorization
|
||||
OpenapiClient.configure do |config|
|
||||
# Configure Bearer authorization: http_bearer_auth
|
||||
config.access_token = 'YOUR_BEARER_TOKEN'
|
||||
end
|
||||
|
||||
api_instance = OpenapiClient::AuthApi.new
|
||||
|
||||
begin
|
||||
# To test HTTP bearer authentication
|
||||
result = api_instance.test_auth_http_bearer
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_bearer: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_auth_http_bearer_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_auth_http_bearer_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# To test HTTP bearer authentication
|
||||
data, status_code, headers = api_instance.test_auth_http_bearer_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling AuthApi->test_auth_http_bearer_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_bearer_auth](../README.md#http_bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
20
samples/client/echo_api/ruby-typhoeus/docs/Bird.md
Normal file
20
samples/client/echo_api/ruby-typhoeus/docs/Bird.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Bird
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **size** | **String** | | [optional] |
|
||||
| **color** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Bird.new(
|
||||
size: null,
|
||||
color: null
|
||||
)
|
||||
```
|
||||
|
536
samples/client/echo_api/ruby-typhoeus/docs/BodyApi.md
Normal file
536
samples/client/echo_api/ruby-typhoeus/docs/BodyApi.md
Normal file
@ -0,0 +1,536 @@
|
||||
# OpenapiClient::BodyApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_binary_gif**](BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**test_body_application_octetstream_binary**](BodyApi.md#test_body_application_octetstream_binary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**test_body_multipart_formdata_array_of_binary**](BodyApi.md#test_body_multipart_formdata_array_of_binary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
|
||||
| [**test_echo_body_all_of_pet**](BodyApi.md#test_echo_body_all_of_pet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) |
|
||||
| [**test_echo_body_free_form_object_response_string**](BodyApi.md#test_echo_body_free_form_object_response_string) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**test_echo_body_pet**](BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**test_echo_body_pet_response_string**](BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
| [**test_echo_body_tag_response_string**](BodyApi.md#test_echo_body_tag_response_string) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
|
||||
|
||||
|
||||
## test_binary_gif
|
||||
|
||||
> File test_binary_gif
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
|
||||
begin
|
||||
# Test binary (gif) response body
|
||||
result = api_instance.test_binary_gif
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_binary_gif: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_binary_gif_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(File, Integer, Hash)> test_binary_gif_with_http_info
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test binary (gif) response body
|
||||
data, status_code, headers = api_instance.test_binary_gif_with_http_info
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => File
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_binary_gif_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**File**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: image/gif
|
||||
|
||||
|
||||
## test_body_application_octetstream_binary
|
||||
|
||||
> String test_body_application_octetstream_binary(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
body: File.new('/path/to/some/file') # File |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_body_application_octetstream_binary(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_application_octetstream_binary: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_body_application_octetstream_binary_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_body_application_octetstream_binary_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_body_application_octetstream_binary_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_application_octetstream_binary_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **body** | **File** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/octet-stream
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_body_multipart_formdata_array_of_binary
|
||||
|
||||
> String test_body_multipart_formdata_array_of_binary(files)
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
files = [File.new('/path/to/some/file')] # Array<File> |
|
||||
|
||||
begin
|
||||
# Test array of binary in multipart mime
|
||||
result = api_instance.test_body_multipart_formdata_array_of_binary(files)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_multipart_formdata_array_of_binary: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_body_multipart_formdata_array_of_binary_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_body_multipart_formdata_array_of_binary_with_http_info(files)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test array of binary in multipart mime
|
||||
data, status_code, headers = api_instance.test_body_multipart_formdata_array_of_binary_with_http_info(files)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_body_multipart_formdata_array_of_binary_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **files** | **Array<File>** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_all_of_pet
|
||||
|
||||
> <Pet> test_echo_body_all_of_pet(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_echo_body_all_of_pet(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_all_of_pet: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_all_of_pet_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(<Pet>, Integer, Hash)> test_echo_body_all_of_pet_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_echo_body_all_of_pet_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => <Pet>
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_all_of_pet_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## test_echo_body_free_form_object_response_string
|
||||
|
||||
> String test_echo_body_free_form_object_response_string(opts)
|
||||
|
||||
Test free form object
|
||||
|
||||
Test free form object
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
body: { ... } # Object | Free form object
|
||||
}
|
||||
|
||||
begin
|
||||
# Test free form object
|
||||
result = api_instance.test_echo_body_free_form_object_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_free_form_object_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_free_form_object_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_free_form_object_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test free form object
|
||||
data, status_code, headers = api_instance.test_echo_body_free_form_object_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_free_form_object_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **body** | **Object** | Free form object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_pet
|
||||
|
||||
> <Pet> test_echo_body_pet(opts)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
result = api_instance.test_echo_body_pet(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_pet_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(<Pet>, Integer, Hash)> test_echo_body_pet_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test body parameter(s)
|
||||
data, status_code, headers = api_instance.test_echo_body_pet_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => <Pet>
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## test_echo_body_pet_response_string
|
||||
|
||||
> String test_echo_body_pet_response_string(opts)
|
||||
|
||||
Test empty response body
|
||||
|
||||
Test empty response body
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
pet: OpenapiClient::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
|
||||
}
|
||||
|
||||
begin
|
||||
# Test empty response body
|
||||
result = api_instance.test_echo_body_pet_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_pet_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_pet_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test empty response body
|
||||
data, status_code, headers = api_instance.test_echo_body_pet_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_pet_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_echo_body_tag_response_string
|
||||
|
||||
> String test_echo_body_tag_response_string(opts)
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::BodyApi.new
|
||||
opts = {
|
||||
tag: OpenapiClient::Tag.new # Tag | Tag object
|
||||
}
|
||||
|
||||
begin
|
||||
# Test empty json (request body)
|
||||
result = api_instance.test_echo_body_tag_response_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_tag_response_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_echo_body_tag_response_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_echo_body_tag_response_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test empty json (request body)
|
||||
data, status_code, headers = api_instance.test_echo_body_tag_response_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling BodyApi->test_echo_body_tag_response_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **tag** | [**Tag**](Tag.md) | Tag object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: text/plain
|
||||
|
20
samples/client/echo_api/ruby-typhoeus/docs/Category.md
Normal file
20
samples/client/echo_api/ruby-typhoeus/docs/Category.md
Normal file
@ -0,0 +1,20 @@
|
||||
# OpenapiClient::Category
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::Category.new(
|
||||
id: 1,
|
||||
name: Dogs
|
||||
)
|
||||
```
|
||||
|
22
samples/client/echo_api/ruby-typhoeus/docs/DataQuery.md
Normal file
22
samples/client/echo_api/ruby-typhoeus/docs/DataQuery.md
Normal file
@ -0,0 +1,22 @@
|
||||
# OpenapiClient::DataQuery
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **suffix** | **String** | test suffix | [optional] |
|
||||
| **text** | **String** | Some text containing white spaces | [optional] |
|
||||
| **date** | **Time** | A date | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::DataQuery.new(
|
||||
suffix: null,
|
||||
text: Some text,
|
||||
date: null
|
||||
)
|
||||
```
|
||||
|
32
samples/client/echo_api/ruby-typhoeus/docs/DefaultValue.md
Normal file
32
samples/client/echo_api/ruby-typhoeus/docs/DefaultValue.md
Normal file
@ -0,0 +1,32 @@
|
||||
# OpenapiClient::DefaultValue
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **array_string_enum_ref_default** | [**Array<StringEnumRef>**](StringEnumRef.md) | | [optional] |
|
||||
| **array_string_enum_default** | **Array<String>** | | [optional] |
|
||||
| **array_string_default** | **Array<String>** | | [optional] |
|
||||
| **array_integer_default** | **Array<Integer>** | | [optional] |
|
||||
| **array_string** | **Array<String>** | | [optional] |
|
||||
| **array_string_nullable** | **Array<String>** | | [optional] |
|
||||
| **array_string_extension_nullable** | **Array<String>** | | [optional] |
|
||||
| **string_nullable** | **String** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::DefaultValue.new(
|
||||
array_string_enum_ref_default: null,
|
||||
array_string_enum_default: null,
|
||||
array_string_default: null,
|
||||
array_integer_default: null,
|
||||
array_string: null,
|
||||
array_string_nullable: null,
|
||||
array_string_extension_nullable: null,
|
||||
string_nullable: null
|
||||
)
|
||||
```
|
||||
|
155
samples/client/echo_api/ruby-typhoeus/docs/FormApi.md
Normal file
155
samples/client/echo_api/ruby-typhoeus/docs/FormApi.md
Normal file
@ -0,0 +1,155 @@
|
||||
# OpenapiClient::FormApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_form_integer_boolean_string**](FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s) |
|
||||
| [**test_form_oneof**](FormApi.md#test_form_oneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
|
||||
|
||||
|
||||
## test_form_integer_boolean_string
|
||||
|
||||
> String test_form_integer_boolean_string(opts)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::FormApi.new
|
||||
opts = {
|
||||
integer_form: 56, # Integer |
|
||||
boolean_form: true, # Boolean |
|
||||
string_form: 'string_form_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test form parameter(s)
|
||||
result = api_instance.test_form_integer_boolean_string(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_integer_boolean_string: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_form_integer_boolean_string_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_form_integer_boolean_string_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test form parameter(s)
|
||||
data, status_code, headers = api_instance.test_form_integer_boolean_string_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_integer_boolean_string_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **integer_form** | **Integer** | | [optional] |
|
||||
| **boolean_form** | **Boolean** | | [optional] |
|
||||
| **string_form** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: text/plain
|
||||
|
||||
|
||||
## test_form_oneof
|
||||
|
||||
> String test_form_oneof(opts)
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::FormApi.new
|
||||
opts = {
|
||||
form1: 'form1_example', # String |
|
||||
form2: 56, # Integer |
|
||||
form3: 'form3_example', # String |
|
||||
form4: true, # Boolean |
|
||||
id: 789, # Integer |
|
||||
name: 'name_example' # String |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test form parameter(s) for oneOf schema
|
||||
result = api_instance.test_form_oneof(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_oneof: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_form_oneof_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_form_oneof_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test form parameter(s) for oneOf schema
|
||||
data, status_code, headers = api_instance.test_form_oneof_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling FormApi->test_form_oneof_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **form1** | **String** | | [optional] |
|
||||
| **form2** | **Integer** | | [optional] |
|
||||
| **form3** | **String** | | [optional] |
|
||||
| **form4** | **Boolean** | | [optional] |
|
||||
| **id** | **Integer** | | [optional] |
|
||||
| **name** | **String** | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: text/plain
|
||||
|
82
samples/client/echo_api/ruby-typhoeus/docs/HeaderApi.md
Normal file
82
samples/client/echo_api/ruby-typhoeus/docs/HeaderApi.md
Normal file
@ -0,0 +1,82 @@
|
||||
# OpenapiClient::HeaderApi
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------ | ------------ | ----------- |
|
||||
| [**test_header_integer_boolean_string_enums**](HeaderApi.md#test_header_integer_boolean_string_enums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) |
|
||||
|
||||
|
||||
## test_header_integer_boolean_string_enums
|
||||
|
||||
> String test_header_integer_boolean_string_enums(opts)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
### Examples
|
||||
|
||||
```ruby
|
||||
require 'time'
|
||||
require 'openapi_client'
|
||||
|
||||
api_instance = OpenapiClient::HeaderApi.new
|
||||
opts = {
|
||||
integer_header: 56, # Integer |
|
||||
boolean_header: true, # Boolean |
|
||||
string_header: 'string_header_example', # String |
|
||||
enum_nonref_string_header: 'success', # String |
|
||||
enum_ref_string_header: OpenapiClient::StringEnumRef::SUCCESS # StringEnumRef |
|
||||
}
|
||||
|
||||
begin
|
||||
# Test header parameter(s)
|
||||
result = api_instance.test_header_integer_boolean_string_enums(opts)
|
||||
p result
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling HeaderApi->test_header_integer_boolean_string_enums: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
#### Using the test_header_integer_boolean_string_enums_with_http_info variant
|
||||
|
||||
This returns an Array which contains the response data, status code and headers.
|
||||
|
||||
> <Array(String, Integer, Hash)> test_header_integer_boolean_string_enums_with_http_info(opts)
|
||||
|
||||
```ruby
|
||||
begin
|
||||
# Test header parameter(s)
|
||||
data, status_code, headers = api_instance.test_header_integer_boolean_string_enums_with_http_info(opts)
|
||||
p status_code # => 2xx
|
||||
p headers # => { ... }
|
||||
p data # => String
|
||||
rescue OpenapiClient::ApiError => e
|
||||
puts "Error when calling HeaderApi->test_header_integer_boolean_string_enums_with_http_info: #{e}"
|
||||
end
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **integer_header** | **Integer** | | [optional] |
|
||||
| **boolean_header** | **Boolean** | | [optional] |
|
||||
| **string_header** | **String** | | [optional] |
|
||||
| **enum_nonref_string_header** | **String** | | [optional] |
|
||||
| **enum_ref_string_header** | [**StringEnumRef**](.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
@ -0,0 +1,22 @@
|
||||
# OpenapiClient::NumberPropertiesOnly
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ---- | ---- | ----------- | ----- |
|
||||
| **number** | **Float** | | [optional] |
|
||||
| **float** | **Float** | | [optional] |
|
||||
| **double** | **Float** | | [optional] |
|
||||
|
||||
## Example
|
||||
|
||||
```ruby
|
||||
require 'openapi_client'
|
||||
|
||||
instance = OpenapiClient::NumberPropertiesOnly.new(
|
||||
number: null,
|
||||
float: null,
|
||||
double: null
|
||||
)
|
||||
```
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user