passageidentity 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/docs/generated/GithubSocialConnection.md +24 -0
- data/docs/generated/GoogleSocialConnection.md +24 -0
- data/docs/generated/README.md +152 -0
- data/docs/generated/UserInfo.md +2 -0
- data/docs/generated/UserSocialConnections.md +20 -0
- data/lib/openapi_client/models/github_social_connection.rb +271 -0
- data/lib/openapi_client/models/google_social_connection.rb +271 -0
- data/lib/openapi_client/models/model404_error.rb +2 -2
- data/lib/openapi_client/models/user_info.rb +17 -1
- data/lib/openapi_client/models/user_social_connections.rb +223 -0
- data/lib/openapi_client.rb +10 -1
- data/lib/passageidentity/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62c4decfeae2c74df718f774521c2b56e9df5858bc1b02082ab74d58b23906fc
|
4
|
+
data.tar.gz: 4c6c35ab3ee5bf439f5592fcbcc57bac38a8326b2976926cdf5a8a690b06439e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac6edcbac0e7c070d3437a700b2ac0601f3e54fe0c50b00b5f8e5b8d3e1933ace49789df6d27875bbcc2a3fd920bdf31563d9b8ba05c9b2f92144005b9d4d111
|
7
|
+
data.tar.gz: 5a75295215f6f337f17471dc032baff550b4948556445af1c6b404a5828a167fa0f5a7a894adde698019a827641d8f14b796977270179cb17b67c52338a41611
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.4.0] - 2024-01-18
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- The `UserInfo` class has a new `'social_connections' =>:'UserSocialConnections'` field for GitHub and Google
|
10
|
+
|
5
11
|
## [0.3.0] - 2023-12-06
|
6
12
|
|
7
13
|
### Added
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# OpenapiClient::GithubSocialConnection
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **provider_id** | **String** | The external ID of the Social Connection. | |
|
8
|
+
| **created_at** | **Time** | | |
|
9
|
+
| **last_login_at** | **Time** | | |
|
10
|
+
| **provider_identifier** | **String** | The email of connected social user. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'openapi_client'
|
16
|
+
|
17
|
+
instance = OpenapiClient::GithubSocialConnection.new(
|
18
|
+
provider_id: null,
|
19
|
+
created_at: null,
|
20
|
+
last_login_at: null,
|
21
|
+
provider_identifier: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# OpenapiClient::GoogleSocialConnection
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **provider_id** | **String** | The external ID of the Social Connection. | |
|
8
|
+
| **created_at** | **Time** | | |
|
9
|
+
| **last_login_at** | **Time** | | |
|
10
|
+
| **provider_identifier** | **String** | The email of connected social user. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'openapi_client'
|
16
|
+
|
17
|
+
instance = OpenapiClient::GoogleSocialConnection.new(
|
18
|
+
provider_id: null,
|
19
|
+
created_at: null,
|
20
|
+
last_login_at: null,
|
21
|
+
provider_identifier: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# openapi_client
|
2
|
+
|
3
|
+
OpenapiClient - the Ruby gem for the Passage Management API
|
4
|
+
|
5
|
+
Passage's management API to manage your Passage apps and users.
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
|
+
|
9
|
+
- API version: 1
|
10
|
+
- Package version: 1.0.0
|
11
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
+
For more information, please visit [https://passage.id/support](https://passage.id/support)
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
### Build a gem
|
17
|
+
|
18
|
+
To build the Ruby code into a gem:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
gem build openapi_client.gemspec
|
22
|
+
```
|
23
|
+
|
24
|
+
Then either install the gem locally:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
gem install ./openapi_client-1.0.0.gem
|
28
|
+
```
|
29
|
+
|
30
|
+
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
|
31
|
+
|
32
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
+
|
34
|
+
Finally add this to the Gemfile:
|
35
|
+
|
36
|
+
gem 'openapi_client', '~> 1.0.0'
|
37
|
+
|
38
|
+
### Install from Git
|
39
|
+
|
40
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
41
|
+
|
42
|
+
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
43
|
+
|
44
|
+
### Include the Ruby code directly
|
45
|
+
|
46
|
+
Include the Ruby code directly using `-I` as follows:
|
47
|
+
|
48
|
+
```shell
|
49
|
+
ruby -Ilib script.rb
|
50
|
+
```
|
51
|
+
|
52
|
+
## Getting Started
|
53
|
+
|
54
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
# Load the gem
|
58
|
+
require 'openapi_client'
|
59
|
+
|
60
|
+
# Setup authorization
|
61
|
+
OpenapiClient.configure do |config|
|
62
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
63
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
64
|
+
# Configure a proc to get access tokens in lieu of the static access_token configuration
|
65
|
+
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
66
|
+
# Configure faraday connection
|
67
|
+
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
|
68
|
+
end
|
69
|
+
|
70
|
+
api_instance = OpenapiClient::AppsApi.new
|
71
|
+
app_id = 'app_id_example' # String | App ID
|
72
|
+
|
73
|
+
begin
|
74
|
+
#Get App
|
75
|
+
result = api_instance.get_app(app_id)
|
76
|
+
p result
|
77
|
+
rescue OpenapiClient::ApiError => e
|
78
|
+
puts "Exception when calling AppsApi->get_app: #{e}"
|
79
|
+
end
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
## Documentation for API Endpoints
|
84
|
+
|
85
|
+
All URIs are relative to *https://api.passage.id/v1*
|
86
|
+
|
87
|
+
Class | Method | HTTP request | Description
|
88
|
+
------------ | ------------- | ------------- | -------------
|
89
|
+
*OpenapiClient::AppsApi* | [**get_app**](docs/AppsApi.md#get_app) | **GET** /apps/{app_id} | Get App
|
90
|
+
*OpenapiClient::MagicLinksApi* | [**create_magic_link**](docs/MagicLinksApi.md#create_magic_link) | **POST** /apps/{app_id}/magic-links | Create Embeddable Magic Link
|
91
|
+
*OpenapiClient::TokensApi* | [**revoke_user_refresh_tokens**](docs/TokensApi.md#revoke_user_refresh_tokens) | **DELETE** /apps/{app_id}/users/{user_id}/tokens | Revokes refresh tokens
|
92
|
+
*OpenapiClient::UserDevicesApi* | [**delete_user_devices**](docs/UserDevicesApi.md#delete_user_devices) | **DELETE** /apps/{app_id}/users/{user_id}/devices/{device_id} | Delete a device for a user
|
93
|
+
*OpenapiClient::UserDevicesApi* | [**list_user_devices**](docs/UserDevicesApi.md#list_user_devices) | **GET** /apps/{app_id}/users/{user_id}/devices | List User Devices
|
94
|
+
*OpenapiClient::UsersApi* | [**activate_user**](docs/UsersApi.md#activate_user) | **PATCH** /apps/{app_id}/users/{user_id}/activate | Activate User
|
95
|
+
*OpenapiClient::UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /apps/{app_id}/users | Create User
|
96
|
+
*OpenapiClient::UsersApi* | [**deactivate_user**](docs/UsersApi.md#deactivate_user) | **PATCH** /apps/{app_id}/users/{user_id}/deactivate | Deactivate User
|
97
|
+
*OpenapiClient::UsersApi* | [**delete_user**](docs/UsersApi.md#delete_user) | **DELETE** /apps/{app_id}/users/{user_id} | Delete User
|
98
|
+
*OpenapiClient::UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /apps/{app_id}/users/{user_id} | Get User
|
99
|
+
*OpenapiClient::UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /apps/{app_id}/users/{user_id} | Update User
|
100
|
+
|
101
|
+
|
102
|
+
## Documentation for Models
|
103
|
+
|
104
|
+
- [OpenapiClient::AppInfo](docs/AppInfo.md)
|
105
|
+
- [OpenapiClient::AppResponse](docs/AppResponse.md)
|
106
|
+
- [OpenapiClient::AuthMethods](docs/AuthMethods.md)
|
107
|
+
- [OpenapiClient::CreateMagicLinkRequest](docs/CreateMagicLinkRequest.md)
|
108
|
+
- [OpenapiClient::CreateUserRequest](docs/CreateUserRequest.md)
|
109
|
+
- [OpenapiClient::ElementCustomization](docs/ElementCustomization.md)
|
110
|
+
- [OpenapiClient::FontFamily](docs/FontFamily.md)
|
111
|
+
- [OpenapiClient::GithubSocialConnection](docs/GithubSocialConnection.md)
|
112
|
+
- [OpenapiClient::GoogleSocialConnection](docs/GoogleSocialConnection.md)
|
113
|
+
- [OpenapiClient::LayoutConfig](docs/LayoutConfig.md)
|
114
|
+
- [OpenapiClient::Layouts](docs/Layouts.md)
|
115
|
+
- [OpenapiClient::ListDevicesResponse](docs/ListDevicesResponse.md)
|
116
|
+
- [OpenapiClient::MagicLink](docs/MagicLink.md)
|
117
|
+
- [OpenapiClient::MagicLinkAuthMethod](docs/MagicLinkAuthMethod.md)
|
118
|
+
- [OpenapiClient::MagicLinkChannel](docs/MagicLinkChannel.md)
|
119
|
+
- [OpenapiClient::MagicLinkResponse](docs/MagicLinkResponse.md)
|
120
|
+
- [OpenapiClient::MagicLinkType](docs/MagicLinkType.md)
|
121
|
+
- [OpenapiClient::Model400Error](docs/Model400Error.md)
|
122
|
+
- [OpenapiClient::Model401Error](docs/Model401Error.md)
|
123
|
+
- [OpenapiClient::Model404Error](docs/Model404Error.md)
|
124
|
+
- [OpenapiClient::Model500Error](docs/Model500Error.md)
|
125
|
+
- [OpenapiClient::OtpAuthMethod](docs/OtpAuthMethod.md)
|
126
|
+
- [OpenapiClient::PasskeysAuthMethod](docs/PasskeysAuthMethod.md)
|
127
|
+
- [OpenapiClient::Technologies](docs/Technologies.md)
|
128
|
+
- [OpenapiClient::TtlDisplayUnit](docs/TtlDisplayUnit.md)
|
129
|
+
- [OpenapiClient::UpdateMagicLinkAuthMethod](docs/UpdateMagicLinkAuthMethod.md)
|
130
|
+
- [OpenapiClient::UpdateOtpAuthMethod](docs/UpdateOtpAuthMethod.md)
|
131
|
+
- [OpenapiClient::UpdatePasskeysAuthMethod](docs/UpdatePasskeysAuthMethod.md)
|
132
|
+
- [OpenapiClient::UpdateUserRequest](docs/UpdateUserRequest.md)
|
133
|
+
- [OpenapiClient::UserEventInfo](docs/UserEventInfo.md)
|
134
|
+
- [OpenapiClient::UserInfo](docs/UserInfo.md)
|
135
|
+
- [OpenapiClient::UserMetadataField](docs/UserMetadataField.md)
|
136
|
+
- [OpenapiClient::UserMetadataFieldType](docs/UserMetadataFieldType.md)
|
137
|
+
- [OpenapiClient::UserResponse](docs/UserResponse.md)
|
138
|
+
- [OpenapiClient::UserSocialConnections](docs/UserSocialConnections.md)
|
139
|
+
- [OpenapiClient::UserStatus](docs/UserStatus.md)
|
140
|
+
- [OpenapiClient::WebAuthnDevices](docs/WebAuthnDevices.md)
|
141
|
+
- [OpenapiClient::WebAuthnIcons](docs/WebAuthnIcons.md)
|
142
|
+
- [OpenapiClient::WebAuthnType](docs/WebAuthnType.md)
|
143
|
+
|
144
|
+
|
145
|
+
## Documentation for Authorization
|
146
|
+
|
147
|
+
|
148
|
+
Authentication schemes defined for the API:
|
149
|
+
### bearerAuth
|
150
|
+
|
151
|
+
- **Type**: Bearer authentication (JWT)
|
152
|
+
|
data/docs/generated/UserInfo.md
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
| **phone** | **String** | | |
|
14
14
|
| **phone_verified** | **Boolean** | | |
|
15
15
|
| **recent_events** | [**Array<UserEventInfo>**](UserEventInfo.md) | | |
|
16
|
+
| **social_connections** | [**UserSocialConnections**](UserSocialConnections.md) | | |
|
16
17
|
| **status** | [**UserStatus**](UserStatus.md) | | |
|
17
18
|
| **updated_at** | **Time** | | |
|
18
19
|
| **user_metadata** | **Object** | | |
|
@@ -35,6 +36,7 @@ instance = OpenapiClient::UserInfo.new(
|
|
35
36
|
phone: null,
|
36
37
|
phone_verified: null,
|
37
38
|
recent_events: null,
|
39
|
+
social_connections: null,
|
38
40
|
status: null,
|
39
41
|
updated_at: null,
|
40
42
|
user_metadata: null,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# OpenapiClient::UserSocialConnections
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **google** | [**GoogleSocialConnection**](GoogleSocialConnection.md) | | [optional] |
|
8
|
+
| **github** | [**GithubSocialConnection**](GithubSocialConnection.md) | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'openapi_client'
|
14
|
+
|
15
|
+
instance = OpenapiClient::UserSocialConnections.new(
|
16
|
+
google: null,
|
17
|
+
github: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,271 @@
|
|
1
|
+
=begin
|
2
|
+
#Passage Management API
|
3
|
+
|
4
|
+
#Passage's management API to manage your Passage apps and users.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@passage.id
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OpenapiClient
|
17
|
+
class GithubSocialConnection
|
18
|
+
# The external ID of the Social Connection.
|
19
|
+
attr_accessor :provider_id
|
20
|
+
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
attr_accessor :last_login_at
|
24
|
+
|
25
|
+
# The email of connected social user.
|
26
|
+
attr_accessor :provider_identifier
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'provider_id' => :'provider_id',
|
32
|
+
:'created_at' => :'created_at',
|
33
|
+
:'last_login_at' => :'last_login_at',
|
34
|
+
:'provider_identifier' => :'provider_identifier'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.openapi_types
|
45
|
+
{
|
46
|
+
:'provider_id' => :'String',
|
47
|
+
:'created_at' => :'Time',
|
48
|
+
:'last_login_at' => :'Time',
|
49
|
+
:'provider_identifier' => :'String'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GithubSocialConnection` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
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
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'provider_id')
|
75
|
+
self.provider_id = attributes[:'provider_id']
|
76
|
+
else
|
77
|
+
self.provider_id = nil
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'created_at')
|
81
|
+
self.created_at = attributes[:'created_at']
|
82
|
+
else
|
83
|
+
self.created_at = nil
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'last_login_at')
|
87
|
+
self.last_login_at = attributes[:'last_login_at']
|
88
|
+
else
|
89
|
+
self.last_login_at = nil
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'provider_identifier')
|
93
|
+
self.provider_identifier = attributes[:'provider_identifier']
|
94
|
+
else
|
95
|
+
self.provider_identifier = nil
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
103
|
+
invalid_properties = Array.new
|
104
|
+
if @provider_id.nil?
|
105
|
+
invalid_properties.push('invalid value for "provider_id", provider_id cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @created_at.nil?
|
109
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
if @last_login_at.nil?
|
113
|
+
invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @provider_identifier.nil?
|
117
|
+
invalid_properties.push('invalid value for "provider_identifier", provider_identifier cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
invalid_properties
|
121
|
+
end
|
122
|
+
|
123
|
+
# Check to see if the all the properties in the model are valid
|
124
|
+
# @return true if the model is valid
|
125
|
+
def valid?
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
127
|
+
return false if @provider_id.nil?
|
128
|
+
return false if @created_at.nil?
|
129
|
+
return false if @last_login_at.nil?
|
130
|
+
return false if @provider_identifier.nil?
|
131
|
+
true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
provider_id == o.provider_id &&
|
140
|
+
created_at == o.created_at &&
|
141
|
+
last_login_at == o.last_login_at &&
|
142
|
+
provider_identifier == o.provider_identifier
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[provider_id, created_at, last_login_at, provider_identifier].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
163
|
+
transformed_hash = {}
|
164
|
+
openapi_types.each_pair do |key, type|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = nil
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
172
|
+
end
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
175
|
+
end
|
176
|
+
end
|
177
|
+
new(transformed_hash)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def self._deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = OpenapiClient.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
@@ -0,0 +1,271 @@
|
|
1
|
+
=begin
|
2
|
+
#Passage Management API
|
3
|
+
|
4
|
+
#Passage's management API to manage your Passage apps and users.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@passage.id
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OpenapiClient
|
17
|
+
class GoogleSocialConnection
|
18
|
+
# The external ID of the Social Connection.
|
19
|
+
attr_accessor :provider_id
|
20
|
+
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
attr_accessor :last_login_at
|
24
|
+
|
25
|
+
# The email of connected social user.
|
26
|
+
attr_accessor :provider_identifier
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'provider_id' => :'provider_id',
|
32
|
+
:'created_at' => :'created_at',
|
33
|
+
:'last_login_at' => :'last_login_at',
|
34
|
+
:'provider_identifier' => :'provider_identifier'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.openapi_types
|
45
|
+
{
|
46
|
+
:'provider_id' => :'String',
|
47
|
+
:'created_at' => :'Time',
|
48
|
+
:'last_login_at' => :'Time',
|
49
|
+
:'provider_identifier' => :'String'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.openapi_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::GoogleSocialConnection` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
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
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'provider_id')
|
75
|
+
self.provider_id = attributes[:'provider_id']
|
76
|
+
else
|
77
|
+
self.provider_id = nil
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'created_at')
|
81
|
+
self.created_at = attributes[:'created_at']
|
82
|
+
else
|
83
|
+
self.created_at = nil
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'last_login_at')
|
87
|
+
self.last_login_at = attributes[:'last_login_at']
|
88
|
+
else
|
89
|
+
self.last_login_at = nil
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'provider_identifier')
|
93
|
+
self.provider_identifier = attributes[:'provider_identifier']
|
94
|
+
else
|
95
|
+
self.provider_identifier = nil
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
103
|
+
invalid_properties = Array.new
|
104
|
+
if @provider_id.nil?
|
105
|
+
invalid_properties.push('invalid value for "provider_id", provider_id cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
if @created_at.nil?
|
109
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
if @last_login_at.nil?
|
113
|
+
invalid_properties.push('invalid value for "last_login_at", last_login_at cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @provider_identifier.nil?
|
117
|
+
invalid_properties.push('invalid value for "provider_identifier", provider_identifier cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
invalid_properties
|
121
|
+
end
|
122
|
+
|
123
|
+
# Check to see if the all the properties in the model are valid
|
124
|
+
# @return true if the model is valid
|
125
|
+
def valid?
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
127
|
+
return false if @provider_id.nil?
|
128
|
+
return false if @created_at.nil?
|
129
|
+
return false if @last_login_at.nil?
|
130
|
+
return false if @provider_identifier.nil?
|
131
|
+
true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
provider_id == o.provider_id &&
|
140
|
+
created_at == o.created_at &&
|
141
|
+
last_login_at == o.last_login_at &&
|
142
|
+
provider_identifier == o.provider_identifier
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[provider_id, created_at, last_login_at, provider_identifier].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
163
|
+
transformed_hash = {}
|
164
|
+
openapi_types.each_pair do |key, type|
|
165
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = nil
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
171
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
172
|
+
end
|
173
|
+
elsif !attributes[attribute_map[key]].nil?
|
174
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
175
|
+
end
|
176
|
+
end
|
177
|
+
new(transformed_hash)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def self._deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = OpenapiClient.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
@@ -117,7 +117,7 @@ module OpenapiClient
|
|
117
117
|
def valid?
|
118
118
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
119
119
|
return false if @code.nil?
|
120
|
-
code_validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "
|
120
|
+
code_validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "oauth2_app_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "social_connection_not_found", "user_not_found"])
|
121
121
|
return false unless code_validator.valid?(@code)
|
122
122
|
return false if @error.nil?
|
123
123
|
true
|
@@ -126,7 +126,7 @@ module OpenapiClient
|
|
126
126
|
# Custom attribute writer method checking allowed values (enum).
|
127
127
|
# @param [Object] code Object to be assigned
|
128
128
|
def code=(code)
|
129
|
-
validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "
|
129
|
+
validator = EnumAttributeValidator.new('String', ["admin_not_found", "api_key_not_found", "app_not_found", "device_not_found", "domain_not_found", "email_provider_not_found", "email_template_not_found", "event_not_found", "function_not_found", "function_secret_key_not_found", "function_version_not_found", "metadata_field_not_found", "oauth2_app_not_found", "organization_member_not_found", "sms_provider_not_found", "sms_template_not_found", "social_connection_not_found", "user_not_found"])
|
130
130
|
unless validator.valid?(code)
|
131
131
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
132
132
|
end
|
@@ -33,6 +33,8 @@ module OpenapiClient
|
|
33
33
|
|
34
34
|
attr_accessor :recent_events
|
35
35
|
|
36
|
+
attr_accessor :social_connections
|
37
|
+
|
36
38
|
attr_accessor :status
|
37
39
|
|
38
40
|
attr_accessor :updated_at
|
@@ -80,6 +82,7 @@ module OpenapiClient
|
|
80
82
|
:'phone' => :'phone',
|
81
83
|
:'phone_verified' => :'phone_verified',
|
82
84
|
:'recent_events' => :'recent_events',
|
85
|
+
:'social_connections' => :'social_connections',
|
83
86
|
:'status' => :'status',
|
84
87
|
:'updated_at' => :'updated_at',
|
85
88
|
:'user_metadata' => :'user_metadata',
|
@@ -106,6 +109,7 @@ module OpenapiClient
|
|
106
109
|
:'phone' => :'String',
|
107
110
|
:'phone_verified' => :'Boolean',
|
108
111
|
:'recent_events' => :'Array<UserEventInfo>',
|
112
|
+
:'social_connections' => :'UserSocialConnections',
|
109
113
|
:'status' => :'UserStatus',
|
110
114
|
:'updated_at' => :'Time',
|
111
115
|
:'user_metadata' => :'Object',
|
@@ -193,6 +197,12 @@ module OpenapiClient
|
|
193
197
|
self.recent_events = nil
|
194
198
|
end
|
195
199
|
|
200
|
+
if attributes.key?(:'social_connections')
|
201
|
+
self.social_connections = attributes[:'social_connections']
|
202
|
+
else
|
203
|
+
self.social_connections = nil
|
204
|
+
end
|
205
|
+
|
196
206
|
if attributes.key?(:'status')
|
197
207
|
self.status = attributes[:'status']
|
198
208
|
else
|
@@ -275,6 +285,10 @@ module OpenapiClient
|
|
275
285
|
invalid_properties.push('invalid value for "recent_events", recent_events cannot be nil.')
|
276
286
|
end
|
277
287
|
|
288
|
+
if @social_connections.nil?
|
289
|
+
invalid_properties.push('invalid value for "social_connections", social_connections cannot be nil.')
|
290
|
+
end
|
291
|
+
|
278
292
|
if @status.nil?
|
279
293
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
280
294
|
end
|
@@ -311,6 +325,7 @@ module OpenapiClient
|
|
311
325
|
return false if @phone.nil?
|
312
326
|
return false if @phone_verified.nil?
|
313
327
|
return false if @recent_events.nil?
|
328
|
+
return false if @social_connections.nil?
|
314
329
|
return false if @status.nil?
|
315
330
|
return false if @updated_at.nil?
|
316
331
|
return false if @webauthn.nil?
|
@@ -333,6 +348,7 @@ module OpenapiClient
|
|
333
348
|
phone == o.phone &&
|
334
349
|
phone_verified == o.phone_verified &&
|
335
350
|
recent_events == o.recent_events &&
|
351
|
+
social_connections == o.social_connections &&
|
336
352
|
status == o.status &&
|
337
353
|
updated_at == o.updated_at &&
|
338
354
|
user_metadata == o.user_metadata &&
|
@@ -350,7 +366,7 @@ module OpenapiClient
|
|
350
366
|
# Calculates hash code according to all attributes.
|
351
367
|
# @return [Integer] Hash code
|
352
368
|
def hash
|
353
|
-
[created_at, email, email_verified, id, last_login_at, login_count, phone, phone_verified, recent_events, status, updated_at, user_metadata, webauthn, webauthn_devices, webauthn_types].hash
|
369
|
+
[created_at, email, email_verified, id, last_login_at, login_count, phone, phone_verified, recent_events, social_connections, status, updated_at, user_metadata, webauthn, webauthn_devices, webauthn_types].hash
|
354
370
|
end
|
355
371
|
|
356
372
|
# Builds the object from hash
|
@@ -0,0 +1,223 @@
|
|
1
|
+
=begin
|
2
|
+
#Passage Management API
|
3
|
+
|
4
|
+
#Passage's management API to manage your Passage apps and users.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@passage.id
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OpenapiClient
|
17
|
+
class UserSocialConnections
|
18
|
+
attr_accessor :google
|
19
|
+
|
20
|
+
attr_accessor :github
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'google' => :'google',
|
26
|
+
:'github' => :'github'
|
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
|
+
:'google' => :'GoogleSocialConnection',
|
39
|
+
:'github' => :'GithubSocialConnection'
|
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 `OpenapiClient::UserSocialConnections` 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 `OpenapiClient::UserSocialConnections`. 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?(:'google')
|
65
|
+
self.google = attributes[:'google']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'github')
|
69
|
+
self.github = attributes[:'github']
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
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
|
+
google == o.google &&
|
94
|
+
github == o.github
|
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
|
+
[google, github].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
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
transformed_hash = {}
|
116
|
+
openapi_types.each_pair do |key, type|
|
117
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = nil
|
119
|
+
elsif type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
123
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
|
+
end
|
125
|
+
elsif !attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
new(transformed_hash)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def self._deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = OpenapiClient.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
data/lib/openapi_client.rb
CHANGED
@@ -24,11 +24,13 @@ require_relative 'openapi_client/models/create_magic_link_request'
|
|
24
24
|
require_relative 'openapi_client/models/create_user_request'
|
25
25
|
require_relative 'openapi_client/models/element_customization'
|
26
26
|
require_relative 'openapi_client/models/font_family'
|
27
|
+
require_relative 'openapi_client/models/github_social_connection'
|
28
|
+
require_relative 'openapi_client/models/google_social_connection'
|
27
29
|
require_relative 'openapi_client/models/layout_config'
|
28
30
|
require_relative 'openapi_client/models/layouts'
|
29
31
|
require_relative 'openapi_client/models/list_devices_response'
|
30
|
-
require_relative 'openapi_client/models/magic_link_auth_method'
|
31
32
|
require_relative 'openapi_client/models/magic_link'
|
33
|
+
require_relative 'openapi_client/models/magic_link_auth_method'
|
32
34
|
require_relative 'openapi_client/models/magic_link_channel'
|
33
35
|
require_relative 'openapi_client/models/magic_link_response'
|
34
36
|
require_relative 'openapi_client/models/magic_link_type'
|
@@ -49,6 +51,7 @@ require_relative 'openapi_client/models/user_info'
|
|
49
51
|
require_relative 'openapi_client/models/user_metadata_field'
|
50
52
|
require_relative 'openapi_client/models/user_metadata_field_type'
|
51
53
|
require_relative 'openapi_client/models/user_response'
|
54
|
+
require_relative 'openapi_client/models/user_social_connections'
|
52
55
|
require_relative 'openapi_client/models/user_status'
|
53
56
|
require_relative 'openapi_client/models/web_authn_devices'
|
54
57
|
require_relative 'openapi_client/models/web_authn_icons'
|
@@ -63,6 +66,12 @@ require_relative 'openapi_client/api/users_api'
|
|
63
66
|
|
64
67
|
module OpenapiClient
|
65
68
|
class << self
|
69
|
+
# Customize default settings for the SDK using block.
|
70
|
+
# OpenapiClient.configure do |config|
|
71
|
+
# config.username = "xxx"
|
72
|
+
# config.password = "xxx"
|
73
|
+
# end
|
74
|
+
# If no block given, return the default Configuration object.
|
66
75
|
def configure
|
67
76
|
if block_given?
|
68
77
|
yield(Configuration.default)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passageidentity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Passage Identity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -96,6 +96,8 @@ files:
|
|
96
96
|
- docs/generated/CreateUserRequest.md
|
97
97
|
- docs/generated/ElementCustomization.md
|
98
98
|
- docs/generated/FontFamily.md
|
99
|
+
- docs/generated/GithubSocialConnection.md
|
100
|
+
- docs/generated/GoogleSocialConnection.md
|
99
101
|
- docs/generated/LayoutConfig.md
|
100
102
|
- docs/generated/Layouts.md
|
101
103
|
- docs/generated/ListDevicesResponse.md
|
@@ -111,6 +113,7 @@ files:
|
|
111
113
|
- docs/generated/Model500Error.md
|
112
114
|
- docs/generated/OtpAuthMethod.md
|
113
115
|
- docs/generated/PasskeysAuthMethod.md
|
116
|
+
- docs/generated/README.md
|
114
117
|
- docs/generated/Technologies.md
|
115
118
|
- docs/generated/TokensApi.md
|
116
119
|
- docs/generated/TtlDisplayUnit.md
|
@@ -124,6 +127,7 @@ files:
|
|
124
127
|
- docs/generated/UserMetadataField.md
|
125
128
|
- docs/generated/UserMetadataFieldType.md
|
126
129
|
- docs/generated/UserResponse.md
|
130
|
+
- docs/generated/UserSocialConnections.md
|
127
131
|
- docs/generated/UserStatus.md
|
128
132
|
- docs/generated/UsersApi.md
|
129
133
|
- docs/generated/WebAuthnDevices.md
|
@@ -146,6 +150,8 @@ files:
|
|
146
150
|
- lib/openapi_client/models/create_user_request.rb
|
147
151
|
- lib/openapi_client/models/element_customization.rb
|
148
152
|
- lib/openapi_client/models/font_family.rb
|
153
|
+
- lib/openapi_client/models/github_social_connection.rb
|
154
|
+
- lib/openapi_client/models/google_social_connection.rb
|
149
155
|
- lib/openapi_client/models/layout_config.rb
|
150
156
|
- lib/openapi_client/models/layouts.rb
|
151
157
|
- lib/openapi_client/models/list_devices_response.rb
|
@@ -171,6 +177,7 @@ files:
|
|
171
177
|
- lib/openapi_client/models/user_metadata_field.rb
|
172
178
|
- lib/openapi_client/models/user_metadata_field_type.rb
|
173
179
|
- lib/openapi_client/models/user_response.rb
|
180
|
+
- lib/openapi_client/models/user_social_connections.rb
|
174
181
|
- lib/openapi_client/models/user_status.rb
|
175
182
|
- lib/openapi_client/models/web_authn_devices.rb
|
176
183
|
- lib/openapi_client/models/web_authn_icons.rb
|