ory-oathkeeper-client 0.35.5.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +103 -0
- data/Rakefile +10 -0
- data/docs/ApiApi.md +195 -0
- data/docs/CreateRuleCreated.md +17 -0
- data/docs/CreateRuleForbidden.md +17 -0
- data/docs/CreateRuleForbiddenBody.md +27 -0
- data/docs/CreateRuleInternalServerError.md +17 -0
- data/docs/CreateRuleInternalServerErrorBody.md +27 -0
- data/docs/CreateRuleUnauthorized.md +17 -0
- data/docs/CreateRuleUnauthorizedBody.md +27 -0
- data/docs/DecisionsForbidden.md +17 -0
- data/docs/DecisionsForbiddenBody.md +27 -0
- data/docs/DecisionsInternalServerError.md +17 -0
- data/docs/DecisionsInternalServerErrorBody.md +27 -0
- data/docs/DecisionsNotFound.md +17 -0
- data/docs/DecisionsNotFoundBody.md +27 -0
- data/docs/DecisionsUnauthorized.md +17 -0
- data/docs/DecisionsUnauthorizedBody.md +27 -0
- data/docs/DeleteRuleForbidden.md +17 -0
- data/docs/DeleteRuleForbiddenBody.md +27 -0
- data/docs/DeleteRuleInternalServerError.md +17 -0
- data/docs/DeleteRuleInternalServerErrorBody.md +27 -0
- data/docs/DeleteRuleNotFound.md +17 -0
- data/docs/DeleteRuleNotFoundBody.md +27 -0
- data/docs/DeleteRuleUnauthorized.md +17 -0
- data/docs/DeleteRuleUnauthorizedBody.md +27 -0
- data/docs/GetRuleForbidden.md +17 -0
- data/docs/GetRuleForbiddenBody.md +27 -0
- data/docs/GetRuleInternalServerError.md +17 -0
- data/docs/GetRuleInternalServerErrorBody.md +27 -0
- data/docs/GetRuleNotFound.md +17 -0
- data/docs/GetRuleNotFoundBody.md +27 -0
- data/docs/GetRuleOK.md +17 -0
- data/docs/GetRuleUnauthorized.md +17 -0
- data/docs/GetRuleUnauthorizedBody.md +27 -0
- data/docs/GetWellKnownForbidden.md +17 -0
- data/docs/GetWellKnownForbiddenBody.md +27 -0
- data/docs/GetWellKnownJSONWebKeysInternalServerError.md +17 -0
- data/docs/GetWellKnownJSONWebKeysInternalServerErrorBody.md +27 -0
- data/docs/GetWellKnownJSONWebKeysOK.md +17 -0
- data/docs/GetWellKnownOK.md +17 -0
- data/docs/GetWellKnownUnauthorized.md +17 -0
- data/docs/GetWellKnownUnauthorizedBody.md +27 -0
- data/docs/HealthApi.md +96 -0
- data/docs/HealthNotReadyStatus.md +17 -0
- data/docs/HealthStatus.md +17 -0
- data/docs/InlineResponse500.md +27 -0
- data/docs/IsInstanceAliveInternalServerError.md +17 -0
- data/docs/IsInstanceAliveInternalServerErrorBody.md +27 -0
- data/docs/IsInstanceAliveOK.md +17 -0
- data/docs/JsonWebKey.md +49 -0
- data/docs/JsonWebKeySet.md +17 -0
- data/docs/JudgeForbidden.md +17 -0
- data/docs/JudgeForbiddenBody.md +27 -0
- data/docs/JudgeInternalServerError.md +17 -0
- data/docs/JudgeInternalServerErrorBody.md +27 -0
- data/docs/JudgeNotFound.md +17 -0
- data/docs/JudgeNotFoundBody.md +27 -0
- data/docs/JudgeUnauthorized.md +17 -0
- data/docs/JudgeUnauthorizedBody.md +27 -0
- data/docs/ListRulesForbidden.md +17 -0
- data/docs/ListRulesForbiddenBody.md +27 -0
- data/docs/ListRulesInternalServerError.md +17 -0
- data/docs/ListRulesInternalServerErrorBody.md +27 -0
- data/docs/ListRulesOK.md +17 -0
- data/docs/ListRulesUnauthorized.md +17 -0
- data/docs/ListRulesUnauthorizedBody.md +27 -0
- data/docs/Rule.md +29 -0
- data/docs/RuleHandler.md +19 -0
- data/docs/RuleMatch.md +19 -0
- data/docs/SwaggerCreateRuleParameters.md +17 -0
- data/docs/SwaggerGetRuleParameters.md +17 -0
- data/docs/SwaggerHealthStatus.md +17 -0
- data/docs/SwaggerJSONWebKey.md +49 -0
- data/docs/SwaggerJSONWebKeySet.md +17 -0
- data/docs/SwaggerListRulesParameters.md +19 -0
- data/docs/SwaggerNotReadyStatus.md +17 -0
- data/docs/SwaggerRule.md +29 -0
- data/docs/SwaggerRuleHandler.md +19 -0
- data/docs/SwaggerRuleMatch.md +19 -0
- data/docs/SwaggerRuleResponse.md +17 -0
- data/docs/SwaggerRulesResponse.md +17 -0
- data/docs/SwaggerUpdateRuleParameters.md +19 -0
- data/docs/SwaggerVersion.md +17 -0
- data/docs/UpdateRuleForbidden.md +17 -0
- data/docs/UpdateRuleForbiddenBody.md +27 -0
- data/docs/UpdateRuleInternalServerError.md +17 -0
- data/docs/UpdateRuleInternalServerErrorBody.md +27 -0
- data/docs/UpdateRuleNotFound.md +17 -0
- data/docs/UpdateRuleNotFoundBody.md +27 -0
- data/docs/UpdateRuleOK.md +17 -0
- data/docs/UpdateRuleUnauthorized.md +17 -0
- data/docs/UpdateRuleUnauthorizedBody.md +27 -0
- data/docs/Upstream.md +21 -0
- data/docs/Version.md +17 -0
- data/docs/VersionApi.md +52 -0
- data/lib/ory-oathkeeper-client.rb +52 -0
- data/lib/ory-oathkeeper-client/api/api_api.rb +258 -0
- data/lib/ory-oathkeeper-client/api/health_api.rb +134 -0
- data/lib/ory-oathkeeper-client/api/version_api.rb +78 -0
- data/lib/ory-oathkeeper-client/api_client.rb +385 -0
- data/lib/ory-oathkeeper-client/api_error.rb +57 -0
- data/lib/ory-oathkeeper-client/configuration.rb +241 -0
- data/lib/ory-oathkeeper-client/models/create_rule_created.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/create_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/create_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/decisions_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/decisions_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/delete_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_rule_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_json_web_keys_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/get_well_known_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/health_not_ready_status.rb +209 -0
- data/lib/ory-oathkeeper-client/models/health_status.rb +207 -0
- data/lib/ory-oathkeeper-client/models/inline_response500.rb +253 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/is_instance_alive_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/json_web_key.rb +357 -0
- data/lib/ory-oathkeeper-client/models/json_web_key_set.rb +209 -0
- data/lib/ory-oathkeeper-client/models/judge_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/judge_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/judge_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/list_rules_ok.rb +210 -0
- data/lib/ory-oathkeeper-client/models/list_rules_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/list_rules_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/rule.rb +268 -0
- data/lib/ory-oathkeeper-client/models/rule_handler.rb +217 -0
- data/lib/ory-oathkeeper-client/models/rule_match.rb +219 -0
- data/lib/ory-oathkeeper-client/models/swagger_create_rule_parameters.rb +207 -0
- data/lib/ory-oathkeeper-client/models/swagger_get_rule_parameters.rb +213 -0
- data/lib/ory-oathkeeper-client/models/swagger_health_status.rb +208 -0
- data/lib/ory-oathkeeper-client/models/swagger_json_web_key.rb +370 -0
- data/lib/ory-oathkeeper-client/models/swagger_json_web_key_set.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_list_rules_parameters.rb +218 -0
- data/lib/ory-oathkeeper-client/models/swagger_not_ready_status.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule.rb +268 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_handler.rb +218 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_match.rb +220 -0
- data/lib/ory-oathkeeper-client/models/swagger_rule_response.rb +207 -0
- data/lib/ory-oathkeeper-client/models/swagger_rules_response.rb +210 -0
- data/lib/ory-oathkeeper-client/models/swagger_update_rule_parameters.rb +222 -0
- data/lib/ory-oathkeeper-client/models/swagger_version.rb +208 -0
- data/lib/ory-oathkeeper-client/models/update_rule_forbidden.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_forbidden_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_internal_server_error_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_not_found.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_not_found_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/update_rule_ok.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_unauthorized.rb +207 -0
- data/lib/ory-oathkeeper-client/models/update_rule_unauthorized_body.rb +260 -0
- data/lib/ory-oathkeeper-client/models/upstream.rb +227 -0
- data/lib/ory-oathkeeper-client/models/version.rb +207 -0
- data/lib/ory-oathkeeper-client/version.rb +15 -0
- data/ory-oathkeeper-client.gemspec +39 -0
- data/spec/api/api_api_spec.rb +115 -0
- data/spec/api/health_api_spec.rb +57 -0
- data/spec/api/version_api_spec.rb +46 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/create_rule_created_spec.rb +41 -0
- data/spec/models/create_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/create_rule_forbidden_spec.rb +41 -0
- data/spec/models/create_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/create_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/create_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/create_rule_unauthorized_spec.rb +41 -0
- data/spec/models/decisions_forbidden_body_spec.rb +71 -0
- data/spec/models/decisions_forbidden_spec.rb +41 -0
- data/spec/models/decisions_internal_server_error_body_spec.rb +71 -0
- data/spec/models/decisions_internal_server_error_spec.rb +41 -0
- data/spec/models/decisions_not_found_body_spec.rb +71 -0
- data/spec/models/decisions_not_found_spec.rb +41 -0
- data/spec/models/decisions_unauthorized_body_spec.rb +71 -0
- data/spec/models/decisions_unauthorized_spec.rb +41 -0
- data/spec/models/delete_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/delete_rule_forbidden_spec.rb +41 -0
- data/spec/models/delete_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/delete_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/delete_rule_not_found_body_spec.rb +71 -0
- data/spec/models/delete_rule_not_found_spec.rb +41 -0
- data/spec/models/delete_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/delete_rule_unauthorized_spec.rb +41 -0
- data/spec/models/get_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/get_rule_forbidden_spec.rb +41 -0
- data/spec/models/get_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/get_rule_not_found_body_spec.rb +71 -0
- data/spec/models/get_rule_not_found_spec.rb +41 -0
- data/spec/models/get_rule_ok_spec.rb +41 -0
- data/spec/models/get_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/get_rule_unauthorized_spec.rb +41 -0
- data/spec/models/get_well_known_forbidden_body_spec.rb +71 -0
- data/spec/models/get_well_known_forbidden_spec.rb +41 -0
- data/spec/models/get_well_known_json_web_keys_internal_server_error_body_spec.rb +71 -0
- data/spec/models/get_well_known_json_web_keys_internal_server_error_spec.rb +41 -0
- data/spec/models/get_well_known_json_web_keys_ok_spec.rb +41 -0
- data/spec/models/get_well_known_ok_spec.rb +41 -0
- data/spec/models/get_well_known_unauthorized_body_spec.rb +71 -0
- data/spec/models/get_well_known_unauthorized_spec.rb +41 -0
- data/spec/models/health_not_ready_status_spec.rb +41 -0
- data/spec/models/health_status_spec.rb +41 -0
- data/spec/models/inline_response500_spec.rb +71 -0
- data/spec/models/is_instance_alive_internal_server_error_body_spec.rb +71 -0
- data/spec/models/is_instance_alive_internal_server_error_spec.rb +41 -0
- data/spec/models/is_instance_alive_ok_spec.rb +41 -0
- data/spec/models/json_web_key_set_spec.rb +41 -0
- data/spec/models/json_web_key_spec.rb +137 -0
- data/spec/models/judge_forbidden_body_spec.rb +71 -0
- data/spec/models/judge_forbidden_spec.rb +41 -0
- data/spec/models/judge_internal_server_error_body_spec.rb +71 -0
- data/spec/models/judge_internal_server_error_spec.rb +41 -0
- data/spec/models/judge_not_found_body_spec.rb +71 -0
- data/spec/models/judge_not_found_spec.rb +41 -0
- data/spec/models/judge_unauthorized_body_spec.rb +71 -0
- data/spec/models/judge_unauthorized_spec.rb +41 -0
- data/spec/models/list_rules_forbidden_body_spec.rb +71 -0
- data/spec/models/list_rules_forbidden_spec.rb +41 -0
- data/spec/models/list_rules_internal_server_error_body_spec.rb +71 -0
- data/spec/models/list_rules_internal_server_error_spec.rb +41 -0
- data/spec/models/list_rules_ok_spec.rb +41 -0
- data/spec/models/list_rules_unauthorized_body_spec.rb +71 -0
- data/spec/models/list_rules_unauthorized_spec.rb +41 -0
- data/spec/models/rule_handler_spec.rb +47 -0
- data/spec/models/rule_match_spec.rb +47 -0
- data/spec/models/rule_spec.rb +77 -0
- data/spec/models/swagger_create_rule_parameters_spec.rb +41 -0
- data/spec/models/swagger_get_rule_parameters_spec.rb +41 -0
- data/spec/models/swagger_health_status_spec.rb +41 -0
- data/spec/models/swagger_json_web_key_set_spec.rb +41 -0
- data/spec/models/swagger_json_web_key_spec.rb +137 -0
- data/spec/models/swagger_list_rules_parameters_spec.rb +47 -0
- data/spec/models/swagger_not_ready_status_spec.rb +41 -0
- data/spec/models/swagger_rule_handler_spec.rb +47 -0
- data/spec/models/swagger_rule_match_spec.rb +47 -0
- data/spec/models/swagger_rule_response_spec.rb +41 -0
- data/spec/models/swagger_rule_spec.rb +77 -0
- data/spec/models/swagger_rules_response_spec.rb +41 -0
- data/spec/models/swagger_update_rule_parameters_spec.rb +47 -0
- data/spec/models/swagger_version_spec.rb +41 -0
- data/spec/models/update_rule_forbidden_body_spec.rb +71 -0
- data/spec/models/update_rule_forbidden_spec.rb +41 -0
- data/spec/models/update_rule_internal_server_error_body_spec.rb +71 -0
- data/spec/models/update_rule_internal_server_error_spec.rb +41 -0
- data/spec/models/update_rule_not_found_body_spec.rb +71 -0
- data/spec/models/update_rule_not_found_spec.rb +41 -0
- data/spec/models/update_rule_ok_spec.rb +41 -0
- data/spec/models/update_rule_unauthorized_body_spec.rb +71 -0
- data/spec/models/update_rule_unauthorized_spec.rb +41 -0
- data/spec/models/upstream_spec.rb +53 -0
- data/spec/models/version_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +497 -0
@@ -0,0 +1,220 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Oathkeeper
|
3
|
+
|
4
|
+
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.37
|
7
|
+
Contact: hi@ory.am
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OryHydraClient
|
16
|
+
# SwaggerRuleMatch swagger rule match
|
17
|
+
class SwaggerRuleMatch
|
18
|
+
# An array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...). When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the HTTP method of the incoming request with the HTTP methods of each rules. If a match is found, the rule is considered a partial match. If the matchesUrl field is satisfied as well, the rule is considered a full match.
|
19
|
+
attr_accessor :methods
|
20
|
+
|
21
|
+
# This field represents the URL pattern this rule matches. When ORY Oathkeeper searches for rules to decide what to do with an incoming request to the proxy server, it compares the full request URL (e.g. https://mydomain.com/api/resource) without query parameters of the incoming request with this field. If a match is found, the rule is considered a partial match. If the matchesMethods field is satisfied as well, the rule is considered a full match. You can use regular expressions in this field to match more than one url. Regular expressions are encapsulated in brackets < and >. The following example matches all paths of the domain `mydomain.com`: `https://mydomain.com/<.*>`.
|
22
|
+
attr_accessor :url
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'methods' => :'methods',
|
28
|
+
:'url' => :'url'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'methods' => :'Array<String>',
|
36
|
+
:'url' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SwaggerRuleMatch` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SwaggerRuleMatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'methods')
|
62
|
+
if (value = attributes[:'methods']).is_a?(Array)
|
63
|
+
self.methods = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.key?(:'url')
|
68
|
+
self.url = attributes[:'url']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
invalid_properties = Array.new
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
true
|
83
|
+
end
|
84
|
+
|
85
|
+
# Checks equality by comparing each attribute.
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def ==(o)
|
88
|
+
return true if self.equal?(o)
|
89
|
+
self.class == o.class &&
|
90
|
+
methods == o.methods &&
|
91
|
+
url == o.url
|
92
|
+
end
|
93
|
+
|
94
|
+
# @see the `==` method
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def eql?(o)
|
97
|
+
self == o
|
98
|
+
end
|
99
|
+
|
100
|
+
# Calculates hash code according to all attributes.
|
101
|
+
# @return [Integer] Hash code
|
102
|
+
def hash
|
103
|
+
[methods, url].hash
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def self.build_from_hash(attributes)
|
110
|
+
new.build_from_hash(attributes)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def build_from_hash(attributes)
|
117
|
+
return nil unless attributes.is_a?(Hash)
|
118
|
+
self.class.openapi_types.each_pair do |key, type|
|
119
|
+
if type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
124
|
+
end
|
125
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
128
|
+
end
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def _deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :DateTime
|
140
|
+
DateTime.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :Boolean
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = {}
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = self.send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,207 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Oathkeeper
|
3
|
+
|
4
|
+
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.37
|
7
|
+
Contact: hi@ory.am
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OryHydraClient
|
16
|
+
# SwaggerRuleResponse A rule
|
17
|
+
class SwaggerRuleResponse
|
18
|
+
attr_accessor :body
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'body' => :'Body'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'body' => :'SwaggerRule'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SwaggerRuleResponse` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SwaggerRuleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'body')
|
56
|
+
self.body = attributes[:'body']
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
true
|
71
|
+
end
|
72
|
+
|
73
|
+
# Checks equality by comparing each attribute.
|
74
|
+
# @param [Object] Object to be compared
|
75
|
+
def ==(o)
|
76
|
+
return true if self.equal?(o)
|
77
|
+
self.class == o.class &&
|
78
|
+
body == o.body
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Integer] Hash code
|
89
|
+
def hash
|
90
|
+
[body].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def self.build_from_hash(attributes)
|
97
|
+
new.build_from_hash(attributes)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def build_from_hash(attributes)
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
105
|
+
self.class.openapi_types.each_pair do |key, type|
|
106
|
+
if type =~ /\AArray<(.*)>/i
|
107
|
+
# check to ensure the input is an array given that the attribute
|
108
|
+
# is documented as an array but the input is not
|
109
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
110
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
111
|
+
end
|
112
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
113
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
114
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
|
120
|
+
# Deserializes the data based on type
|
121
|
+
# @param string type Data type
|
122
|
+
# @param string value Value to be deserialized
|
123
|
+
# @return [Object] Deserialized data
|
124
|
+
def _deserialize(type, value)
|
125
|
+
case type.to_sym
|
126
|
+
when :DateTime
|
127
|
+
DateTime.parse(value)
|
128
|
+
when :Date
|
129
|
+
Date.parse(value)
|
130
|
+
when :String
|
131
|
+
value.to_s
|
132
|
+
when :Integer
|
133
|
+
value.to_i
|
134
|
+
when :Float
|
135
|
+
value.to_f
|
136
|
+
when :Boolean
|
137
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
138
|
+
true
|
139
|
+
else
|
140
|
+
false
|
141
|
+
end
|
142
|
+
when :Object
|
143
|
+
# generic object (usually a Hash), return directly
|
144
|
+
value
|
145
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
146
|
+
inner_type = Regexp.last_match[:inner_type]
|
147
|
+
value.map { |v| _deserialize(inner_type, v) }
|
148
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
149
|
+
k_type = Regexp.last_match[:k_type]
|
150
|
+
v_type = Regexp.last_match[:v_type]
|
151
|
+
{}.tap do |hash|
|
152
|
+
value.each do |k, v|
|
153
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
else # model
|
157
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = self.send(attr)
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
@@ -0,0 +1,210 @@
|
|
1
|
+
=begin
|
2
|
+
#ORY Oathkeeper
|
3
|
+
|
4
|
+
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.0-alpha.37
|
7
|
+
Contact: hi@ory.am
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OryHydraClient
|
16
|
+
# SwaggerRulesResponse A list of rules
|
17
|
+
class SwaggerRulesResponse
|
18
|
+
# in: body type: array
|
19
|
+
attr_accessor :body
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'body' => :'Body'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'body' => :'Array<SwaggerRule>'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SwaggerRulesResponse` initialize method"
|
46
|
+
end
|
47
|
+
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SwaggerRulesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'body')
|
57
|
+
if (value = attributes[:'body']).is_a?(Array)
|
58
|
+
self.body = value
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
64
|
+
# @return Array for valid properties with the reasons
|
65
|
+
def list_invalid_properties
|
66
|
+
invalid_properties = Array.new
|
67
|
+
invalid_properties
|
68
|
+
end
|
69
|
+
|
70
|
+
# Check to see if the all the properties in the model are valid
|
71
|
+
# @return true if the model is valid
|
72
|
+
def valid?
|
73
|
+
true
|
74
|
+
end
|
75
|
+
|
76
|
+
# Checks equality by comparing each attribute.
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def ==(o)
|
79
|
+
return true if self.equal?(o)
|
80
|
+
self.class == o.class &&
|
81
|
+
body == o.body
|
82
|
+
end
|
83
|
+
|
84
|
+
# @see the `==` method
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def eql?(o)
|
87
|
+
self == o
|
88
|
+
end
|
89
|
+
|
90
|
+
# Calculates hash code according to all attributes.
|
91
|
+
# @return [Integer] Hash code
|
92
|
+
def hash
|
93
|
+
[body].hash
|
94
|
+
end
|
95
|
+
|
96
|
+
# Builds the object from hash
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
+
# @return [Object] Returns the model itself
|
99
|
+
def self.build_from_hash(attributes)
|
100
|
+
new.build_from_hash(attributes)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def build_from_hash(attributes)
|
107
|
+
return nil unless attributes.is_a?(Hash)
|
108
|
+
self.class.openapi_types.each_pair do |key, type|
|
109
|
+
if type =~ /\AArray<(.*)>/i
|
110
|
+
# check to ensure the input is an array given that the attribute
|
111
|
+
# is documented as an array but the input is not
|
112
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
114
|
+
end
|
115
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
117
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
118
|
+
end
|
119
|
+
|
120
|
+
self
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deserializes the data based on type
|
124
|
+
# @param string type Data type
|
125
|
+
# @param string value Value to be deserialized
|
126
|
+
# @return [Object] Deserialized data
|
127
|
+
def _deserialize(type, value)
|
128
|
+
case type.to_sym
|
129
|
+
when :DateTime
|
130
|
+
DateTime.parse(value)
|
131
|
+
when :Date
|
132
|
+
Date.parse(value)
|
133
|
+
when :String
|
134
|
+
value.to_s
|
135
|
+
when :Integer
|
136
|
+
value.to_i
|
137
|
+
when :Float
|
138
|
+
value.to_f
|
139
|
+
when :Boolean
|
140
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
141
|
+
true
|
142
|
+
else
|
143
|
+
false
|
144
|
+
end
|
145
|
+
when :Object
|
146
|
+
# generic object (usually a Hash), return directly
|
147
|
+
value
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
151
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
154
|
+
{}.tap do |hash|
|
155
|
+
value.each do |k, v|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
else # model
|
160
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the string representation of the object
|
165
|
+
# @return [String] String presentation of the object
|
166
|
+
def to_s
|
167
|
+
to_hash.to_s
|
168
|
+
end
|
169
|
+
|
170
|
+
# to_body is an alias to to_hash (backward compatibility)
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
172
|
+
def to_body
|
173
|
+
to_hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the object in the form of hash
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
178
|
+
def to_hash
|
179
|
+
hash = {}
|
180
|
+
self.class.attribute_map.each_pair do |attr, param|
|
181
|
+
value = self.send(attr)
|
182
|
+
if value.nil?
|
183
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
184
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
185
|
+
end
|
186
|
+
|
187
|
+
hash[param] = _to_hash(value)
|
188
|
+
end
|
189
|
+
hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Outputs non-array value in the form of hash
|
193
|
+
# For object, use to_hash. Otherwise, just return the value
|
194
|
+
# @param [Object] value Any valid value
|
195
|
+
# @return [Hash] Returns the value in the form of hash
|
196
|
+
def _to_hash(value)
|
197
|
+
if value.is_a?(Array)
|
198
|
+
value.compact.map { |v| _to_hash(v) }
|
199
|
+
elsif value.is_a?(Hash)
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
202
|
+
end
|
203
|
+
elsif value.respond_to? :to_hash
|
204
|
+
value.to_hash
|
205
|
+
else
|
206
|
+
value
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|