ory-hydra-client 0.0.0.alpha62 → 0.0.0.alpha63

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +46 -32
  4. data/docs/AcceptConsentRequest.md +4 -2
  5. data/docs/AcceptLoginRequest.md +1 -1
  6. data/docs/AdminApi.md +111 -71
  7. data/docs/CompletedRequest.md +1 -1
  8. data/docs/ConsentRequest.md +4 -4
  9. data/docs/ConsentRequestSession.md +2 -2
  10. data/docs/ContainerWaitOKBodyError.md +17 -0
  11. data/docs/LoginRequest.md +7 -7
  12. data/docs/OAuth2Client.md +13 -11
  13. data/docs/OAuth2TokenIntrospection.md +5 -3
  14. data/docs/OpenIDConnectContext.md +1 -1
  15. data/docs/PluginConfig.md +47 -0
  16. data/docs/PluginConfigArgs.md +23 -0
  17. data/docs/PluginConfigInterface.md +19 -0
  18. data/docs/PluginConfigLinux.md +21 -0
  19. data/docs/PluginConfigNetwork.md +17 -0
  20. data/docs/PluginConfigRootfs.md +19 -0
  21. data/docs/PluginConfigUser.md +19 -0
  22. data/docs/PluginDevice.md +23 -0
  23. data/docs/PluginEnv.md +23 -0
  24. data/docs/PluginInterfaceType.md +21 -0
  25. data/docs/PluginMount.md +29 -0
  26. data/docs/PluginSettings.md +23 -0
  27. data/docs/PreviousConsentSession.md +4 -2
  28. data/docs/PublicApi.md +16 -16
  29. data/docs/RejectRequest.md +5 -5
  30. data/docs/VolumeUsageData.md +19 -0
  31. data/docs/WellKnown.md +3 -1
  32. data/lib/ory-hydra-client.rb +16 -3
  33. data/lib/ory-hydra-client/api/admin_api.rb +115 -49
  34. data/lib/ory-hydra-client/api/public_api.rb +14 -14
  35. data/lib/ory-hydra-client/api_client.rb +9 -7
  36. data/lib/ory-hydra-client/api_error.rb +2 -2
  37. data/lib/ory-hydra-client/configuration.rb +2 -2
  38. data/lib/ory-hydra-client/models/accept_consent_request.rb +12 -5
  39. data/lib/ory-hydra-client/models/accept_login_request.rb +4 -7
  40. data/lib/ory-hydra-client/models/completed_request.rb +7 -2
  41. data/lib/ory-hydra-client/models/consent_request.rb +10 -10
  42. data/lib/ory-hydra-client/models/consent_request_session.rb +6 -10
  43. data/lib/ory-hydra-client/models/container_wait_ok_body_error.rb +208 -0
  44. data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +2 -2
  45. data/lib/ory-hydra-client/models/generic_error.rb +2 -2
  46. data/lib/ory-hydra-client/models/health_not_ready_status.rb +2 -2
  47. data/lib/ory-hydra-client/models/health_status.rb +2 -2
  48. data/lib/ory-hydra-client/models/json_web_key.rb +3 -2
  49. data/lib/ory-hydra-client/models/json_web_key_set.rb +3 -2
  50. data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +2 -2
  51. data/lib/ory-hydra-client/models/login_request.rb +38 -5
  52. data/lib/ory-hydra-client/models/logout_request.rb +2 -2
  53. data/lib/ory-hydra-client/models/o_auth2_client.rb +17 -18
  54. data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +17 -9
  55. data/lib/ory-hydra-client/models/oauth2_token_response.rb +2 -2
  56. data/lib/ory-hydra-client/models/oauth_token_response.rb +1 -1
  57. data/lib/ory-hydra-client/models/open_id_connect_context.rb +4 -6
  58. data/lib/ory-hydra-client/models/plugin_config.rb +422 -0
  59. data/lib/ory-hydra-client/models/plugin_config_args.rb +262 -0
  60. data/lib/ory-hydra-client/models/plugin_config_interface.rb +230 -0
  61. data/lib/ory-hydra-client/models/plugin_config_linux.rb +247 -0
  62. data/lib/ory-hydra-client/models/plugin_config_network.rb +213 -0
  63. data/lib/ory-hydra-client/models/plugin_config_rootfs.rb +220 -0
  64. data/lib/ory-hydra-client/models/plugin_config_user.rb +218 -0
  65. data/lib/ory-hydra-client/models/plugin_device.rb +260 -0
  66. data/lib/ory-hydra-client/models/plugin_env.rb +260 -0
  67. data/lib/ory-hydra-client/models/plugin_interface_type.rb +243 -0
  68. data/lib/ory-hydra-client/models/plugin_mount.rb +307 -0
  69. data/lib/ory-hydra-client/models/plugin_settings.rb +265 -0
  70. data/lib/ory-hydra-client/models/previous_consent_session.rb +12 -5
  71. data/lib/ory-hydra-client/models/reject_request.rb +7 -2
  72. data/lib/ory-hydra-client/models/userinfo_response.rb +2 -2
  73. data/lib/ory-hydra-client/models/version.rb +2 -2
  74. data/lib/ory-hydra-client/models/volume_usage_data.rb +228 -0
  75. data/lib/ory-hydra-client/models/well_known.rb +15 -3
  76. data/lib/ory-hydra-client/version.rb +3 -3
  77. data/ory-hydra-client.gemspec +2 -2
  78. data/spec/models/container_wait_ok_body_error_spec.rb +41 -0
  79. data/spec/models/plugin_config_args_spec.rb +59 -0
  80. data/spec/models/plugin_config_interface_spec.rb +47 -0
  81. data/spec/models/plugin_config_linux_spec.rb +53 -0
  82. data/spec/models/plugin_config_network_spec.rb +41 -0
  83. data/spec/models/plugin_config_rootfs_spec.rb +47 -0
  84. data/spec/models/plugin_config_spec.rb +131 -0
  85. data/spec/models/plugin_config_user_spec.rb +47 -0
  86. data/spec/models/plugin_device_spec.rb +59 -0
  87. data/spec/models/plugin_env_spec.rb +59 -0
  88. data/spec/models/plugin_interface_type_spec.rb +53 -0
  89. data/spec/models/plugin_mount_spec.rb +77 -0
  90. data/spec/models/plugin_settings_spec.rb +59 -0
  91. data/spec/models/volume_usage_data_spec.rb +47 -0
  92. metadata +76 -20
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v0.0.0-alpha.63
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # PluginConfigRootfs plugin config rootfs
17
+ class PluginConfigRootfs
18
+ # diff ids
19
+ attr_accessor :diff_ids
20
+
21
+ # type
22
+ attr_accessor :type
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'diff_ids' => :'diff_ids',
28
+ :'type' => :'type'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'diff_ids' => :'Array<String>',
36
+ :'type' => :'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::PluginConfigRootfs` 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::PluginConfigRootfs`. 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?(:'diff_ids')
62
+ if (value = attributes[:'diff_ids']).is_a?(Array)
63
+ self.diff_ids = value
64
+ end
65
+ end
66
+
67
+ if attributes.key?(:'type')
68
+ self.type = attributes[:'type']
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
+ diff_ids == o.diff_ids &&
91
+ type == o.type
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
+ [diff_ids, type].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,218 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v0.0.0-alpha.63
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # PluginConfigUser plugin config user
17
+ class PluginConfigUser
18
+ # g ID
19
+ attr_accessor :gid
20
+
21
+ # UID
22
+ attr_accessor :uid
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'gid' => :'GID',
28
+ :'uid' => :'UID'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'gid' => :'Integer',
36
+ :'uid' => :'Integer'
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::PluginConfigUser` 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::PluginConfigUser`. 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?(:'gid')
62
+ self.gid = attributes[:'gid']
63
+ end
64
+
65
+ if attributes.key?(:'uid')
66
+ self.uid = attributes[:'uid']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ gid == o.gid &&
89
+ uid == o.uid
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [gid, uid].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ OryHydraClient.const_get(type).build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,260 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v0.0.0-alpha.63
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # PluginDevice plugin device
17
+ class PluginDevice
18
+ # description
19
+ attr_accessor :description
20
+
21
+ # name
22
+ attr_accessor :name
23
+
24
+ # path
25
+ attr_accessor :path
26
+
27
+ # settable
28
+ attr_accessor :settable
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'description' => :'Description',
34
+ :'name' => :'Name',
35
+ :'path' => :'Path',
36
+ :'settable' => :'Settable'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'description' => :'String',
44
+ :'name' => :'String',
45
+ :'path' => :'String',
46
+ :'settable' => :'Array<String>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::PluginDevice` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::PluginDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'description')
72
+ self.description = attributes[:'description']
73
+ end
74
+
75
+ if attributes.key?(:'name')
76
+ self.name = attributes[:'name']
77
+ end
78
+
79
+ if attributes.key?(:'path')
80
+ self.path = attributes[:'path']
81
+ end
82
+
83
+ if attributes.key?(:'settable')
84
+ if (value = attributes[:'settable']).is_a?(Array)
85
+ self.settable = value
86
+ end
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ if @description.nil?
95
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
96
+ end
97
+
98
+ if @name.nil?
99
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
100
+ end
101
+
102
+ if @path.nil?
103
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
104
+ end
105
+
106
+ if @settable.nil?
107
+ invalid_properties.push('invalid value for "settable", settable cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @description.nil?
117
+ return false if @name.nil?
118
+ return false if @path.nil?
119
+ return false if @settable.nil?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ description == o.description &&
129
+ name == o.name &&
130
+ path == o.path &&
131
+ settable == o.settable
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [description, name, path, settable].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.openapi_types.each_pair do |key, type|
159
+ if type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
+ end
165
+ elsif !attributes[self.class.attribute_map[key]].nil?
166
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ OryHydraClient.const_get(type).build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+ end
260
+ end