late-sdk 0.0.625 → 0.0.627

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e917f079493a54dfc761ace6dc11d5892fa60684a14afbcaad6e5fc9e6a8ee0
4
- data.tar.gz: 622d8cce42a9c91ce6474d5adfdb8499a1086534a481e098b1b1f8c1b4084bf6
3
+ metadata.gz: 56896b274322edbd0284ab168fe44b1e375f48da51abbbfcf70556674caf0684
4
+ data.tar.gz: 80bdc7293afda608b38dfacd3b6d783ab11b2cf4dee259f62643c0f62e902e41
5
5
  SHA512:
6
- metadata.gz: 639a9ecaec615c266d7592328810f4ed4bcae86b8faae33ddcab0b029170b2cbcc34251d0f561115a4a473ed90dd223498741eb004685d4c2ee74eb67b5583be
7
- data.tar.gz: 59cefd609ea1e2cc9d8e77525ab0e5e39f5d6a6f82104a4de2f181b1b751d2620b3b1715f2ee35578c1373ecac491c1a2f3f82b6529c029e78c2e341242b01c9
6
+ metadata.gz: 80d6eda0b7391175244379434f9496767fdaad576087b247af1f4dfdf8c6c919c60d51623b887343139fafe408fb72d9674995135cbb66829ff8e41bbe33a970
7
+ data.tar.gz: 59ed50dbc2aa212dc0cb99fa800db0753bf379848eadc78a7ce65dba82180a1501df23e0118c306efc7be5f807a5f81f254d08cc705855a182d9ec4817092a6c
data/README.md CHANGED
@@ -251,6 +251,8 @@ Class | Method | HTTP request | Description
251
251
  *Zernio::ConnectApi* | [**update_reddit_subreddits**](docs/ConnectApi.md#update_reddit_subreddits) | **PUT** /v1/accounts/{accountId}/reddit-subreddits | Set default subreddit
252
252
  *Zernio::ConnectApi* | [**update_youtube_default_playlist**](docs/ConnectApi.md#update_youtube_default_playlist) | **PUT** /v1/accounts/{accountId}/youtube-playlists | Set default YouTube playlist
253
253
  *Zernio::ConnectApi* | [**vote_reddit_thing**](docs/ConnectApi.md#vote_reddit_thing) | **POST** /v1/accounts/{accountId}/reddit-vote | Vote on a Reddit post or comment
254
+ *Zernio::ConnectedAppsApi* | [**list_connected_apps**](docs/ConnectedAppsApi.md#list_connected_apps) | **GET** /v1/me/connected-apps | List connected apps
255
+ *Zernio::ConnectedAppsApi* | [**revoke_connected_app**](docs/ConnectedAppsApi.md#revoke_connected_app) | **DELETE** /v1/me/connected-apps/{clientId} | Revoke connected app
254
256
  *Zernio::ContactsApi* | [**bulk_create_contacts**](docs/ContactsApi.md#bulk_create_contacts) | **POST** /v1/contacts/bulk | Bulk create contacts
255
257
  *Zernio::ContactsApi* | [**create_contact**](docs/ContactsApi.md#create_contact) | **POST** /v1/contacts | Create contact
256
258
  *Zernio::ContactsApi* | [**delete_contact**](docs/ContactsApi.md#delete_contact) | **DELETE** /v1/contacts/{contactId} | Delete contact
@@ -732,6 +734,7 @@ Class | Method | HTTP request | Description
732
734
  - [Zernio::ConnectWhatsAppCredentialsRequest](docs/ConnectWhatsAppCredentialsRequest.md)
733
735
  - [Zernio::Connected](docs/Connected.md)
734
736
  - [Zernio::ConnectedAccount](docs/ConnectedAccount.md)
737
+ - [Zernio::ConnectedApp](docs/ConnectedApp.md)
735
738
  - [Zernio::ConversionDestination](docs/ConversionDestination.md)
736
739
  - [Zernio::ConversionEvent](docs/ConversionEvent.md)
737
740
  - [Zernio::ConversionEventItemsInner](docs/ConversionEventItemsInner.md)
@@ -1415,6 +1418,7 @@ Class | Method | HTTP request | Description
1415
1418
  - [Zernio::ListCommentAutomations200Response](docs/ListCommentAutomations200Response.md)
1416
1419
  - [Zernio::ListCommentAutomations200ResponseAutomationsInner](docs/ListCommentAutomations200ResponseAutomationsInner.md)
1417
1420
  - [Zernio::ListCommentAutomations200ResponseAutomationsInnerStats](docs/ListCommentAutomations200ResponseAutomationsInnerStats.md)
1421
+ - [Zernio::ListConnectedApps200Response](docs/ListConnectedApps200Response.md)
1418
1422
  - [Zernio::ListContacts200Response](docs/ListContacts200Response.md)
1419
1423
  - [Zernio::ListContacts200ResponseContactsInner](docs/ListContacts200ResponseContactsInner.md)
1420
1424
  - [Zernio::ListContacts200ResponseFilters](docs/ListContacts200ResponseFilters.md)
@@ -1666,6 +1670,7 @@ Class | Method | HTTP request | Description
1666
1670
  - [Zernio::ReviewWebhookReview](docs/ReviewWebhookReview.md)
1667
1671
  - [Zernio::ReviewWebhookReviewReply](docs/ReviewWebhookReviewReply.md)
1668
1672
  - [Zernio::ReviewWebhookReviewReviewer](docs/ReviewWebhookReviewReviewer.md)
1673
+ - [Zernio::RevokeConnectedApp200Response](docs/RevokeConnectedApp200Response.md)
1669
1674
  - [Zernio::RfPrediction](docs/RfPrediction.md)
1670
1675
  - [Zernio::SavedTargetingAudience](docs/SavedTargetingAudience.md)
1671
1676
  - [Zernio::ScheduleBroadcast200Response](docs/ScheduleBroadcast200Response.md)
@@ -0,0 +1,30 @@
1
+ # Zernio::ConnectedApp
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **client_id** | **String** | | [optional] |
8
+ | **client_name** | **String** | Name the client declared at registration. Registration is open, so this is self-declared and not verified. | [optional] |
9
+ | **redirect_host** | **String** | Host of the client's registered redirect URI (non-http schemes are shown as scheme//host). The destination an impostor cannot fake. | [optional] |
10
+ | **scopes** | **Array<String>** | Scopes granted on the most recent token. | [optional] |
11
+ | **authorized_at** | **Time** | | [optional] |
12
+ | **last_used_at** | **Time** | Last time any of the client's live tokens authenticated a request. | [optional] |
13
+ | **token_count** | **Integer** | Live tokens held by the client (an active session is typically one access plus one refresh token). | [optional] |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'zernio-sdk'
19
+
20
+ instance = Zernio::ConnectedApp.new(
21
+ client_id: null,
22
+ client_name: null,
23
+ redirect_host: null,
24
+ scopes: null,
25
+ authorized_at: null,
26
+ last_used_at: null,
27
+ token_count: null
28
+ )
29
+ ```
30
+
@@ -0,0 +1,144 @@
1
+ # Zernio::ConnectedAppsApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**list_connected_apps**](ConnectedAppsApi.md#list_connected_apps) | **GET** /v1/me/connected-apps | List connected apps |
8
+ | [**revoke_connected_app**](ConnectedAppsApi.md#revoke_connected_app) | **DELETE** /v1/me/connected-apps/{clientId} | Revoke connected app |
9
+
10
+
11
+ ## list_connected_apps
12
+
13
+ > <ListConnectedApps200Response> list_connected_apps
14
+
15
+ List connected apps
16
+
17
+ Returns the OAuth clients (AI assistants and MCP connectors) the authenticated user has authorized and that still hold a live token. Requires a session or a full-scope API key. A profile-scoped API key or an OAuth access token is rejected with 403: an app must not be able to enumerate its sibling authorizations.
18
+
19
+ ### Examples
20
+
21
+ ```ruby
22
+ require 'time'
23
+ require 'zernio-sdk'
24
+ # setup authorization
25
+ Zernio.configure do |config|
26
+ # Configure Bearer authorization (JWT): bearerAuth
27
+ config.access_token = 'YOUR_BEARER_TOKEN'
28
+ end
29
+
30
+ api_instance = Zernio::ConnectedAppsApi.new
31
+
32
+ begin
33
+ # List connected apps
34
+ result = api_instance.list_connected_apps
35
+ p result
36
+ rescue Zernio::ApiError => e
37
+ puts "Error when calling ConnectedAppsApi->list_connected_apps: #{e}"
38
+ end
39
+ ```
40
+
41
+ #### Using the list_connected_apps_with_http_info variant
42
+
43
+ This returns an Array which contains the response data, status code and headers.
44
+
45
+ > <Array(<ListConnectedApps200Response>, Integer, Hash)> list_connected_apps_with_http_info
46
+
47
+ ```ruby
48
+ begin
49
+ # List connected apps
50
+ data, status_code, headers = api_instance.list_connected_apps_with_http_info
51
+ p status_code # => 2xx
52
+ p headers # => { ... }
53
+ p data # => <ListConnectedApps200Response>
54
+ rescue Zernio::ApiError => e
55
+ puts "Error when calling ConnectedAppsApi->list_connected_apps_with_http_info: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ This endpoint does not need any parameter.
62
+
63
+ ### Return type
64
+
65
+ [**ListConnectedApps200Response**](ListConnectedApps200Response.md)
66
+
67
+ ### Authorization
68
+
69
+ [bearerAuth](../README.md#bearerAuth)
70
+
71
+ ### HTTP request headers
72
+
73
+ - **Content-Type**: Not defined
74
+ - **Accept**: application/json
75
+
76
+
77
+ ## revoke_connected_app
78
+
79
+ > <RevokeConnectedApp200Response> revoke_connected_app(client_id)
80
+
81
+ Revoke connected app
82
+
83
+ Ends an app's access: invalidates the client's pending authorization codes and revokes every live token it holds for the authenticated user. Takes effect on the app's next request. Idempotent while the authorization is still on record: revoking an app that was already revoked returns 200 with `revokedTokens: 0`.
84
+
85
+ ### Examples
86
+
87
+ ```ruby
88
+ require 'time'
89
+ require 'zernio-sdk'
90
+ # setup authorization
91
+ Zernio.configure do |config|
92
+ # Configure Bearer authorization (JWT): bearerAuth
93
+ config.access_token = 'YOUR_BEARER_TOKEN'
94
+ end
95
+
96
+ api_instance = Zernio::ConnectedAppsApi.new
97
+ client_id = 'client_id_example' # String | OAuth client id, as returned by GET /v1/me/connected-apps.
98
+
99
+ begin
100
+ # Revoke connected app
101
+ result = api_instance.revoke_connected_app(client_id)
102
+ p result
103
+ rescue Zernio::ApiError => e
104
+ puts "Error when calling ConnectedAppsApi->revoke_connected_app: #{e}"
105
+ end
106
+ ```
107
+
108
+ #### Using the revoke_connected_app_with_http_info variant
109
+
110
+ This returns an Array which contains the response data, status code and headers.
111
+
112
+ > <Array(<RevokeConnectedApp200Response>, Integer, Hash)> revoke_connected_app_with_http_info(client_id)
113
+
114
+ ```ruby
115
+ begin
116
+ # Revoke connected app
117
+ data, status_code, headers = api_instance.revoke_connected_app_with_http_info(client_id)
118
+ p status_code # => 2xx
119
+ p headers # => { ... }
120
+ p data # => <RevokeConnectedApp200Response>
121
+ rescue Zernio::ApiError => e
122
+ puts "Error when calling ConnectedAppsApi->revoke_connected_app_with_http_info: #{e}"
123
+ end
124
+ ```
125
+
126
+ ### Parameters
127
+
128
+ | Name | Type | Description | Notes |
129
+ | ---- | ---- | ----------- | ----- |
130
+ | **client_id** | **String** | OAuth client id, as returned by GET /v1/me/connected-apps. | |
131
+
132
+ ### Return type
133
+
134
+ [**RevokeConnectedApp200Response**](RevokeConnectedApp200Response.md)
135
+
136
+ ### Authorization
137
+
138
+ [bearerAuth](../README.md#bearerAuth)
139
+
140
+ ### HTTP request headers
141
+
142
+ - **Content-Type**: Not defined
143
+ - **Accept**: application/json
144
+
@@ -0,0 +1,18 @@
1
+ # Zernio::ListConnectedApps200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **connected_apps** | [**Array&lt;ConnectedApp&gt;**](ConnectedApp.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'zernio-sdk'
13
+
14
+ instance = Zernio::ListConnectedApps200Response.new(
15
+ connected_apps: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,24 @@
1
+ # Zernio::RevokeConnectedApp200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **revoked** | **Boolean** | | [optional] |
8
+ | **client_id** | **String** | | [optional] |
9
+ | **revoked_tokens** | **Integer** | Access and refresh tokens revoked by this call. | [optional] |
10
+ | **invalidated_codes** | **Integer** | Pending authorization codes invalidated by this call. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::RevokeConnectedApp200Response.new(
18
+ revoked: null,
19
+ client_id: null,
20
+ revoked_tokens: null,
21
+ invalidated_codes: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,150 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Zernio
16
+ class ConnectedAppsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List connected apps
23
+ # Returns the OAuth clients (AI assistants and MCP connectors) the authenticated user has authorized and that still hold a live token. Requires a session or a full-scope API key. A profile-scoped API key or an OAuth access token is rejected with 403: an app must not be able to enumerate its sibling authorizations.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [ListConnectedApps200Response]
26
+ def list_connected_apps(opts = {})
27
+ data, _status_code, _headers = list_connected_apps_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # List connected apps
32
+ # Returns the OAuth clients (AI assistants and MCP connectors) the authenticated user has authorized and that still hold a live token. Requires a session or a full-scope API key. A profile-scoped API key or an OAuth access token is rejected with 403: an app must not be able to enumerate its sibling authorizations.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(ListConnectedApps200Response, Integer, Hash)>] ListConnectedApps200Response data, response status code and response headers
35
+ def list_connected_apps_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ConnectedAppsApi.list_connected_apps ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v1/me/connected-apps'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'ListConnectedApps200Response'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"ConnectedAppsApi.list_connected_apps",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: ConnectedAppsApi#list_connected_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Revoke connected app
80
+ # Ends an app's access: invalidates the client's pending authorization codes and revokes every live token it holds for the authenticated user. Takes effect on the app's next request. Idempotent while the authorization is still on record: revoking an app that was already revoked returns 200 with `revokedTokens: 0`.
81
+ # @param client_id [String] OAuth client id, as returned by GET /v1/me/connected-apps.
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [RevokeConnectedApp200Response]
84
+ def revoke_connected_app(client_id, opts = {})
85
+ data, _status_code, _headers = revoke_connected_app_with_http_info(client_id, opts)
86
+ data
87
+ end
88
+
89
+ # Revoke connected app
90
+ # Ends an app&#39;s access: invalidates the client&#39;s pending authorization codes and revokes every live token it holds for the authenticated user. Takes effect on the app&#39;s next request. Idempotent while the authorization is still on record: revoking an app that was already revoked returns 200 with &#x60;revokedTokens: 0&#x60;.
91
+ # @param client_id [String] OAuth client id, as returned by GET /v1/me/connected-apps.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(RevokeConnectedApp200Response, Integer, Hash)>] RevokeConnectedApp200Response data, response status code and response headers
94
+ def revoke_connected_app_with_http_info(client_id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: ConnectedAppsApi.revoke_connected_app ...'
97
+ end
98
+ # verify the required parameter 'client_id' is set
99
+ if @api_client.config.client_side_validation && client_id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ConnectedAppsApi.revoke_connected_app"
101
+ end
102
+ if @api_client.config.client_side_validation && client_id.to_s.length > 200
103
+ fail ArgumentError, 'invalid value for "client_id" when calling ConnectedAppsApi.revoke_connected_app, the character length must be smaller than or equal to 200.'
104
+ end
105
+
106
+ if @api_client.config.client_side_validation && client_id.to_s.length < 1
107
+ fail ArgumentError, 'invalid value for "client_id" when calling ConnectedAppsApi.revoke_connected_app, the character length must be greater than or equal to 1.'
108
+ end
109
+
110
+ # resource path
111
+ local_var_path = '/v1/me/connected-apps/{clientId}'.sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s))
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
120
+
121
+ # form parameters
122
+ form_params = opts[:form_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:debug_body]
126
+
127
+ # return_type
128
+ return_type = opts[:debug_return_type] || 'RevokeConnectedApp200Response'
129
+
130
+ # auth_names
131
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
132
+
133
+ new_options = opts.merge(
134
+ :operation => :"ConnectedAppsApi.revoke_connected_app",
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: ConnectedAppsApi#revoke_connected_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,212 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # An OAuth client (AI assistant / MCP connector) authorized by the user and still holding at least one live token.
18
+ class ConnectedApp < ApiModelBase
19
+ attr_accessor :client_id
20
+
21
+ # Name the client declared at registration. Registration is open, so this is self-declared and not verified.
22
+ attr_accessor :client_name
23
+
24
+ # Host of the client's registered redirect URI (non-http schemes are shown as scheme//host). The destination an impostor cannot fake.
25
+ attr_accessor :redirect_host
26
+
27
+ # Scopes granted on the most recent token.
28
+ attr_accessor :scopes
29
+
30
+ attr_accessor :authorized_at
31
+
32
+ # Last time any of the client's live tokens authenticated a request.
33
+ attr_accessor :last_used_at
34
+
35
+ # Live tokens held by the client (an active session is typically one access plus one refresh token).
36
+ attr_accessor :token_count
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'client_id' => :'clientId',
42
+ :'client_name' => :'clientName',
43
+ :'redirect_host' => :'redirectHost',
44
+ :'scopes' => :'scopes',
45
+ :'authorized_at' => :'authorizedAt',
46
+ :'last_used_at' => :'lastUsedAt',
47
+ :'token_count' => :'tokenCount'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'client_id' => :'String',
65
+ :'client_name' => :'String',
66
+ :'redirect_host' => :'String',
67
+ :'scopes' => :'Array<String>',
68
+ :'authorized_at' => :'Time',
69
+ :'last_used_at' => :'Time',
70
+ :'token_count' => :'Integer'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ :'redirect_host',
78
+ :'authorized_at',
79
+ :'last_used_at',
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ConnectedApp` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ConnectedApp`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'client_id')
100
+ self.client_id = attributes[:'client_id']
101
+ end
102
+
103
+ if attributes.key?(:'client_name')
104
+ self.client_name = attributes[:'client_name']
105
+ end
106
+
107
+ if attributes.key?(:'redirect_host')
108
+ self.redirect_host = attributes[:'redirect_host']
109
+ end
110
+
111
+ if attributes.key?(:'scopes')
112
+ if (value = attributes[:'scopes']).is_a?(Array)
113
+ self.scopes = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'authorized_at')
118
+ self.authorized_at = attributes[:'authorized_at']
119
+ end
120
+
121
+ if attributes.key?(:'last_used_at')
122
+ self.last_used_at = attributes[:'last_used_at']
123
+ end
124
+
125
+ if attributes.key?(:'token_count')
126
+ self.token_count = attributes[:'token_count']
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ client_id == o.client_id &&
151
+ client_name == o.client_name &&
152
+ redirect_host == o.redirect_host &&
153
+ scopes == o.scopes &&
154
+ authorized_at == o.authorized_at &&
155
+ last_used_at == o.last_used_at &&
156
+ token_count == o.token_count
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [client_id, client_name, redirect_host, scopes, authorized_at, last_used_at, token_count].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_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
+ end
211
+
212
+ end