ory-client-client 0.0.1.alpha1
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 +231 -0
- data/Rakefile +10 -0
- data/docs/AuthenticateOKBody.md +20 -0
- data/docs/ContainerChangeResponseItem.md +20 -0
- data/docs/ContainerCreateCreatedBody.md +20 -0
- data/docs/ContainerTopOKBody.md +20 -0
- data/docs/ContainerUpdateOKBody.md +18 -0
- data/docs/ContainerWaitOKBody.md +20 -0
- data/docs/ContainerWaitOKBodyError.md +18 -0
- data/docs/CreateIdentity.md +20 -0
- data/docs/CreateRecoveryLink.md +20 -0
- data/docs/DefaultApi.md +2902 -0
- data/docs/ErrorContainer.md +20 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/GenericError.md +30 -0
- data/docs/GraphDriverData.md +20 -0
- data/docs/HealthNotReadyStatus.md +18 -0
- data/docs/HealthStatus.md +18 -0
- data/docs/IdResponse.md +18 -0
- data/docs/Identity.md +28 -0
- data/docs/IdentityCredentials.md +22 -0
- data/docs/ImageDeleteResponseItem.md +20 -0
- data/docs/ImageSummary.md +36 -0
- data/docs/InlineResponse200.md +18 -0
- data/docs/InlineResponse2001.md +18 -0
- data/docs/InlineResponse503.md +18 -0
- data/docs/JsonError.md +18 -0
- data/docs/LoginFlow.md +32 -0
- data/docs/LoginViaApiResponse.md +20 -0
- data/docs/Meta.md +18 -0
- data/docs/Plugin.md +28 -0
- data/docs/PluginConfig.md +48 -0
- data/docs/PluginConfigArgs.md +24 -0
- data/docs/PluginConfigInterface.md +20 -0
- data/docs/PluginConfigLinux.md +22 -0
- data/docs/PluginConfigNetwork.md +18 -0
- data/docs/PluginConfigRootfs.md +20 -0
- data/docs/PluginConfigUser.md +20 -0
- data/docs/PluginDevice.md +24 -0
- data/docs/PluginEnv.md +24 -0
- data/docs/PluginInterfaceType.md +22 -0
- data/docs/PluginMount.md +30 -0
- data/docs/PluginSettings.md +24 -0
- data/docs/Port.md +24 -0
- data/docs/RecoveryAddress.md +22 -0
- data/docs/RecoveryFlow.md +32 -0
- data/docs/RecoveryLink.md +20 -0
- data/docs/RegistrationFlow.md +30 -0
- data/docs/RegistrationViaApiResponse.md +22 -0
- data/docs/RevokeSession.md +18 -0
- data/docs/ServiceUpdateResponse.md +18 -0
- data/docs/Session.md +28 -0
- data/docs/SettingsFlow.md +34 -0
- data/docs/SettingsProfileFormConfig.md +24 -0
- data/docs/SettingsViaApiResponse.md +20 -0
- data/docs/SubmitSelfServiceBrowserSettingsOIDCFlowPayload.md +22 -0
- data/docs/SubmitSelfServiceLoginFlow.md +47 -0
- data/docs/SubmitSelfServiceLoginFlowWithPasswordMethod.md +24 -0
- data/docs/SubmitSelfServiceRecoveryFlowWithLinkMethod.md +20 -0
- data/docs/SubmitSelfServiceRegistrationFlow.md +47 -0
- data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethod.md +24 -0
- data/docs/SubmitSelfServiceSettingsFlow.md +49 -0
- data/docs/SubmitSelfServiceSettingsFlowWithPasswordMethod.md +22 -0
- data/docs/SubmitSelfServiceSettingsFlowWithProfileMethod.md +22 -0
- data/docs/SubmitSelfServiceVerificationFlowWithLinkMethod.md +20 -0
- data/docs/UiContainer.md +24 -0
- data/docs/UiNode.md +26 -0
- data/docs/UiNodeAnchorAttributes.md +20 -0
- data/docs/UiNodeAttributes.md +53 -0
- data/docs/UiNodeImageAttributes.md +18 -0
- data/docs/UiNodeInputAttributes.md +30 -0
- data/docs/UiNodeInputAttributesValue.md +51 -0
- data/docs/UiNodeTextAttributes.md +18 -0
- data/docs/UiText.md +24 -0
- data/docs/UpdateIdentity.md +20 -0
- data/docs/VerifiableIdentityAddress.md +32 -0
- data/docs/VerificationFlow.md +32 -0
- data/docs/Version.md +18 -0
- data/docs/Volume.md +34 -0
- data/docs/VolumeUsageData.md +20 -0
- data/lib/ory-client-client.rb +117 -0
- data/lib/ory-client-client/api/default_api.rb +2690 -0
- data/lib/ory-client-client/api_client.rb +390 -0
- data/lib/ory-client-client/api_error.rb +57 -0
- data/lib/ory-client-client/configuration.rb +297 -0
- data/lib/ory-client-client/models/authenticate_ok_body.rb +240 -0
- data/lib/ory-client-client/models/container_change_response_item.rb +240 -0
- data/lib/ory-client-client/models/container_create_created_body.rb +242 -0
- data/lib/ory-client-client/models/container_top_ok_body.rb +244 -0
- data/lib/ory-client-client/models/container_update_ok_body.rb +227 -0
- data/lib/ory-client-client/models/container_wait_ok_body.rb +239 -0
- data/lib/ory-client-client/models/container_wait_ok_body_error.rb +220 -0
- data/lib/ory-client-client/models/create_identity.rb +239 -0
- data/lib/ory-client-client/models/create_recovery_link.rb +250 -0
- data/lib/ory-client-client/models/error_container.rb +240 -0
- data/lib/ory-client-client/models/error_response.rb +224 -0
- data/lib/ory-client-client/models/generic_error.rb +286 -0
- data/lib/ory-client-client/models/graph_driver_data.rb +241 -0
- data/lib/ory-client-client/models/health_not_ready_status.rb +221 -0
- data/lib/ory-client-client/models/health_status.rb +219 -0
- data/lib/ory-client-client/models/id_response.rb +225 -0
- data/lib/ory-client-client/models/identity.rb +289 -0
- data/lib/ory-client-client/models/identity_credentials.rb +241 -0
- data/lib/ory-client-client/models/image_delete_response_item.rb +230 -0
- data/lib/ory-client-client/models/image_summary.rb +366 -0
- data/lib/ory-client-client/models/inline_response200.rb +224 -0
- data/lib/ory-client-client/models/inline_response2001.rb +224 -0
- data/lib/ory-client-client/models/inline_response503.rb +226 -0
- data/lib/ory-client-client/models/json_error.rb +224 -0
- data/lib/ory-client-client/models/login_flow.rb +318 -0
- data/lib/ory-client-client/models/login_via_api_response.rb +239 -0
- data/lib/ory-client-client/models/meta.rb +219 -0
- data/lib/ory-client-client/models/plugin.rb +288 -0
- data/lib/ory-client-client/models/plugin_config.rb +434 -0
- data/lib/ory-client-client/models/plugin_config_args.rb +274 -0
- data/lib/ory-client-client/models/plugin_config_interface.rb +242 -0
- data/lib/ory-client-client/models/plugin_config_linux.rb +259 -0
- data/lib/ory-client-client/models/plugin_config_network.rb +225 -0
- data/lib/ory-client-client/models/plugin_config_rootfs.rb +232 -0
- data/lib/ory-client-client/models/plugin_config_user.rb +230 -0
- data/lib/ory-client-client/models/plugin_device.rb +272 -0
- data/lib/ory-client-client/models/plugin_env.rb +272 -0
- data/lib/ory-client-client/models/plugin_interface_type.rb +255 -0
- data/lib/ory-client-client/models/plugin_mount.rb +319 -0
- data/lib/ory-client-client/models/plugin_settings.rb +277 -0
- data/lib/ory-client-client/models/port.rb +260 -0
- data/lib/ory-client-client/models/recovery_address.rb +251 -0
- data/lib/ory-client-client/models/recovery_flow.rb +317 -0
- data/lib/ory-client-client/models/recovery_link.rb +234 -0
- data/lib/ory-client-client/models/registration_flow.rb +302 -0
- data/lib/ory-client-client/models/registration_via_api_response.rb +248 -0
- data/lib/ory-client-client/models/revoke_session.rb +224 -0
- data/lib/ory-client-client/models/service_update_response.rb +222 -0
- data/lib/ory-client-client/models/session.rb +288 -0
- data/lib/ory-client-client/models/settings_flow.rb +331 -0
- data/lib/ory-client-client/models/settings_profile_form_config.rb +266 -0
- data/lib/ory-client-client/models/settings_via_api_response.rb +238 -0
- data/lib/ory-client-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +239 -0
- data/lib/ory-client-client/models/submit_self_service_login_flow.rb +104 -0
- data/lib/ory-client-client/models/submit_self_service_login_flow_with_password_method.rb +249 -0
- data/lib/ory-client-client/models/submit_self_service_recovery_flow_with_link_method.rb +229 -0
- data/lib/ory-client-client/models/submit_self_service_registration_flow.rb +104 -0
- data/lib/ory-client-client/models/submit_self_service_registration_flow_with_password_method.rb +276 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow.rb +105 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow_with_password_method.rb +244 -0
- data/lib/ory-client-client/models/submit_self_service_settings_flow_with_profile_method.rb +245 -0
- data/lib/ory-client-client/models/submit_self_service_verification_flow_with_link_method.rb +230 -0
- data/lib/ory-client-client/models/ui_container.rb +267 -0
- data/lib/ory-client-client/models/ui_node.rb +282 -0
- data/lib/ory-client-client/models/ui_node_anchor_attributes.rb +238 -0
- data/lib/ory-client-client/models/ui_node_attributes.rb +107 -0
- data/lib/ory-client-client/models/ui_node_image_attributes.rb +224 -0
- data/lib/ory-client-client/models/ui_node_input_attributes.rb +292 -0
- data/lib/ory-client-client/models/ui_node_input_attributes_value.rb +106 -0
- data/lib/ory-client-client/models/ui_node_text_attributes.rb +223 -0
- data/lib/ory-client-client/models/ui_text.rb +262 -0
- data/lib/ory-client-client/models/update_identity.rb +234 -0
- data/lib/ory-client-client/models/verifiable_identity_address.rb +313 -0
- data/lib/ory-client-client/models/verification_flow.rb +307 -0
- data/lib/ory-client-client/models/version.rb +219 -0
- data/lib/ory-client-client/models/volume.rb +335 -0
- data/lib/ory-client-client/models/volume_usage_data.rb +240 -0
- data/lib/ory-client-client/version.rb +15 -0
- data/ory-client-client.gemspec +38 -0
- data/spec/api/default_api_spec.rb +544 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/authenticate_ok_body_spec.rb +40 -0
- data/spec/models/container_change_response_item_spec.rb +40 -0
- data/spec/models/container_create_created_body_spec.rb +40 -0
- data/spec/models/container_top_ok_body_spec.rb +40 -0
- data/spec/models/container_update_ok_body_spec.rb +34 -0
- data/spec/models/container_wait_ok_body_error_spec.rb +34 -0
- data/spec/models/container_wait_ok_body_spec.rb +40 -0
- data/spec/models/create_identity_spec.rb +40 -0
- data/spec/models/create_recovery_link_spec.rb +40 -0
- data/spec/models/error_container_spec.rb +40 -0
- data/spec/models/error_response_spec.rb +34 -0
- data/spec/models/generic_error_spec.rb +70 -0
- data/spec/models/graph_driver_data_spec.rb +40 -0
- data/spec/models/health_not_ready_status_spec.rb +34 -0
- data/spec/models/health_status_spec.rb +34 -0
- data/spec/models/id_response_spec.rb +34 -0
- data/spec/models/identity_credentials_spec.rb +46 -0
- data/spec/models/identity_spec.rb +64 -0
- data/spec/models/image_delete_response_item_spec.rb +40 -0
- data/spec/models/image_summary_spec.rb +88 -0
- data/spec/models/inline_response2001_spec.rb +34 -0
- data/spec/models/inline_response200_spec.rb +34 -0
- data/spec/models/inline_response503_spec.rb +34 -0
- data/spec/models/json_error_spec.rb +34 -0
- data/spec/models/login_flow_spec.rb +76 -0
- data/spec/models/login_via_api_response_spec.rb +40 -0
- data/spec/models/meta_spec.rb +34 -0
- data/spec/models/plugin_config_args_spec.rb +52 -0
- data/spec/models/plugin_config_interface_spec.rb +40 -0
- data/spec/models/plugin_config_linux_spec.rb +46 -0
- data/spec/models/plugin_config_network_spec.rb +34 -0
- data/spec/models/plugin_config_rootfs_spec.rb +40 -0
- data/spec/models/plugin_config_spec.rb +124 -0
- data/spec/models/plugin_config_user_spec.rb +40 -0
- data/spec/models/plugin_device_spec.rb +52 -0
- data/spec/models/plugin_env_spec.rb +52 -0
- data/spec/models/plugin_interface_type_spec.rb +46 -0
- data/spec/models/plugin_mount_spec.rb +70 -0
- data/spec/models/plugin_settings_spec.rb +52 -0
- data/spec/models/plugin_spec.rb +64 -0
- data/spec/models/port_spec.rb +52 -0
- data/spec/models/recovery_address_spec.rb +46 -0
- data/spec/models/recovery_flow_spec.rb +76 -0
- data/spec/models/recovery_link_spec.rb +40 -0
- data/spec/models/registration_flow_spec.rb +70 -0
- data/spec/models/registration_via_api_response_spec.rb +46 -0
- data/spec/models/revoke_session_spec.rb +34 -0
- data/spec/models/service_update_response_spec.rb +34 -0
- data/spec/models/session_spec.rb +64 -0
- data/spec/models/settings_flow_spec.rb +82 -0
- data/spec/models/settings_profile_form_config_spec.rb +52 -0
- data/spec/models/settings_via_api_response_spec.rb +40 -0
- data/spec/models/submit_self_service_browser_settings_oidc_flow_payload_spec.rb +46 -0
- data/spec/models/submit_self_service_login_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_login_flow_with_password_method_spec.rb +52 -0
- data/spec/models/submit_self_service_recovery_flow_with_link_method_spec.rb +40 -0
- data/spec/models/submit_self_service_registration_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_registration_flow_with_password_method_spec.rb +52 -0
- data/spec/models/submit_self_service_settings_flow_spec.rb +31 -0
- data/spec/models/submit_self_service_settings_flow_with_password_method_spec.rb +46 -0
- data/spec/models/submit_self_service_settings_flow_with_profile_method_spec.rb +46 -0
- data/spec/models/submit_self_service_verification_flow_with_link_method_spec.rb +40 -0
- data/spec/models/ui_container_spec.rb +52 -0
- data/spec/models/ui_node_anchor_attributes_spec.rb +40 -0
- data/spec/models/ui_node_attributes_spec.rb +31 -0
- data/spec/models/ui_node_image_attributes_spec.rb +34 -0
- data/spec/models/ui_node_input_attributes_spec.rb +70 -0
- data/spec/models/ui_node_input_attributes_value_spec.rb +31 -0
- data/spec/models/ui_node_spec.rb +58 -0
- data/spec/models/ui_node_text_attributes_spec.rb +34 -0
- data/spec/models/ui_text_spec.rb +52 -0
- data/spec/models/update_identity_spec.rb +40 -0
- data/spec/models/verifiable_identity_address_spec.rb +76 -0
- data/spec/models/verification_flow_spec.rb +76 -0
- data/spec/models/version_spec.rb +34 -0
- data/spec/models/volume_spec.rb +82 -0
- data/spec/models/volume_usage_data_spec.rb +40 -0
- data/spec/spec_helper.rb +111 -0
- metadata +413 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory APIs
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.1-alpha.1
|
7
|
+
Contact: support@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
module UiNodeAttributes
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'UiNodeAnchorAttributes',
|
23
|
+
:'UiNodeImageAttributes',
|
24
|
+
:'UiNodeInputAttributes',
|
25
|
+
:'UiNodeTextAttributes'
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
# Builds the object
|
30
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
31
|
+
# @return [Object] Returns the model or the data itself
|
32
|
+
def build(data)
|
33
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
34
|
+
# Note:
|
35
|
+
# - We do not attempt to check whether exactly one item matches.
|
36
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
37
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
38
|
+
# - TODO: scalar values are defacto behaving as if they were nullable.
|
39
|
+
# - TODO: logging when debugging is set.
|
40
|
+
openapi_one_of.each do |klass|
|
41
|
+
begin
|
42
|
+
next if klass == :AnyType # "nullable: true"
|
43
|
+
typed_data = find_and_cast_into_type(klass, data)
|
44
|
+
return typed_data if typed_data
|
45
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
SchemaMismatchError = Class.new(StandardError)
|
55
|
+
|
56
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
57
|
+
def find_and_cast_into_type(klass, data)
|
58
|
+
return if data.nil?
|
59
|
+
|
60
|
+
case klass.to_s
|
61
|
+
when 'Boolean'
|
62
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
63
|
+
when 'Float'
|
64
|
+
return data if data.instance_of?(Float)
|
65
|
+
when 'Integer'
|
66
|
+
return data if data.instance_of?(Integer)
|
67
|
+
when 'Time'
|
68
|
+
return Time.parse(data)
|
69
|
+
when 'Date'
|
70
|
+
return Date.parse(data)
|
71
|
+
when 'String'
|
72
|
+
return data if data.instance_of?(String)
|
73
|
+
when 'Object' # "type: object"
|
74
|
+
return data if data.instance_of?(Hash)
|
75
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
76
|
+
if data.instance_of?(Array)
|
77
|
+
sub_type = Regexp.last_match[:sub_type]
|
78
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
79
|
+
end
|
80
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
81
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
82
|
+
sub_type = Regexp.last_match[:sub_type]
|
83
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
84
|
+
end
|
85
|
+
else # model
|
86
|
+
const = OryHydraClient.const_get(klass)
|
87
|
+
if const
|
88
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
89
|
+
model = const.build(data)
|
90
|
+
return model if model
|
91
|
+
else
|
92
|
+
# raise if data contains keys that are not known to the model
|
93
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
94
|
+
model = const.build_from_hash(data)
|
95
|
+
return model if model && model.valid?
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
raise # if no match by now, raise
|
101
|
+
rescue
|
102
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory APIs
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.1-alpha.1
|
7
|
+
Contact: support@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
class UiNodeImageAttributes
|
18
|
+
# The image's source URL. format: uri
|
19
|
+
attr_accessor :src
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'src' => :'src'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'src' => :'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::UiNodeImageAttributes` 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::UiNodeImageAttributes`. 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?(:'src')
|
62
|
+
self.src = attributes[:'src']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
if @src.nil?
|
71
|
+
invalid_properties.push('invalid value for "src", src cannot be nil.')
|
72
|
+
end
|
73
|
+
|
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
|
+
return false if @src.nil?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
src == o.src
|
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
|
+
[src].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 attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
118
|
+
self.send("#{key}=", nil)
|
119
|
+
elsif 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
|
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 :Time
|
140
|
+
Time.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
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = OryHydraClient.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the string representation of the object
|
177
|
+
# @return [String] String presentation of the object
|
178
|
+
def to_s
|
179
|
+
to_hash.to_s
|
180
|
+
end
|
181
|
+
|
182
|
+
# to_body is an alias to to_hash (backward compatibility)
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_body
|
185
|
+
to_hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the object in the form of hash
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_hash
|
191
|
+
hash = {}
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
193
|
+
value = self.send(attr)
|
194
|
+
if value.nil?
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
197
|
+
end
|
198
|
+
|
199
|
+
hash[param] = _to_hash(value)
|
200
|
+
end
|
201
|
+
hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Outputs non-array value in the form of hash
|
205
|
+
# For object, use to_hash. Otherwise, just return the value
|
206
|
+
# @param [Object] value Any valid value
|
207
|
+
# @return [Hash] Returns the value in the form of hash
|
208
|
+
def _to_hash(value)
|
209
|
+
if value.is_a?(Array)
|
210
|
+
value.compact.map { |v| _to_hash(v) }
|
211
|
+
elsif value.is_a?(Hash)
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
214
|
+
end
|
215
|
+
elsif value.respond_to? :to_hash
|
216
|
+
value.to_hash
|
217
|
+
else
|
218
|
+
value
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
@@ -0,0 +1,292 @@
|
|
1
|
+
=begin
|
2
|
+
#Ory APIs
|
3
|
+
|
4
|
+
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v0.0.1-alpha.1
|
7
|
+
Contact: support@ory.sh
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OryHydraClient
|
17
|
+
# InputAttributes represents the attributes of an input node
|
18
|
+
class UiNodeInputAttributes
|
19
|
+
# Sets the input's disabled field to true or false.
|
20
|
+
attr_accessor :disabled
|
21
|
+
|
22
|
+
attr_accessor :label
|
23
|
+
|
24
|
+
# The input's element name.
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# The input's pattern.
|
28
|
+
attr_accessor :pattern
|
29
|
+
|
30
|
+
# Mark this input field as required.
|
31
|
+
attr_accessor :required
|
32
|
+
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
attr_accessor :value
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'disabled' => :'disabled',
|
41
|
+
:'label' => :'label',
|
42
|
+
:'name' => :'name',
|
43
|
+
:'pattern' => :'pattern',
|
44
|
+
:'required' => :'required',
|
45
|
+
:'type' => :'type',
|
46
|
+
:'value' => :'value'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns all the JSON keys this model knows about
|
51
|
+
def self.acceptable_attributes
|
52
|
+
attribute_map.values
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute type mapping.
|
56
|
+
def self.openapi_types
|
57
|
+
{
|
58
|
+
:'disabled' => :'Boolean',
|
59
|
+
:'label' => :'UiText',
|
60
|
+
:'name' => :'String',
|
61
|
+
:'pattern' => :'String',
|
62
|
+
:'required' => :'Boolean',
|
63
|
+
:'type' => :'String',
|
64
|
+
:'value' => :'UiNodeInputAttributesValue'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# List of attributes with nullable: true
|
69
|
+
def self.openapi_nullable
|
70
|
+
Set.new([
|
71
|
+
])
|
72
|
+
end
|
73
|
+
|
74
|
+
# Initializes the object
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
+
def initialize(attributes = {})
|
77
|
+
if (!attributes.is_a?(Hash))
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::UiNodeInputAttributes` initialize method"
|
79
|
+
end
|
80
|
+
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
83
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::UiNodeInputAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
85
|
+
end
|
86
|
+
h[k.to_sym] = v
|
87
|
+
}
|
88
|
+
|
89
|
+
if attributes.key?(:'disabled')
|
90
|
+
self.disabled = attributes[:'disabled']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'label')
|
94
|
+
self.label = attributes[:'label']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'name')
|
98
|
+
self.name = attributes[:'name']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'pattern')
|
102
|
+
self.pattern = attributes[:'pattern']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'required')
|
106
|
+
self.required = attributes[:'required']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'type')
|
110
|
+
self.type = attributes[:'type']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'value')
|
114
|
+
self.value = attributes[:'value']
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
119
|
+
# @return Array for valid properties with the reasons
|
120
|
+
def list_invalid_properties
|
121
|
+
invalid_properties = Array.new
|
122
|
+
if @disabled.nil?
|
123
|
+
invalid_properties.push('invalid value for "disabled", disabled cannot be nil.')
|
124
|
+
end
|
125
|
+
|
126
|
+
if @name.nil?
|
127
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
128
|
+
end
|
129
|
+
|
130
|
+
if @type.nil?
|
131
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
132
|
+
end
|
133
|
+
|
134
|
+
invalid_properties
|
135
|
+
end
|
136
|
+
|
137
|
+
# Check to see if the all the properties in the model are valid
|
138
|
+
# @return true if the model is valid
|
139
|
+
def valid?
|
140
|
+
return false if @disabled.nil?
|
141
|
+
return false if @name.nil?
|
142
|
+
return false if @type.nil?
|
143
|
+
true
|
144
|
+
end
|
145
|
+
|
146
|
+
# Checks equality by comparing each attribute.
|
147
|
+
# @param [Object] Object to be compared
|
148
|
+
def ==(o)
|
149
|
+
return true if self.equal?(o)
|
150
|
+
self.class == o.class &&
|
151
|
+
disabled == o.disabled &&
|
152
|
+
label == o.label &&
|
153
|
+
name == o.name &&
|
154
|
+
pattern == o.pattern &&
|
155
|
+
required == o.required &&
|
156
|
+
type == o.type &&
|
157
|
+
value == o.value
|
158
|
+
end
|
159
|
+
|
160
|
+
# @see the `==` method
|
161
|
+
# @param [Object] Object to be compared
|
162
|
+
def eql?(o)
|
163
|
+
self == o
|
164
|
+
end
|
165
|
+
|
166
|
+
# Calculates hash code according to all attributes.
|
167
|
+
# @return [Integer] Hash code
|
168
|
+
def hash
|
169
|
+
[disabled, label, name, pattern, required, type, value].hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Builds the object from hash
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
174
|
+
# @return [Object] Returns the model itself
|
175
|
+
def self.build_from_hash(attributes)
|
176
|
+
new.build_from_hash(attributes)
|
177
|
+
end
|
178
|
+
|
179
|
+
# Builds the object from hash
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
+
# @return [Object] Returns the model itself
|
182
|
+
def build_from_hash(attributes)
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
184
|
+
self.class.openapi_types.each_pair do |key, type|
|
185
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
186
|
+
self.send("#{key}=", nil)
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
188
|
+
# check to ensure the input is an array given that the attribute
|
189
|
+
# is documented as an array but the input is not
|
190
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
191
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
192
|
+
end
|
193
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
194
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
self
|
199
|
+
end
|
200
|
+
|
201
|
+
# Deserializes the data based on type
|
202
|
+
# @param string type Data type
|
203
|
+
# @param string value Value to be deserialized
|
204
|
+
# @return [Object] Deserialized data
|
205
|
+
def _deserialize(type, value)
|
206
|
+
case type.to_sym
|
207
|
+
when :Time
|
208
|
+
Time.parse(value)
|
209
|
+
when :Date
|
210
|
+
Date.parse(value)
|
211
|
+
when :String
|
212
|
+
value.to_s
|
213
|
+
when :Integer
|
214
|
+
value.to_i
|
215
|
+
when :Float
|
216
|
+
value.to_f
|
217
|
+
when :Boolean
|
218
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
219
|
+
true
|
220
|
+
else
|
221
|
+
false
|
222
|
+
end
|
223
|
+
when :Object
|
224
|
+
# generic object (usually a Hash), return directly
|
225
|
+
value
|
226
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
227
|
+
inner_type = Regexp.last_match[:inner_type]
|
228
|
+
value.map { |v| _deserialize(inner_type, v) }
|
229
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
230
|
+
k_type = Regexp.last_match[:k_type]
|
231
|
+
v_type = Regexp.last_match[:v_type]
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each do |k, v|
|
234
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
else # model
|
238
|
+
# models (e.g. Pet) or oneOf
|
239
|
+
klass = OryHydraClient.const_get(type)
|
240
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the string representation of the object
|
245
|
+
# @return [String] String presentation of the object
|
246
|
+
def to_s
|
247
|
+
to_hash.to_s
|
248
|
+
end
|
249
|
+
|
250
|
+
# to_body is an alias to to_hash (backward compatibility)
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_body
|
253
|
+
to_hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the object in the form of hash
|
257
|
+
# @return [Hash] Returns the object in the form of hash
|
258
|
+
def to_hash
|
259
|
+
hash = {}
|
260
|
+
self.class.attribute_map.each_pair do |attr, param|
|
261
|
+
value = self.send(attr)
|
262
|
+
if value.nil?
|
263
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
264
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
265
|
+
end
|
266
|
+
|
267
|
+
hash[param] = _to_hash(value)
|
268
|
+
end
|
269
|
+
hash
|
270
|
+
end
|
271
|
+
|
272
|
+
# Outputs non-array value in the form of hash
|
273
|
+
# For object, use to_hash. Otherwise, just return the value
|
274
|
+
# @param [Object] value Any valid value
|
275
|
+
# @return [Hash] Returns the value in the form of hash
|
276
|
+
def _to_hash(value)
|
277
|
+
if value.is_a?(Array)
|
278
|
+
value.compact.map { |v| _to_hash(v) }
|
279
|
+
elsif value.is_a?(Hash)
|
280
|
+
{}.tap do |hash|
|
281
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
282
|
+
end
|
283
|
+
elsif value.respond_to? :to_hash
|
284
|
+
value.to_hash
|
285
|
+
else
|
286
|
+
value
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
end
|
291
|
+
|
292
|
+
end
|