kinde_sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +15 -0
  3. data/Gemfile.lock +119 -0
  4. data/LICENSE +21 -0
  5. data/README.md +342 -0
  6. data/Rakefile +10 -0
  7. data/kinde_api/.gitignore +39 -0
  8. data/kinde_api/.rspec +2 -0
  9. data/kinde_api/README.md +103 -0
  10. data/kinde_api/docs/AddOrganizationUsers200Response.md +22 -0
  11. data/kinde_api/docs/AddOrganizationUsersRequest.md +18 -0
  12. data/kinde_api/docs/ApiResult.md +18 -0
  13. data/kinde_api/docs/ConnectedAppsAccessToken.md +20 -0
  14. data/kinde_api/docs/ConnectedAppsApi.md +219 -0
  15. data/kinde_api/docs/ConnectedAppsAuthUrl.md +20 -0
  16. data/kinde_api/docs/CreateOrganization201Response.md +20 -0
  17. data/kinde_api/docs/CreateOrganizationRequest.md +20 -0
  18. data/kinde_api/docs/CreateUser200Response.md +22 -0
  19. data/kinde_api/docs/CreateUserRequest.md +20 -0
  20. data/kinde_api/docs/CreateUserRequestIdentitiesInner.md +20 -0
  21. data/kinde_api/docs/CreateUserRequestIdentitiesInnerDetails.md +18 -0
  22. data/kinde_api/docs/CreateUserRequestProfile.md +20 -0
  23. data/kinde_api/docs/EnvironmentsApi.md +216 -0
  24. data/kinde_api/docs/Error.md +20 -0
  25. data/kinde_api/docs/ErrorResponse.md +18 -0
  26. data/kinde_api/docs/FeatureFlagsApi.md +239 -0
  27. data/kinde_api/docs/GetOrganizationUsers200Response.md +24 -0
  28. data/kinde_api/docs/GetOrganizations200Response.md +24 -0
  29. data/kinde_api/docs/GetUsers200Response.md +24 -0
  30. data/kinde_api/docs/OAuthApi.md +141 -0
  31. data/kinde_api/docs/Organization.md +22 -0
  32. data/kinde_api/docs/OrganizationUser.md +26 -0
  33. data/kinde_api/docs/OrganizationsApi.md +671 -0
  34. data/kinde_api/docs/RemoveOrganizationUsers200Response.md +20 -0
  35. data/kinde_api/docs/RemoveOrganizationUsersRequest.md +18 -0
  36. data/kinde_api/docs/SuccessResponse.md +20 -0
  37. data/kinde_api/docs/UpdateUserRequest.md +22 -0
  38. data/kinde_api/docs/User.md +28 -0
  39. data/kinde_api/docs/UserIdentity.md +20 -0
  40. data/kinde_api/docs/UserIdentityResult.md +20 -0
  41. data/kinde_api/docs/UserProfile.md +26 -0
  42. data/kinde_api/docs/UserProfileV2.md +30 -0
  43. data/kinde_api/docs/UsersApi.md +603 -0
  44. data/kinde_api/lib/kinde_api/api/connected_apps_api.rb +221 -0
  45. data/kinde_api/lib/kinde_api/api/environments_api.rb +212 -0
  46. data/kinde_api/lib/kinde_api/api/feature_flags_api.rb +309 -0
  47. data/kinde_api/lib/kinde_api/api/o_auth_api.rb +136 -0
  48. data/kinde_api/lib/kinde_api/api/organizations_api.rb +634 -0
  49. data/kinde_api/lib/kinde_api/api/users_api.rb +560 -0
  50. data/kinde_api/lib/kinde_api/api_client.rb +397 -0
  51. data/kinde_api/lib/kinde_api/api_error.rb +58 -0
  52. data/kinde_api/lib/kinde_api/configuration.rb +295 -0
  53. data/kinde_api/lib/kinde_api/models/add_organization_users200_response.rb +239 -0
  54. data/kinde_api/lib/kinde_api/models/add_organization_users_request.rb +220 -0
  55. data/kinde_api/lib/kinde_api/models/api_result.rb +218 -0
  56. data/kinde_api/lib/kinde_api/models/connected_apps_access_token.rb +228 -0
  57. data/kinde_api/lib/kinde_api/models/connected_apps_auth_url.rb +228 -0
  58. data/kinde_api/lib/kinde_api/models/create_organization201_response.rb +228 -0
  59. data/kinde_api/lib/kinde_api/models/create_organization_request.rb +252 -0
  60. data/kinde_api/lib/kinde_api/models/create_user200_response.rb +239 -0
  61. data/kinde_api/lib/kinde_api/models/create_user_request.rb +229 -0
  62. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner.rb +228 -0
  63. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner_details.rb +219 -0
  64. data/kinde_api/lib/kinde_api/models/create_user_request_profile.rb +229 -0
  65. data/kinde_api/lib/kinde_api/models/error.rb +228 -0
  66. data/kinde_api/lib/kinde_api/models/error_response.rb +219 -0
  67. data/kinde_api/lib/kinde_api/models/get_organization_users200_response.rb +249 -0
  68. data/kinde_api/lib/kinde_api/models/get_organizations200_response.rb +249 -0
  69. data/kinde_api/lib/kinde_api/models/get_users200_response.rb +249 -0
  70. data/kinde_api/lib/kinde_api/models/organization.rb +235 -0
  71. data/kinde_api/lib/kinde_api/models/organization_user.rb +253 -0
  72. data/kinde_api/lib/kinde_api/models/remove_organization_users200_response.rb +228 -0
  73. data/kinde_api/lib/kinde_api/models/remove_organization_users_request.rb +220 -0
  74. data/kinde_api/lib/kinde_api/models/success_response.rb +226 -0
  75. data/kinde_api/lib/kinde_api/models/update_user_request.rb +238 -0
  76. data/kinde_api/lib/kinde_api/models/user.rb +269 -0
  77. data/kinde_api/lib/kinde_api/models/user_identity.rb +227 -0
  78. data/kinde_api/lib/kinde_api/models/user_identity_result.rb +229 -0
  79. data/kinde_api/lib/kinde_api/models/user_profile.rb +259 -0
  80. data/kinde_api/lib/kinde_api/models/user_profile_v2.rb +279 -0
  81. data/kinde_api/lib/kinde_api/version.rb +15 -0
  82. data/kinde_api/lib/kinde_api.rb +73 -0
  83. data/kinde_api/spec/api/connected_apps_api_spec.rb +72 -0
  84. data/kinde_api/spec/api/environments_api_spec.rb +71 -0
  85. data/kinde_api/spec/api/feature_flags_api_spec.rb +82 -0
  86. data/kinde_api/spec/api/o_auth_api_spec.rb +57 -0
  87. data/kinde_api/spec/api/organizations_api_spec.rb +154 -0
  88. data/kinde_api/spec/api/users_api_spec.rb +141 -0
  89. data/kinde_api/spec/api_client_spec.rb +229 -0
  90. data/kinde_api/spec/configuration_spec.rb +42 -0
  91. data/kinde_api/spec/models/add_organization_users200_response_spec.rb +46 -0
  92. data/kinde_api/spec/models/add_organization_users_request_spec.rb +34 -0
  93. data/kinde_api/spec/models/api_result_spec.rb +34 -0
  94. data/kinde_api/spec/models/connected_apps_access_token_spec.rb +40 -0
  95. data/kinde_api/spec/models/connected_apps_auth_url_spec.rb +40 -0
  96. data/kinde_api/spec/models/create_organization201_response_spec.rb +40 -0
  97. data/kinde_api/spec/models/create_organization_request_spec.rb +44 -0
  98. data/kinde_api/spec/models/create_user200_response_spec.rb +46 -0
  99. data/kinde_api/spec/models/create_user_request_identities_inner_details_spec.rb +34 -0
  100. data/kinde_api/spec/models/create_user_request_identities_inner_spec.rb +40 -0
  101. data/kinde_api/spec/models/create_user_request_profile_spec.rb +40 -0
  102. data/kinde_api/spec/models/create_user_request_spec.rb +40 -0
  103. data/kinde_api/spec/models/error_response_spec.rb +34 -0
  104. data/kinde_api/spec/models/error_spec.rb +40 -0
  105. data/kinde_api/spec/models/get_organization_users200_response_spec.rb +52 -0
  106. data/kinde_api/spec/models/get_organizations200_response_spec.rb +52 -0
  107. data/kinde_api/spec/models/get_users200_response_spec.rb +52 -0
  108. data/kinde_api/spec/models/organization_spec.rb +46 -0
  109. data/kinde_api/spec/models/organization_user_spec.rb +58 -0
  110. data/kinde_api/spec/models/remove_organization_users200_response_spec.rb +40 -0
  111. data/kinde_api/spec/models/remove_organization_users_request_spec.rb +34 -0
  112. data/kinde_api/spec/models/success_response_spec.rb +40 -0
  113. data/kinde_api/spec/models/update_user_request_spec.rb +46 -0
  114. data/kinde_api/spec/models/user_identity_result_spec.rb +40 -0
  115. data/kinde_api/spec/models/user_identity_spec.rb +40 -0
  116. data/kinde_api/spec/models/user_profile_spec.rb +58 -0
  117. data/kinde_api/spec/models/user_profile_v2_spec.rb +70 -0
  118. data/kinde_api/spec/models/user_spec.rb +64 -0
  119. data/kinde_api/spec/spec_helper.rb +111 -0
  120. data/kinde_sdk.gemspec +33 -0
  121. data/lib/kinde_sdk/client.rb +49 -0
  122. data/lib/kinde_sdk/configuration.rb +50 -0
  123. data/lib/kinde_sdk/version.rb +3 -0
  124. data/lib/kinde_sdk.rb +109 -0
  125. data/openapitools.json +7 -0
  126. data/spec/kinde_sdk_spec.rb +105 -0
  127. data/spec/spec_helper.rb +82 -0
  128. metadata +291 -0
@@ -0,0 +1,220 @@
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 AddOrganizationUsersRequest
18
+ # List of user ids to be added to the organization.
19
+ attr_accessor :users
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'users' => :'users'
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
+ :'users' => :'Array<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 `KindeApi::AddOrganizationUsersRequest` 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 `KindeApi::AddOrganizationUsersRequest`. 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?(:'users')
62
+ if (value = attributes[:'users']).is_a?(Array)
63
+ self.users = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ users == o.users
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [users].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
116
+ self.send("#{key}=", nil)
117
+ elsif 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
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 :Time
138
+ Time.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
+ # models (e.g. Pet) or oneOf
169
+ klass = KindeApi.const_get(type)
170
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
+ #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 ApiResult
18
+ # The result of the api operation.
19
+ attr_accessor :result
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'result' => :'result'
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
+ :'result' => :'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 `KindeApi::ApiResult` 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 `KindeApi::ApiResult`. 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?(:'result')
62
+ self.result = attributes[:'result']
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
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ result == o.result
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [result].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = KindeApi.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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,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 ConnectedAppsAccessToken
18
+ # The access token to access a third-party provider.
19
+ attr_accessor :access_token
20
+
21
+ # The date and time that the access token expires.
22
+ attr_accessor :access_token_expiry
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'access_token' => :'access_token',
28
+ :'access_token_expiry' => :'access_token_expiry'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'access_token' => :'String',
41
+ :'access_token_expiry' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KindeApi::ConnectedAppsAccessToken` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KindeApi::ConnectedAppsAccessToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'access_token')
67
+ self.access_token = attributes[:'access_token']
68
+ end
69
+
70
+ if attributes.key?(:'access_token_expiry')
71
+ self.access_token_expiry = attributes[:'access_token_expiry']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ access_token == o.access_token &&
94
+ access_token_expiry == o.access_token_expiry
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [access_token, access_token_expiry].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = KindeApi.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end