kinde_sdk 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +128 -0
- data/README.md +12 -434
- data/kinde_api/README.md +98 -27
- data/kinde_api/docs/APIsApi.md +356 -0
- data/kinde_api/docs/AddAPIsRequest.md +20 -0
- data/kinde_api/docs/Api.md +28 -0
- data/kinde_api/docs/ApiApplicationsInner.md +24 -0
- data/kinde_api/docs/Apis.md +24 -0
- data/kinde_api/docs/Applications.md +22 -0
- data/kinde_api/docs/ApplicationsApi.md +368 -0
- data/kinde_api/docs/BusinessApi.md +183 -0
- data/kinde_api/docs/CallbacksApi.md +385 -25
- data/kinde_api/docs/CreateApplicationRequest.md +20 -0
- data/kinde_api/docs/CreateApplicationResponse.md +22 -0
- data/kinde_api/docs/CreateApplicationResponseApplication.md +22 -0
- data/kinde_api/docs/CreateFeatureFlagRequest.md +28 -0
- data/kinde_api/docs/CreateOrganizationRequest.md +3 -1
- data/kinde_api/docs/CreateOrganizationUserPermissionRequest.md +18 -0
- data/kinde_api/docs/EnvironmentsApi.md +23 -23
- data/kinde_api/docs/FeatureFlagsApi.md +19 -29
- data/kinde_api/docs/GetApplicationResponse.md +22 -0
- data/kinde_api/docs/GetApplicationResponseApplication.md +26 -0
- data/kinde_api/docs/GetApplicationsResponse.md +2 -2
- data/kinde_api/docs/{GetOrganizationsUsersResponse.md → GetOrganizationUsersResponse.md} +2 -2
- data/kinde_api/docs/GetOrganizationsUserPermissionsResponse.md +22 -0
- data/kinde_api/docs/GetPermissionsResponse.md +24 -0
- data/kinde_api/docs/GetRolesResponse.md +24 -0
- data/kinde_api/docs/GetSubscriberResponse.md +22 -0
- data/kinde_api/docs/GetSubscribersResponse.md +24 -0
- data/kinde_api/docs/IndustriesApi.md +81 -0
- data/kinde_api/docs/LogoutRedirectUrls.md +18 -0
- data/kinde_api/docs/OAuthApi.md +153 -4
- data/kinde_api/docs/Organization.md +3 -1
- data/kinde_api/docs/OrganizationUserPermission.md +26 -0
- data/kinde_api/docs/OrganizationUserPermissionRolesInner.md +20 -0
- data/kinde_api/docs/OrganizationUserRolePermissions.md +22 -0
- data/kinde_api/docs/OrganizationUserRolePermissionsPermissions.md +18 -0
- data/kinde_api/docs/OrganizationsApi.md +328 -32
- data/kinde_api/docs/PermissionsApi.md +84 -14
- data/kinde_api/docs/ReplaceLogoutRedirectURLsRequest.md +18 -0
- data/kinde_api/docs/ReplaceRedirectCallbackURLsRequest.md +18 -0
- data/kinde_api/docs/Role.md +24 -0
- data/kinde_api/docs/Roles.md +2 -0
- data/kinde_api/docs/RolesApi.md +309 -17
- data/kinde_api/docs/RolesPermissionResponseInner.md +24 -0
- data/kinde_api/docs/Subscriber.md +24 -0
- data/kinde_api/docs/SubscribersApi.md +12 -14
- data/kinde_api/docs/SubscribersSubscriber.md +26 -0
- data/kinde_api/docs/TimezonesApi.md +81 -0
- data/kinde_api/docs/TokenErrorResponse.md +20 -0
- data/kinde_api/docs/TokenIntrospect.md +26 -0
- data/kinde_api/docs/UpdateAPIApplicationsRequest.md +18 -0
- data/kinde_api/docs/UpdateAPIApplicationsRequestApplicationsInner.md +20 -0
- data/kinde_api/docs/UpdateApplicationRequest.md +24 -0
- data/kinde_api/docs/UpdateEnvironementFeatureFlagOverrideRequest.md +18 -0
- data/kinde_api/docs/UpdateOrganizationRequest.md +3 -1
- data/kinde_api/docs/UpdateOrganizationUsersRequest.md +1 -1
- data/kinde_api/docs/UpdateRolePermissionsRequest.md +18 -0
- data/kinde_api/docs/UpdateRolePermissionsRequestPermissionsInner.md +20 -0
- data/kinde_api/docs/UpdateRolePermissionsResponse.md +24 -0
- data/kinde_api/docs/UpdateRolesRequest.md +24 -0
- data/kinde_api/docs/UpdateUserResponse.md +30 -0
- data/kinde_api/docs/User.md +7 -7
- data/kinde_api/docs/UserIdentitiesInner.md +20 -0
- data/kinde_api/docs/UsersApi.md +93 -15
- data/kinde_api/docs/UsersResponse.md +1 -1
- data/kinde_api/docs/UsersResponseUsersInner.md +42 -0
- data/kinde_api/lib/kinde_api/api/apis_api.rb +347 -0
- data/kinde_api/lib/kinde_api/api/applications_api.rb +352 -0
- data/kinde_api/lib/kinde_api/api/business_api.rb +210 -0
- data/kinde_api/lib/kinde_api/api/callbacks_api.rb +394 -31
- data/kinde_api/lib/kinde_api/api/environments_api.rb +22 -18
- data/kinde_api/lib/kinde_api/api/feature_flags_api.rb +20 -61
- data/kinde_api/lib/kinde_api/api/industries_api.rb +85 -0
- data/kinde_api/lib/kinde_api/api/o_auth_api.rb +141 -2
- data/kinde_api/lib/kinde_api/api/organizations_api.rb +318 -25
- data/kinde_api/lib/kinde_api/api/permissions_api.rb +75 -12
- data/kinde_api/lib/kinde_api/api/roles_api.rb +297 -15
- data/kinde_api/lib/kinde_api/api/subscribers_api.rb +8 -11
- data/kinde_api/lib/kinde_api/api/timezones_api.rb +85 -0
- data/kinde_api/lib/kinde_api/api/users_api.rb +87 -11
- data/kinde_api/lib/kinde_api/api_client.rb +14 -7
- data/kinde_api/lib/kinde_api/configuration.rb +81 -5
- data/kinde_api/lib/kinde_api/models/add_apis_request.rb +238 -0
- data/kinde_api/lib/kinde_api/models/add_organization_users_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/add_organization_users_request_users_inner.rb +2 -0
- data/kinde_api/lib/kinde_api/models/add_organization_users_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/api.rb +271 -0
- data/kinde_api/lib/kinde_api/models/api_applications_inner.rb +246 -0
- data/kinde_api/lib/kinde_api/models/api_result.rb +2 -0
- data/kinde_api/lib/kinde_api/models/apis.rb +250 -0
- data/kinde_api/lib/kinde_api/models/applications.rb +237 -0
- data/kinde_api/lib/kinde_api/models/connected_apps_access_token.rb +2 -0
- data/kinde_api/lib/kinde_api/models/connected_apps_auth_url.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_application_request.rb +264 -0
- data/kinde_api/lib/kinde_api/models/create_application_response.rb +239 -0
- data/kinde_api/lib/kinde_api/models/create_application_response_application.rb +240 -0
- data/kinde_api/lib/kinde_api/models/create_feature_flag_request.rb +336 -0
- data/kinde_api/lib/kinde_api/models/create_organization_request.rb +16 -4
- data/kinde_api/lib/kinde_api/models/create_organization_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_organization_response_organization.rb +2 -0
- data/kinde_api/lib/kinde_api/models/{application.rb → create_organization_user_permission_request.rb} +13 -19
- data/kinde_api/lib/kinde_api/models/create_organization_user_role_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_permission_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_role_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_subscriber_success_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_subscriber_success_response_subscriber.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_user_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner_details.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_user_request_profile.rb +2 -0
- data/kinde_api/lib/kinde_api/models/create_user_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/error.rb +2 -0
- data/kinde_api/lib/kinde_api/models/error_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_application_response.rb +239 -0
- data/kinde_api/lib/kinde_api/models/get_application_response_application.rb +260 -0
- data/kinde_api/lib/kinde_api/models/get_applications_response.rb +10 -8
- data/kinde_api/lib/kinde_api/models/get_environment_feature_flags_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_organization_feature_flags_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_organization_feature_flags_response_feature_flags_value.rb +2 -0
- data/kinde_api/lib/kinde_api/models/{get_organizations_users_response.rb → get_organization_users_response.rb} +5 -3
- data/kinde_api/lib/kinde_api/models/get_organizations_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_organizations_user_permissions_response.rb +241 -0
- data/kinde_api/lib/kinde_api/models/get_organizations_user_roles_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_permissions_response.rb +251 -0
- data/kinde_api/lib/kinde_api/models/get_redirect_callback_urls_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/get_roles_response.rb +251 -0
- data/kinde_api/lib/kinde_api/models/get_subscriber_response.rb +241 -0
- data/kinde_api/lib/kinde_api/models/get_subscribers_response.rb +251 -0
- data/kinde_api/lib/kinde_api/models/logout_redirect_urls.rb +222 -0
- data/kinde_api/lib/kinde_api/models/organization.rb +15 -4
- data/kinde_api/lib/kinde_api/models/organization_user.rb +2 -0
- data/kinde_api/lib/kinde_api/models/organization_user_permission.rb +257 -0
- data/kinde_api/lib/kinde_api/models/organization_user_permission_roles_inner.rb +228 -0
- data/kinde_api/lib/kinde_api/models/organization_user_role.rb +2 -0
- data/kinde_api/lib/kinde_api/models/organization_user_role_permissions.rb +237 -0
- data/kinde_api/lib/kinde_api/models/organization_user_role_permissions_permissions.rb +219 -0
- data/kinde_api/lib/kinde_api/models/permissions.rb +2 -0
- data/kinde_api/lib/kinde_api/models/redirect_callback_urls.rb +2 -0
- data/kinde_api/lib/kinde_api/models/replace_logout_redirect_urls_request.rb +222 -0
- data/kinde_api/lib/kinde_api/models/replace_redirect_callback_urls_request.rb +222 -0
- data/kinde_api/lib/kinde_api/models/role.rb +246 -0
- data/kinde_api/lib/kinde_api/models/roles.rb +13 -1
- data/kinde_api/lib/kinde_api/models/roles_permission_response_inner.rb +246 -0
- data/kinde_api/lib/kinde_api/models/subscriber.rb +246 -0
- data/kinde_api/lib/kinde_api/models/subscribers_subscriber.rb +255 -0
- data/kinde_api/lib/kinde_api/models/success_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/token_error_response.rb +230 -0
- data/kinde_api/lib/kinde_api/models/token_introspect.rb +262 -0
- data/kinde_api/lib/kinde_api/models/update_api_applications_request.rb +226 -0
- data/kinde_api/lib/kinde_api/models/update_api_applications_request_applications_inner.rb +235 -0
- data/kinde_api/lib/kinde_api/models/update_application_request.rb +254 -0
- data/kinde_api/lib/kinde_api/models/update_environement_feature_flag_override_request.rb +225 -0
- data/kinde_api/lib/kinde_api/models/update_organization_request.rb +16 -4
- data/kinde_api/lib/kinde_api/models/update_organization_users_request.rb +3 -1
- data/kinde_api/lib/kinde_api/models/update_organization_users_request_users_inner.rb +2 -0
- data/kinde_api/lib/kinde_api/models/update_organization_users_response.rb +2 -0
- data/kinde_api/lib/kinde_api/models/update_role_permissions_request.rb +222 -0
- data/kinde_api/lib/kinde_api/models/update_role_permissions_request_permissions_inner.rb +230 -0
- data/kinde_api/lib/kinde_api/models/update_role_permissions_response.rb +250 -0
- data/kinde_api/lib/kinde_api/models/update_roles_request.rb +260 -0
- data/kinde_api/lib/kinde_api/models/update_user_request.rb +2 -0
- data/kinde_api/lib/kinde_api/models/update_user_response.rb +280 -0
- data/kinde_api/lib/kinde_api/models/user.rb +37 -32
- data/kinde_api/lib/kinde_api/models/user_identities_inner.rb +228 -0
- data/kinde_api/lib/kinde_api/models/user_identity.rb +2 -0
- data/kinde_api/lib/kinde_api/models/user_identity_result.rb +2 -0
- data/kinde_api/lib/kinde_api/models/user_profile.rb +2 -0
- data/kinde_api/lib/kinde_api/models/user_profile_v2.rb +2 -0
- data/kinde_api/lib/kinde_api/models/users_response.rb +3 -1
- data/kinde_api/lib/kinde_api/models/users_response_users_inner.rb +348 -0
- data/kinde_api/lib/kinde_api.rb +47 -2
- data/kinde_api/spec/api/apis_api_spec.rb +95 -0
- data/kinde_api/spec/api/applications_api_spec.rb +98 -0
- data/kinde_api/spec/api/business_api_spec.rb +75 -0
- data/kinde_api/spec/api/callbacks_api_spec.rb +69 -5
- data/kinde_api/spec/api/environments_api_spec.rb +5 -5
- data/kinde_api/spec/api/feature_flags_api_spec.rb +4 -9
- data/kinde_api/spec/api/industries_api_spec.rb +48 -0
- data/kinde_api/spec/api/o_auth_api_spec.rb +28 -1
- data/kinde_api/spec/api/organizations_api_spec.rb +63 -8
- data/kinde_api/spec/api/permissions_api_spec.rb +16 -4
- data/kinde_api/spec/api/roles_api_spec.rb +57 -4
- data/kinde_api/spec/api/subscribers_api_spec.rb +3 -4
- data/kinde_api/spec/api/timezones_api_spec.rb +48 -0
- data/kinde_api/spec/api/users_api_spec.rb +17 -2
- data/kinde_api/spec/api_client_spec.rb +13 -2
- data/kinde_api/spec/models/{application_spec.rb → add_apis_request_spec.rb} +8 -8
- data/kinde_api/spec/models/api_applications_inner_spec.rb +52 -0
- data/kinde_api/spec/models/api_spec.rb +64 -0
- data/kinde_api/spec/models/apis_spec.rb +52 -0
- data/kinde_api/spec/models/applications_spec.rb +46 -0
- data/kinde_api/spec/models/create_application_request_spec.rb +44 -0
- data/kinde_api/spec/models/create_application_response_application_spec.rb +46 -0
- data/kinde_api/spec/models/create_application_response_spec.rb +46 -0
- data/kinde_api/spec/models/create_feature_flag_request_spec.rb +72 -0
- data/kinde_api/spec/models/create_organization_request_spec.rb +6 -0
- data/kinde_api/spec/models/create_organization_user_permission_request_spec.rb +34 -0
- data/kinde_api/spec/models/get_application_response_application_spec.rb +58 -0
- data/kinde_api/spec/models/get_application_response_spec.rb +46 -0
- data/kinde_api/spec/models/get_applications_response_spec.rb +1 -1
- data/kinde_api/spec/models/{get_organizations_users_response_spec.rb → get_organization_users_response_spec.rb} +6 -6
- data/kinde_api/spec/models/get_organizations_user_permissions_response_spec.rb +46 -0
- data/kinde_api/spec/models/get_permissions_response_spec.rb +52 -0
- data/kinde_api/spec/models/get_roles_response_spec.rb +52 -0
- data/kinde_api/spec/models/get_subscriber_response_spec.rb +46 -0
- data/kinde_api/spec/models/get_subscribers_response_spec.rb +52 -0
- data/kinde_api/spec/models/logout_redirect_urls_spec.rb +34 -0
- data/kinde_api/spec/models/organization_spec.rb +6 -0
- data/kinde_api/spec/models/organization_user_permission_roles_inner_spec.rb +40 -0
- data/kinde_api/spec/models/organization_user_permission_spec.rb +58 -0
- data/kinde_api/spec/models/organization_user_role_permissions_permissions_spec.rb +34 -0
- data/kinde_api/spec/models/organization_user_role_permissions_spec.rb +46 -0
- data/kinde_api/spec/models/replace_logout_redirect_urls_request_spec.rb +34 -0
- data/kinde_api/spec/models/replace_redirect_callback_urls_request_spec.rb +34 -0
- data/kinde_api/spec/models/role_spec.rb +52 -0
- data/kinde_api/spec/models/roles_permission_response_inner_spec.rb +52 -0
- data/kinde_api/spec/models/roles_spec.rb +6 -0
- data/kinde_api/spec/models/subscriber_spec.rb +52 -0
- data/kinde_api/spec/models/subscribers_subscriber_spec.rb +58 -0
- data/kinde_api/spec/models/token_error_response_spec.rb +40 -0
- data/kinde_api/spec/models/token_introspect_spec.rb +58 -0
- data/kinde_api/spec/models/update_api_applications_request_applications_inner_spec.rb +40 -0
- data/kinde_api/spec/models/update_api_applications_request_spec.rb +34 -0
- data/kinde_api/spec/models/update_application_request_spec.rb +52 -0
- data/kinde_api/spec/models/update_environement_feature_flag_override_request_spec.rb +34 -0
- data/kinde_api/spec/models/update_organization_request_spec.rb +6 -0
- data/kinde_api/spec/models/update_role_permissions_request_permissions_inner_spec.rb +40 -0
- data/kinde_api/spec/models/update_role_permissions_request_spec.rb +34 -0
- data/kinde_api/spec/models/update_role_permissions_response_spec.rb +52 -0
- data/kinde_api/spec/models/update_roles_request_spec.rb +52 -0
- data/kinde_api/spec/models/update_user_response_spec.rb +70 -0
- data/kinde_api/spec/models/user_identities_inner_spec.rb +40 -0
- data/kinde_api/spec/models/user_spec.rb +9 -9
- data/kinde_api/spec/models/users_response_users_inner_spec.rb +106 -0
- data/kinde_sdk.gemspec +1 -1
- data/lib/kinde_sdk/version.rb +1 -1
- data/spec/kinde_sdk_spec.rb +0 -46
- metadata +193 -12
- data/kinde_api/docs/Application.md +0 -20
@@ -0,0 +1,280 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module KindeApi
|
17
|
+
class UpdateUserResponse
|
18
|
+
# Unique id of the user in Kinde.
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# User's first name.
|
22
|
+
attr_accessor :given_name
|
23
|
+
|
24
|
+
# User's last name.
|
25
|
+
attr_accessor :family_name
|
26
|
+
|
27
|
+
# User's preferred email.
|
28
|
+
attr_accessor :email
|
29
|
+
|
30
|
+
# Whether the user is currently suspended or not.
|
31
|
+
attr_accessor :is_suspended
|
32
|
+
|
33
|
+
# Whether a password reset has been requested.
|
34
|
+
attr_accessor :is_password_reset_requested
|
35
|
+
|
36
|
+
# User's profile picture URL.
|
37
|
+
attr_accessor :picture
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'id' => :'id',
|
43
|
+
:'given_name' => :'given_name',
|
44
|
+
:'family_name' => :'family_name',
|
45
|
+
:'email' => :'email',
|
46
|
+
:'is_suspended' => :'is_suspended',
|
47
|
+
:'is_password_reset_requested' => :'is_password_reset_requested',
|
48
|
+
:'picture' => :'picture'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'id' => :'String',
|
61
|
+
:'given_name' => :'String',
|
62
|
+
:'family_name' => :'String',
|
63
|
+
:'email' => :'String',
|
64
|
+
:'is_suspended' => :'Boolean',
|
65
|
+
:'is_password_reset_requested' => :'Boolean',
|
66
|
+
:'picture' => :'String'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# List of attributes with nullable: true
|
71
|
+
def self.openapi_nullable
|
72
|
+
Set.new([
|
73
|
+
])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Initializes the object
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
78
|
+
def initialize(attributes = {})
|
79
|
+
if (!attributes.is_a?(Hash))
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KindeApi::UpdateUserResponse` initialize method"
|
81
|
+
end
|
82
|
+
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KindeApi::UpdateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
|
+
end
|
88
|
+
h[k.to_sym] = v
|
89
|
+
}
|
90
|
+
|
91
|
+
if attributes.key?(:'id')
|
92
|
+
self.id = attributes[:'id']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'given_name')
|
96
|
+
self.given_name = attributes[:'given_name']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'family_name')
|
100
|
+
self.family_name = attributes[:'family_name']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'email')
|
104
|
+
self.email = attributes[:'email']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'is_suspended')
|
108
|
+
self.is_suspended = attributes[:'is_suspended']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'is_password_reset_requested')
|
112
|
+
self.is_password_reset_requested = attributes[:'is_password_reset_requested']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'picture')
|
116
|
+
self.picture = attributes[:'picture']
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
121
|
+
# @return Array for valid properties with the reasons
|
122
|
+
def list_invalid_properties
|
123
|
+
invalid_properties = Array.new
|
124
|
+
invalid_properties
|
125
|
+
end
|
126
|
+
|
127
|
+
# Check to see if the all the properties in the model are valid
|
128
|
+
# @return true if the model is valid
|
129
|
+
def valid?
|
130
|
+
true
|
131
|
+
end
|
132
|
+
|
133
|
+
# Checks equality by comparing each attribute.
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def ==(o)
|
136
|
+
return true if self.equal?(o)
|
137
|
+
self.class == o.class &&
|
138
|
+
id == o.id &&
|
139
|
+
given_name == o.given_name &&
|
140
|
+
family_name == o.family_name &&
|
141
|
+
email == o.email &&
|
142
|
+
is_suspended == o.is_suspended &&
|
143
|
+
is_password_reset_requested == o.is_password_reset_requested &&
|
144
|
+
picture == o.picture
|
145
|
+
end
|
146
|
+
|
147
|
+
# @see the `==` method
|
148
|
+
# @param [Object] Object to be compared
|
149
|
+
def eql?(o)
|
150
|
+
self == o
|
151
|
+
end
|
152
|
+
|
153
|
+
# Calculates hash code according to all attributes.
|
154
|
+
# @return [Integer] Hash code
|
155
|
+
def hash
|
156
|
+
[id, given_name, family_name, email, is_suspended, is_password_reset_requested, picture].hash
|
157
|
+
end
|
158
|
+
|
159
|
+
# Builds the object from hash
|
160
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
161
|
+
# @return [Object] Returns the model itself
|
162
|
+
def self.build_from_hash(attributes)
|
163
|
+
new.build_from_hash(attributes)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Builds the object from hash
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
+
# @return [Object] Returns the model itself
|
169
|
+
def build_from_hash(attributes)
|
170
|
+
return nil unless attributes.is_a?(Hash)
|
171
|
+
attributes = attributes.transform_keys(&:to_sym)
|
172
|
+
self.class.openapi_types.each_pair do |key, type|
|
173
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
|
+
self.send("#{key}=", nil)
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
176
|
+
# check to ensure the input is an array given that the attribute
|
177
|
+
# is documented as an array but the input is not
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
+
end
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Deserializes the data based on type
|
190
|
+
# @param string type Data type
|
191
|
+
# @param string value Value to be deserialized
|
192
|
+
# @return [Object] Deserialized data
|
193
|
+
def _deserialize(type, value)
|
194
|
+
case type.to_sym
|
195
|
+
when :Time
|
196
|
+
Time.parse(value)
|
197
|
+
when :Date
|
198
|
+
Date.parse(value)
|
199
|
+
when :String
|
200
|
+
value.to_s
|
201
|
+
when :Integer
|
202
|
+
value.to_i
|
203
|
+
when :Float
|
204
|
+
value.to_f
|
205
|
+
when :Boolean
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
+
true
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
when :Object
|
212
|
+
# generic object (usually a Hash), return directly
|
213
|
+
value
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each do |k, v|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
else # model
|
226
|
+
# models (e.g. Pet) or oneOf
|
227
|
+
klass = KindeApi.const_get(type)
|
228
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the string representation of the object
|
233
|
+
# @return [String] String presentation of the object
|
234
|
+
def to_s
|
235
|
+
to_hash.to_s
|
236
|
+
end
|
237
|
+
|
238
|
+
# to_body is an alias to to_hash (backward compatibility)
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_body
|
241
|
+
to_hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the object in the form of hash
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_hash
|
247
|
+
hash = {}
|
248
|
+
self.class.attribute_map.each_pair do |attr, param|
|
249
|
+
value = self.send(attr)
|
250
|
+
if value.nil?
|
251
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
252
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
253
|
+
end
|
254
|
+
|
255
|
+
hash[param] = _to_hash(value)
|
256
|
+
end
|
257
|
+
hash
|
258
|
+
end
|
259
|
+
|
260
|
+
# Outputs non-array value in the form of hash
|
261
|
+
# For object, use to_hash. Otherwise, just return the value
|
262
|
+
# @param [Object] value Any valid value
|
263
|
+
# @return [Hash] Returns the value in the form of hash
|
264
|
+
def _to_hash(value)
|
265
|
+
if value.is_a?(Array)
|
266
|
+
value.compact.map { |v| _to_hash(v) }
|
267
|
+
elsif value.is_a?(Hash)
|
268
|
+
{}.tap do |hash|
|
269
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
270
|
+
end
|
271
|
+
elsif value.respond_to? :to_hash
|
272
|
+
value.to_hash
|
273
|
+
else
|
274
|
+
value
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
@@ -22,7 +22,7 @@ module KindeApi
|
|
22
22
|
attr_accessor :provided_id
|
23
23
|
|
24
24
|
# Default email address of the user in Kinde.
|
25
|
-
attr_accessor :
|
25
|
+
attr_accessor :preferred_email
|
26
26
|
|
27
27
|
# User's last name.
|
28
28
|
attr_accessor :last_name
|
@@ -30,18 +30,12 @@ module KindeApi
|
|
30
30
|
# User's first name.
|
31
31
|
attr_accessor :first_name
|
32
32
|
|
33
|
-
# User's full name.
|
34
|
-
attr_accessor :full_name
|
35
|
-
|
36
33
|
# Whether the user is currently suspended or not.
|
37
34
|
attr_accessor :is_suspended
|
38
35
|
|
39
36
|
# User's profile picture URL.
|
40
37
|
attr_accessor :picture
|
41
38
|
|
42
|
-
# Whether the user has been asked to reset their password.
|
43
|
-
attr_accessor :is_password_reset_requested
|
44
|
-
|
45
39
|
# Total number of user sign ins.
|
46
40
|
attr_accessor :total_sign_ins
|
47
41
|
|
@@ -54,22 +48,28 @@ module KindeApi
|
|
54
48
|
# Date of user creation in ISO 8601 format.
|
55
49
|
attr_accessor :created_on
|
56
50
|
|
51
|
+
# Array of organizations a user belongs to.
|
52
|
+
attr_accessor :organizations
|
53
|
+
|
54
|
+
# Array of identities belonging to the user.
|
55
|
+
attr_accessor :identities
|
56
|
+
|
57
57
|
# Attribute mapping from ruby-style variable name to JSON key.
|
58
58
|
def self.attribute_map
|
59
59
|
{
|
60
60
|
:'id' => :'id',
|
61
61
|
:'provided_id' => :'provided_id',
|
62
|
-
:'
|
62
|
+
:'preferred_email' => :'preferred_email',
|
63
63
|
:'last_name' => :'last_name',
|
64
64
|
:'first_name' => :'first_name',
|
65
|
-
:'full_name' => :'full_name',
|
66
65
|
:'is_suspended' => :'is_suspended',
|
67
66
|
:'picture' => :'picture',
|
68
|
-
:'is_password_reset_requested' => :'is_password_reset_requested',
|
69
67
|
:'total_sign_ins' => :'total_sign_ins',
|
70
68
|
:'failed_sign_ins' => :'failed_sign_ins',
|
71
69
|
:'last_signed_in' => :'last_signed_in',
|
72
|
-
:'created_on' => :'created_on'
|
70
|
+
:'created_on' => :'created_on',
|
71
|
+
:'organizations' => :'organizations',
|
72
|
+
:'identities' => :'identities'
|
73
73
|
}
|
74
74
|
end
|
75
75
|
|
@@ -83,28 +83,27 @@ module KindeApi
|
|
83
83
|
{
|
84
84
|
:'id' => :'String',
|
85
85
|
:'provided_id' => :'String',
|
86
|
-
:'
|
86
|
+
:'preferred_email' => :'String',
|
87
87
|
:'last_name' => :'String',
|
88
88
|
:'first_name' => :'String',
|
89
|
-
:'full_name' => :'String',
|
90
89
|
:'is_suspended' => :'Boolean',
|
91
90
|
:'picture' => :'String',
|
92
|
-
:'is_password_reset_requested' => :'Boolean',
|
93
91
|
:'total_sign_ins' => :'Integer',
|
94
92
|
:'failed_sign_ins' => :'Integer',
|
95
93
|
:'last_signed_in' => :'String',
|
96
|
-
:'created_on' => :'String'
|
94
|
+
:'created_on' => :'String',
|
95
|
+
:'organizations' => :'Array<String>',
|
96
|
+
:'identities' => :'Array<UserIdentitiesInner>'
|
97
97
|
}
|
98
98
|
end
|
99
99
|
|
100
100
|
# List of attributes with nullable: true
|
101
101
|
def self.openapi_nullable
|
102
102
|
Set.new([
|
103
|
-
:'is_password_reset_requested',
|
104
103
|
:'total_sign_ins',
|
105
104
|
:'failed_sign_ins',
|
106
105
|
:'last_signed_in',
|
107
|
-
:'created_on'
|
106
|
+
:'created_on',
|
108
107
|
])
|
109
108
|
end
|
110
109
|
|
@@ -131,8 +130,8 @@ module KindeApi
|
|
131
130
|
self.provided_id = attributes[:'provided_id']
|
132
131
|
end
|
133
132
|
|
134
|
-
if attributes.key?(:'
|
135
|
-
self.
|
133
|
+
if attributes.key?(:'preferred_email')
|
134
|
+
self.preferred_email = attributes[:'preferred_email']
|
136
135
|
end
|
137
136
|
|
138
137
|
if attributes.key?(:'last_name')
|
@@ -143,10 +142,6 @@ module KindeApi
|
|
143
142
|
self.first_name = attributes[:'first_name']
|
144
143
|
end
|
145
144
|
|
146
|
-
if attributes.key?(:'full_name')
|
147
|
-
self.full_name = attributes[:'full_name']
|
148
|
-
end
|
149
|
-
|
150
145
|
if attributes.key?(:'is_suspended')
|
151
146
|
self.is_suspended = attributes[:'is_suspended']
|
152
147
|
end
|
@@ -155,10 +150,6 @@ module KindeApi
|
|
155
150
|
self.picture = attributes[:'picture']
|
156
151
|
end
|
157
152
|
|
158
|
-
if attributes.key?(:'is_password_reset_requested')
|
159
|
-
self.is_password_reset_requested = attributes[:'is_password_reset_requested']
|
160
|
-
end
|
161
|
-
|
162
153
|
if attributes.key?(:'total_sign_ins')
|
163
154
|
self.total_sign_ins = attributes[:'total_sign_ins']
|
164
155
|
end
|
@@ -174,6 +165,18 @@ module KindeApi
|
|
174
165
|
if attributes.key?(:'created_on')
|
175
166
|
self.created_on = attributes[:'created_on']
|
176
167
|
end
|
168
|
+
|
169
|
+
if attributes.key?(:'organizations')
|
170
|
+
if (value = attributes[:'organizations']).is_a?(Array)
|
171
|
+
self.organizations = value
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'identities')
|
176
|
+
if (value = attributes[:'identities']).is_a?(Array)
|
177
|
+
self.identities = value
|
178
|
+
end
|
179
|
+
end
|
177
180
|
end
|
178
181
|
|
179
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -196,17 +199,17 @@ module KindeApi
|
|
196
199
|
self.class == o.class &&
|
197
200
|
id == o.id &&
|
198
201
|
provided_id == o.provided_id &&
|
199
|
-
|
202
|
+
preferred_email == o.preferred_email &&
|
200
203
|
last_name == o.last_name &&
|
201
204
|
first_name == o.first_name &&
|
202
|
-
full_name == o.full_name &&
|
203
205
|
is_suspended == o.is_suspended &&
|
204
206
|
picture == o.picture &&
|
205
|
-
is_password_reset_requested == o.is_password_reset_requested &&
|
206
207
|
total_sign_ins == o.total_sign_ins &&
|
207
208
|
failed_sign_ins == o.failed_sign_ins &&
|
208
209
|
last_signed_in == o.last_signed_in &&
|
209
|
-
created_on == o.created_on
|
210
|
+
created_on == o.created_on &&
|
211
|
+
organizations == o.organizations &&
|
212
|
+
identities == o.identities
|
210
213
|
end
|
211
214
|
|
212
215
|
# @see the `==` method
|
@@ -218,7 +221,7 @@ module KindeApi
|
|
218
221
|
# Calculates hash code according to all attributes.
|
219
222
|
# @return [Integer] Hash code
|
220
223
|
def hash
|
221
|
-
[id, provided_id,
|
224
|
+
[id, provided_id, preferred_email, last_name, first_name, is_suspended, picture, total_sign_ins, failed_sign_ins, last_signed_in, created_on, organizations, identities].hash
|
222
225
|
end
|
223
226
|
|
224
227
|
# Builds the object from hash
|
@@ -339,5 +342,7 @@ module KindeApi
|
|
339
342
|
value
|
340
343
|
end
|
341
344
|
end
|
345
|
+
|
342
346
|
end
|
347
|
+
|
343
348
|
end
|
@@ -0,0 +1,228 @@
|
|
1
|
+
=begin
|
2
|
+
#Kinde Management API
|
3
|
+
|
4
|
+
#Provides endpoints to manage your Kinde Businesses
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@kinde.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module KindeApi
|
17
|
+
class UserIdentitiesInner
|
18
|
+
attr_accessor :type
|
19
|
+
|
20
|
+
attr_accessor :identity
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'type' => :'type',
|
26
|
+
:'identity' => :'identity'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'type' => :'String',
|
39
|
+
:'identity' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KindeApi::UserIdentitiesInner` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KindeApi::UserIdentitiesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'type')
|
65
|
+
self.type = attributes[:'type']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'identity')
|
69
|
+
self.identity = attributes[:'identity']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
type == o.type &&
|
92
|
+
identity == o.identity
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[type, identity].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
attributes = attributes.transform_keys(&:to_sym)
|
120
|
+
self.class.openapi_types.each_pair do |key, type|
|
121
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
122
|
+
self.send("#{key}=", nil)
|
123
|
+
elsif type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :Time
|
144
|
+
Time.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :Boolean
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
# models (e.g. Pet) or oneOf
|
175
|
+
klass = KindeApi.const_get(type)
|
176
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the string representation of the object
|
181
|
+
# @return [String] String presentation of the object
|
182
|
+
def to_s
|
183
|
+
to_hash.to_s
|
184
|
+
end
|
185
|
+
|
186
|
+
# to_body is an alias to to_hash (backward compatibility)
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_body
|
189
|
+
to_hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the object in the form of hash
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_hash
|
195
|
+
hash = {}
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
197
|
+
value = self.send(attr)
|
198
|
+
if value.nil?
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
201
|
+
end
|
202
|
+
|
203
|
+
hash[param] = _to_hash(value)
|
204
|
+
end
|
205
|
+
hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Outputs non-array value in the form of hash
|
209
|
+
# For object, use to_hash. Otherwise, just return the value
|
210
|
+
# @param [Object] value Any valid value
|
211
|
+
# @return [Hash] Returns the value in the form of hash
|
212
|
+
def _to_hash(value)
|
213
|
+
if value.is_a?(Array)
|
214
|
+
value.compact.map { |v| _to_hash(v) }
|
215
|
+
elsif value.is_a?(Hash)
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
218
|
+
end
|
219
|
+
elsif value.respond_to? :to_hash
|
220
|
+
value.to_hash
|
221
|
+
else
|
222
|
+
value
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|