diff --git a/CHANGELOG.md b/CHANGELOG.md index 312bd01..af3909d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. +## [0.5.0] - 2024-01-30 + +### Added + +- `AppleUserSocialConnection` model has been added + +### Changed + +- `UserEventInfo` has been renamed to `UserRecentEvent` +- Docs have been moved to `/docs` +- `GithubSocialConnection` has been renamed to `GithubUserSocialConnection` +- `GoogleSocialConnection` has been renamed to `GoogleUserSocialConnection` + ## [0.4.0] - 2024-01-18 ### Added diff --git a/docs/generated/GithubSocialConnection.md b/docs/generated/AppleUserSocialConnection.md similarity index 82% rename from docs/generated/GithubSocialConnection.md rename to docs/generated/AppleUserSocialConnection.md index 2a0e804..4c272b5 100644 --- a/docs/generated/GithubSocialConnection.md +++ b/docs/generated/AppleUserSocialConnection.md @@ -1,4 +1,4 @@ -# OpenapiClient::GithubSocialConnection +# OpenapiClient::AppleUserSocialConnection ## Properties @@ -14,7 +14,7 @@ ```ruby require 'openapi_client' -instance = OpenapiClient::GithubSocialConnection.new( +instance = OpenapiClient::AppleUserSocialConnection.new( provider_id: null, created_at: null, last_login_at: null, diff --git a/docs/generated/GoogleSocialConnection.md b/docs/generated/GithubUserSocialConnection.md similarity index 82% rename from docs/generated/GoogleSocialConnection.md rename to docs/generated/GithubUserSocialConnection.md index 21a9d8f..03e9304 100644 --- a/docs/generated/GoogleSocialConnection.md +++ b/docs/generated/GithubUserSocialConnection.md @@ -1,4 +1,4 @@ -# OpenapiClient::GoogleSocialConnection +# OpenapiClient::GithubUserSocialConnection ## Properties @@ -14,7 +14,7 @@ ```ruby require 'openapi_client' -instance = OpenapiClient::GoogleSocialConnection.new( +instance = OpenapiClient::GithubUserSocialConnection.new( provider_id: null, created_at: null, last_login_at: null, diff --git a/docs/generated/GoogleUserSocialConnection.md b/docs/generated/GoogleUserSocialConnection.md new file mode 100644 index 0000000..d825cc1 --- /dev/null +++ b/docs/generated/GoogleUserSocialConnection.md @@ -0,0 +1,24 @@ +# OpenapiClient::GoogleUserSocialConnection + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **provider_id** | **String** | The external ID of the Social Connection. | | +| **created_at** | **Time** | | | +| **last_login_at** | **Time** | | | +| **provider_identifier** | **String** | The email of connected social user. | | + +## Example + +```ruby +require 'openapi_client' + +instance = OpenapiClient::GoogleUserSocialConnection.new( + provider_id: null, + created_at: null, + last_login_at: null, + provider_identifier: null +) +``` + diff --git a/docs/generated/README.md b/docs/generated/README.md index 463754a..4aa3829 100644 --- a/docs/generated/README.md +++ b/docs/generated/README.md @@ -103,13 +103,14 @@ Class | Method | HTTP request | Description - [OpenapiClient::AppInfo](docs/AppInfo.md) - [OpenapiClient::AppResponse](docs/AppResponse.md) + - [OpenapiClient::AppleUserSocialConnection](docs/AppleUserSocialConnection.md) - [OpenapiClient::AuthMethods](docs/AuthMethods.md) - [OpenapiClient::CreateMagicLinkRequest](docs/CreateMagicLinkRequest.md) - [OpenapiClient::CreateUserRequest](docs/CreateUserRequest.md) - [OpenapiClient::ElementCustomization](docs/ElementCustomization.md) - [OpenapiClient::FontFamily](docs/FontFamily.md) - - [OpenapiClient::GithubSocialConnection](docs/GithubSocialConnection.md) - - [OpenapiClient::GoogleSocialConnection](docs/GoogleSocialConnection.md) + - [OpenapiClient::GithubUserSocialConnection](docs/GithubUserSocialConnection.md) + - [OpenapiClient::GoogleUserSocialConnection](docs/GoogleUserSocialConnection.md) - [OpenapiClient::LayoutConfig](docs/LayoutConfig.md) - [OpenapiClient::Layouts](docs/Layouts.md) - [OpenapiClient::ListDevicesResponse](docs/ListDevicesResponse.md) @@ -130,10 +131,10 @@ Class | Method | HTTP request | Description - [OpenapiClient::UpdateOtpAuthMethod](docs/UpdateOtpAuthMethod.md) - [OpenapiClient::UpdatePasskeysAuthMethod](docs/UpdatePasskeysAuthMethod.md) - [OpenapiClient::UpdateUserRequest](docs/UpdateUserRequest.md) - - [OpenapiClient::UserEventInfo](docs/UserEventInfo.md) - [OpenapiClient::UserInfo](docs/UserInfo.md) - [OpenapiClient::UserMetadataField](docs/UserMetadataField.md) - [OpenapiClient::UserMetadataFieldType](docs/UserMetadataFieldType.md) + - [OpenapiClient::UserRecentEvent](docs/UserRecentEvent.md) - [OpenapiClient::UserResponse](docs/UserResponse.md) - [OpenapiClient::UserSocialConnections](docs/UserSocialConnections.md) - [OpenapiClient::UserStatus](docs/UserStatus.md) diff --git a/docs/generated/UserInfo.md b/docs/generated/UserInfo.md index f7240aa..51d72d9 100644 --- a/docs/generated/UserInfo.md +++ b/docs/generated/UserInfo.md @@ -12,7 +12,7 @@ | **login_count** | **Integer** | | | | **phone** | **String** | | | | **phone_verified** | **Boolean** | | | -| **recent_events** | [**Array<UserEventInfo>**](UserEventInfo.md) | | | +| **recent_events** | [**Array<UserRecentEvent>**](UserRecentEvent.md) | | | | **social_connections** | [**UserSocialConnections**](UserSocialConnections.md) | | | | **status** | [**UserStatus**](UserStatus.md) | | | | **updated_at** | **Time** | | | diff --git a/docs/generated/UserEventInfo.md b/docs/generated/UserRecentEvent.md similarity index 83% rename from docs/generated/UserEventInfo.md rename to docs/generated/UserRecentEvent.md index 3ae0ca0..12cb118 100644 --- a/docs/generated/UserEventInfo.md +++ b/docs/generated/UserRecentEvent.md @@ -1,4 +1,4 @@ -# OpenapiClient::UserEventInfo +# OpenapiClient::UserRecentEvent ## Properties @@ -15,7 +15,7 @@ ```ruby require 'openapi_client' -instance = OpenapiClient::UserEventInfo.new( +instance = OpenapiClient::UserRecentEvent.new( created_at: null, id: null, ip_addr: null, diff --git a/docs/generated/UserSocialConnections.md b/docs/generated/UserSocialConnections.md index 670e5a1..d429d28 100644 --- a/docs/generated/UserSocialConnections.md +++ b/docs/generated/UserSocialConnections.md @@ -4,8 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **google** | [**GoogleSocialConnection**](GoogleSocialConnection.md) | | [optional] | -| **github** | [**GithubSocialConnection**](GithubSocialConnection.md) | | [optional] | +| **apple** | [**AppleUserSocialConnection**](AppleUserSocialConnection.md) | | [optional] | +| **github** | [**GithubUserSocialConnection**](GithubUserSocialConnection.md) | | [optional] | +| **google** | [**GoogleUserSocialConnection**](GoogleUserSocialConnection.md) | | [optional] | ## Example @@ -13,8 +14,9 @@ require 'openapi_client' instance = OpenapiClient::UserSocialConnections.new( - google: null, - github: null + apple: null, + github: null, + google: null ) ``` diff --git a/lib/openapi_client.rb b/lib/openapi_client.rb index 9e6a74e..f70d295 100644 --- a/lib/openapi_client.rb +++ b/lib/openapi_client.rb @@ -19,13 +19,14 @@ # Models require_relative 'openapi_client/models/app_info' require_relative 'openapi_client/models/app_response' +require_relative 'openapi_client/models/apple_user_social_connection' require_relative 'openapi_client/models/auth_methods' require_relative 'openapi_client/models/create_magic_link_request' require_relative 'openapi_client/models/create_user_request' require_relative 'openapi_client/models/element_customization' require_relative 'openapi_client/models/font_family' -require_relative 'openapi_client/models/github_social_connection' -require_relative 'openapi_client/models/google_social_connection' +require_relative 'openapi_client/models/github_user_social_connection' +require_relative 'openapi_client/models/google_user_social_connection' require_relative 'openapi_client/models/layout_config' require_relative 'openapi_client/models/layouts' require_relative 'openapi_client/models/list_devices_response' @@ -46,10 +47,10 @@ require_relative 'openapi_client/models/update_otp_auth_method' require_relative 'openapi_client/models/update_passkeys_auth_method' require_relative 'openapi_client/models/update_user_request' -require_relative 'openapi_client/models/user_event_info' require_relative 'openapi_client/models/user_info' require_relative 'openapi_client/models/user_metadata_field' require_relative 'openapi_client/models/user_metadata_field_type' +require_relative 'openapi_client/models/user_recent_event' require_relative 'openapi_client/models/user_response' require_relative 'openapi_client/models/user_social_connections' require_relative 'openapi_client/models/user_status' diff --git a/lib/openapi_client/models/google_social_connection.rb b/lib/openapi_client/models/apple_user_social_connection.rb similarity index 96% rename from lib/openapi_client/models/google_social_connection.rb rename to lib/openapi_client/models/apple_user_social_connection.rb index b601c82..799053e 100644 --- a/lib/openapi_client/models/google_social_connection.rb +++ b/lib/openapi_client/models/apple_user_social_connection.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - class GoogleSocialConnection + class AppleUserSocialConnection # The external ID of the Social Connection. attr_accessor :provider_id @@ -60,13 +60,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GoogleSocialConnection` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppleUserSocialConnection` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GoogleSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppleUserSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/openapi_client/models/github_social_connection.rb b/lib/openapi_client/models/github_user_social_connection.rb similarity index 96% rename from lib/openapi_client/models/github_social_connection.rb rename to lib/openapi_client/models/github_user_social_connection.rb index 0eb904c..ffb6534 100644 --- a/lib/openapi_client/models/github_social_connection.rb +++ b/lib/openapi_client/models/github_user_social_connection.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - class GithubSocialConnection + class GithubUserSocialConnection # The external ID of the Social Connection. attr_accessor :provider_id @@ -60,13 +60,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GithubSocialConnection` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GithubUserSocialConnection` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GithubSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GithubUserSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/openapi_client/models/google_user_social_connection.rb b/lib/openapi_client/models/google_user_social_connection.rb new file mode 100644 index 0000000..3561ae3 --- /dev/null +++ b/lib/openapi_client/models/google_user_social_connection.rb @@ -0,0 +1,271 @@ +=begin +#Passage Management API + +#Passage's management API to manage your Passage apps and users. + +The version of the OpenAPI document: 1 +Contact: support@passage.id +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.1.0 + +=end + +require 'date' +require 'time' + +module OpenapiClient + class GoogleUserSocialConnection + # The external ID of the Social Connection. + attr_accessor :provider_id + + attr_accessor :created_at + + attr_accessor :last_login_at + + # The email of connected social user. + attr_accessor :provider_identifier + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'provider_id' => :'provider_id', + :'created_at' => :'created_at', + :'last_login_at' => :'last_login_at', + :'provider_identifier' => :'provider_identifier' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'provider_id' => :'String', + :'created_at' => :'Time', + :'last_login_at' => :'Time', + :'provider_identifier' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GoogleUserSocialConnection` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::GoogleUserSocialConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'provider_id') + self.provider_id = attributes[:'provider_id'] + else + self.provider_id = nil + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + + if attributes.key?(:'last_login_at') + self.last_login_at = attributes[:'last_login_at'] + else + self.last_login_at = nil + end + + if attributes.key?(:'provider_identifier') + self.provider_identifier = attributes[:'provider_identifier'] + else + self.provider_identifier = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @provider_id.nil? + invalid_properties.push('invalid value for "provider_id", provider_id cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @last_login_at.nil? + invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.') + end + + if @provider_identifier.nil? + invalid_properties.push('invalid value for "provider_identifier", provider_identifier cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @provider_id.nil? + return false if @created_at.nil? + return false if @last_login_at.nil? + return false if @provider_identifier.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + provider_id == o.provider_id && + created_at == o.created_at && + last_login_at == o.last_login_at && + provider_identifier == o.provider_identifier + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [provider_id, created_at, last_login_at, provider_identifier].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OpenapiClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/openapi_client/models/otp_auth_method.rb b/lib/openapi_client/models/otp_auth_method.rb index 959baa2..148650f 100644 --- a/lib/openapi_client/models/otp_auth_method.rb +++ b/lib/openapi_client/models/otp_auth_method.rb @@ -156,9 +156,9 @@ def ttl=(ttl) fail ArgumentError, 'ttl cannot be nil' end - # if ttl < 60 - # fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.' - # end + if ttl < 60 + fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.' + end @ttl = ttl end diff --git a/lib/openapi_client/models/ttl_display_unit.rb b/lib/openapi_client/models/ttl_display_unit.rb index 6e43a81..2838333 100644 --- a/lib/openapi_client/models/ttl_display_unit.rb +++ b/lib/openapi_client/models/ttl_display_unit.rb @@ -35,7 +35,7 @@ def self.build_from_hash(value) # @param [String] The enum value in the form of the string # @return [String] The enum value def build_from_hash(value) - return value if TtlDisplayUnit.all_vars.include?(value) || value == "" + return value if TtlDisplayUnit.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #TtlDisplayUnit" end end diff --git a/lib/openapi_client/models/user_info.rb b/lib/openapi_client/models/user_info.rb index 8cc3508..6a648c6 100644 --- a/lib/openapi_client/models/user_info.rb +++ b/lib/openapi_client/models/user_info.rb @@ -108,7 +108,7 @@ def self.openapi_types :'login_count' => :'Integer', :'phone' => :'String', :'phone_verified' => :'Boolean', - :'recent_events' => :'Array', + :'recent_events' => :'Array', :'social_connections' => :'UserSocialConnections', :'status' => :'UserStatus', :'updated_at' => :'Time', diff --git a/lib/openapi_client/models/user_event_info.rb b/lib/openapi_client/models/user_recent_event.rb similarity index 97% rename from lib/openapi_client/models/user_event_info.rb rename to lib/openapi_client/models/user_recent_event.rb index b5edb65..4e14ce7 100644 --- a/lib/openapi_client/models/user_event_info.rb +++ b/lib/openapi_client/models/user_recent_event.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - class UserEventInfo + class UserRecentEvent attr_accessor :created_at attr_accessor :id @@ -62,13 +62,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UserEventInfo` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UserRecentEvent` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UserEventInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UserRecentEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/openapi_client/models/user_social_connections.rb b/lib/openapi_client/models/user_social_connections.rb index e6da6de..18b4377 100644 --- a/lib/openapi_client/models/user_social_connections.rb +++ b/lib/openapi_client/models/user_social_connections.rb @@ -15,15 +15,18 @@ module OpenapiClient class UserSocialConnections - attr_accessor :google + attr_accessor :apple attr_accessor :github + attr_accessor :google + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'google' => :'google', - :'github' => :'github' + :'apple' => :'apple', + :'github' => :'github', + :'google' => :'google' } end @@ -35,8 +38,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'google' => :'GoogleSocialConnection', - :'github' => :'GithubSocialConnection' + :'apple' => :'AppleUserSocialConnection', + :'github' => :'GithubUserSocialConnection', + :'google' => :'GoogleUserSocialConnection' } end @@ -61,13 +65,17 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'google') - self.google = attributes[:'google'] + if attributes.key?(:'apple') + self.apple = attributes[:'apple'] end if attributes.key?(:'github') self.github = attributes[:'github'] end + + if attributes.key?(:'google') + self.google = attributes[:'google'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -90,8 +98,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - google == o.google && - github == o.github + apple == o.apple && + github == o.github && + google == o.google end # @see the `==` method @@ -103,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [google, github].hash + [apple, github, google].hash end # Builds the object from hash diff --git a/lib/passageidentity/version.rb b/lib/passageidentity/version.rb index 76cdce5..cbb3b20 100644 --- a/lib/passageidentity/version.rb +++ b/lib/passageidentity/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Passage - VERSION = '0.4.0' + VERSION = '0.5.0' end