form_api 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f6c112bcd18aa30cc3bbe6d81cefd3b9b82382cf7b645ef7844905d594e47c4e
4
- data.tar.gz: b14d3023317b5e8eda5d8db3c62fe0537c61213c07c058a6330e8ec44b6ab716
2
+ SHA1:
3
+ metadata.gz: af755c2ce95f2c89f1b61a8c7f20b450f2d00c11
4
+ data.tar.gz: a0cda83d2f444986fe463e58e55e9431503a4073
5
5
  SHA512:
6
- metadata.gz: 2844d4d2d9744c40a40a78df852f6b59a8fce19210204995fa5e983c17fd14b526f3a671ed8a28609de6ee5ee1b17593d49c186a7fc252e003c6bfc3b59701c9
7
- data.tar.gz: 2602eda92790f3aa9cd7c2cfdc76714d47441821077b49577b304ec32a4ade0502bb629a6e7aba1ab3666f9786beadcdf30494a6648e58d876e342036a11a959
6
+ metadata.gz: b7ca49414dfcb85f294ebb0075eec300bd7b8f4eb61c91f8de8850892edfb2f9b26c8ba3fdd34c3ed2c561a97d559df9856c1211f4cbed38b25fb6398ba093b9
7
+ data.tar.gz: c5839a4716ab0f937d012443b33c7353e98bfa1ac404dc874f751e26b8babbf989147ddab4681d6f5916577df6195fb65a71dac7cd766b128f8124c92a55e56c
data/README.md CHANGED
@@ -7,7 +7,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.2.0
10
+ - Package version: 1.3.0
11
11
  - Build package: io.formapi.codegen.FormApiRubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build form_api.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./form_api-1.2.0.gem
26
+ gem install ./form_api-1.3.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./form_api-1.2.0.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./form_api-1.3.0.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'form_api', '~> 1.2.0'
34
+ gem 'form_api', '~> 1.3.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -94,6 +94,7 @@ Class | Method | HTTP request | Description
94
94
  *FormAPI::PDFApi* | [**get_submission_batch**](docs/PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
95
95
  *FormAPI::PDFApi* | [**get_templates**](docs/PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates
96
96
  *FormAPI::PDFApi* | [**test_authentication**](docs/PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication
97
+ *FormAPI::PDFApi* | [**update_data_request**](docs/PDFApi.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request
97
98
 
98
99
 
99
100
  ## Documentation for Models
@@ -108,6 +109,7 @@ Class | Method | HTTP request | Description
108
109
  - [FormAPI::CreateSubmissionData](docs/CreateSubmissionData.md)
109
110
  - [FormAPI::CreateSubmissionDataBatchRequest](docs/CreateSubmissionDataBatchRequest.md)
110
111
  - [FormAPI::CreateSubmissionDataBatchV1](docs/CreateSubmissionDataBatchV1.md)
112
+ - [FormAPI::CreateSubmissionDataRequestData](docs/CreateSubmissionDataRequestData.md)
111
113
  - [FormAPI::CreateSubmissionDataRequestTokenResponse](docs/CreateSubmissionDataRequestTokenResponse.md)
112
114
  - [FormAPI::CreateSubmissionDataRequestTokenResponseToken](docs/CreateSubmissionDataRequestTokenResponseToken.md)
113
115
  - [FormAPI::CreateSubmissionResponse](docs/CreateSubmissionResponse.md)
@@ -117,8 +119,9 @@ Class | Method | HTTP request | Description
117
119
  - [FormAPI::SubmissionBatch](docs/SubmissionBatch.md)
118
120
  - [FormAPI::SubmissionBatchData](docs/SubmissionBatchData.md)
119
121
  - [FormAPI::SubmissionDataRequest](docs/SubmissionDataRequest.md)
120
- - [FormAPI::SubmissionDataRequestData](docs/SubmissionDataRequestData.md)
121
122
  - [FormAPI::Template](docs/Template.md)
123
+ - [FormAPI::UpdateDataRequestResponse](docs/UpdateDataRequestResponse.md)
124
+ - [FormAPI::UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md)
122
125
 
123
126
 
124
127
  ## Documentation for Authorization
@@ -8,6 +8,6 @@ Name | Type | Description | Notes
8
8
  **html** | **String** | | [optional]
9
9
  **css** | **String** | | [optional]
10
10
  **metadata** | **Object** | | [optional]
11
- **data_requests** | [**Array<SubmissionDataRequestData>**](SubmissionDataRequestData.md) | | [optional]
11
+ **data_requests** | [**Array<CreateSubmissionDataRequestData>**](CreateSubmissionDataRequestData.md) | | [optional]
12
12
 
13
13
 
@@ -0,0 +1,20 @@
1
+ # FormAPI::CreateSubmissionDataRequestData
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **metadata** | **Object** | | [optional]
7
+ **auth_type** | **String** | | [optional]
8
+ **auth_second_factor_type** | **String** | | [optional]
9
+ **auth_phone_number_hash** | **String** | | [optional]
10
+ **auth_session_started_at** | **String** | | [optional]
11
+ **auth_user_id_hash** | **String** | | [optional]
12
+ **auth_session_id_hash** | **String** | | [optional]
13
+ **auth_username_hash** | **String** | | [optional]
14
+ **name** | **String** | | [optional]
15
+ **fields** | **Array<String>** | | [optional]
16
+ **email** | **String** | | [optional]
17
+ **auth_provider** | **String** | | [optional]
18
+ **order** | **Integer** | | [optional]
19
+
20
+
@@ -17,6 +17,7 @@ Method | HTTP request | Description
17
17
  [**get_submission_batch**](PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
18
18
  [**get_templates**](PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates
19
19
  [**test_authentication**](PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication
20
+ [**update_data_request**](PDFApi.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request
20
21
 
21
22
 
22
23
  # **batch_generate_pdf_v1**
@@ -664,3 +665,54 @@ This endpoint does not need any parameter.
664
665
 
665
666
 
666
667
 
668
+ # **update_data_request**
669
+ > UpdateDataRequestResponse update_data_request(data_request_id, update_submission_data_request_data)
670
+
671
+ Update a submission data request
672
+
673
+ ### Example
674
+ ```ruby
675
+ # load the gem
676
+ require 'form_api'
677
+ # setup authorization
678
+ FormAPI.configure do |config|
679
+ # Configure HTTP basic authorization: api_token_basic
680
+ config.username = 'YOUR USERNAME'
681
+ config.password = 'YOUR PASSWORD'
682
+ end
683
+
684
+ api_instance = FormAPI::PDFApi.new
685
+ data_request_id = 'drq_000000000000000001' # String |
686
+ update_submission_data_request_data = FormAPI::UpdateSubmissionDataRequestData.new # UpdateSubmissionDataRequestData |
687
+
688
+ begin
689
+ #Update a submission data request
690
+ result = api_instance.update_data_request(data_request_id, update_submission_data_request_data)
691
+ p result
692
+ rescue FormAPI::ApiError => e
693
+ puts "Exception when calling PDFApi->update_data_request: #{e}"
694
+ end
695
+ ```
696
+
697
+ ### Parameters
698
+
699
+ Name | Type | Description | Notes
700
+ ------------- | ------------- | ------------- | -------------
701
+ **data_request_id** | **String**| |
702
+ **update_submission_data_request_data** | [**UpdateSubmissionDataRequestData**](UpdateSubmissionDataRequestData.md)| |
703
+
704
+ ### Return type
705
+
706
+ [**UpdateDataRequestResponse**](UpdateDataRequestResponse.md)
707
+
708
+ ### Authorization
709
+
710
+ [api_token_basic](../README.md#api_token_basic)
711
+
712
+ ### HTTP request headers
713
+
714
+ - **Content-Type**: application/json
715
+ - **Accept**: application/json
716
+
717
+
718
+
@@ -12,5 +12,13 @@ Name | Type | Description | Notes
12
12
  **state** | **String** | |
13
13
  **viewed_at** | **String** | | [optional]
14
14
  **completed_at** | **String** | | [optional]
15
+ **auth_type** | **String** | | [optional]
16
+ **auth_second_factor_type** | **String** | | [optional]
17
+ **auth_provider** | **String** | | [optional]
18
+ **auth_session_started_at** | **String** | | [optional]
19
+ **auth_session_id_hash** | **String** | | [optional]
20
+ **auth_user_id_hash** | **String** | | [optional]
21
+ **auth_username_hash** | **String** | | [optional]
22
+ **auth_phone_number_hash** | **String** | | [optional]
15
23
 
16
24
 
@@ -0,0 +1,10 @@
1
+ # FormAPI::UpdateDataRequestResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data_request** | [**SubmissionDataRequest**](SubmissionDataRequest.md) | | [optional]
7
+ **errors** | **Array<String>** | | [optional]
8
+ **status** | **String** | | [optional]
9
+
10
+
@@ -0,0 +1,20 @@
1
+ # FormAPI::UpdateSubmissionDataRequestData
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **name** | **String** | | [optional]
7
+ **email** | **String** | | [optional]
8
+ **order** | **Integer** | | [optional]
9
+ **fields** | **Array<String>** | | [optional]
10
+ **metadata** | **Object** | | [optional]
11
+ **auth_type** | **String** | | [optional]
12
+ **auth_second_factor_type** | **String** | | [optional]
13
+ **auth_provider** | **String** | | [optional]
14
+ **auth_session_started_at** | **String** | | [optional]
15
+ **auth_session_id_hash** | **String** | | [optional]
16
+ **auth_user_id_hash** | **String** | | [optional]
17
+ **auth_username_hash** | **String** | | [optional]
18
+ **auth_phone_number_hash** | **String** | | [optional]
19
+
20
+
@@ -27,6 +27,7 @@ require 'form_api/models/create_submission_batch_submissions_response'
27
27
  require 'form_api/models/create_submission_data'
28
28
  require 'form_api/models/create_submission_data_batch_request'
29
29
  require 'form_api/models/create_submission_data_batch_v1'
30
+ require 'form_api/models/create_submission_data_request_data'
30
31
  require 'form_api/models/create_submission_data_request_token_response'
31
32
  require 'form_api/models/create_submission_data_request_token_response_token'
32
33
  require 'form_api/models/create_submission_response'
@@ -36,8 +37,9 @@ require 'form_api/models/submission'
36
37
  require 'form_api/models/submission_batch'
37
38
  require 'form_api/models/submission_batch_data'
38
39
  require 'form_api/models/submission_data_request'
39
- require 'form_api/models/submission_data_request_data'
40
40
  require 'form_api/models/template'
41
+ require 'form_api/models/update_data_request_response'
42
+ require 'form_api/models/update_submission_data_request_data'
41
43
 
42
44
  # APIs
43
45
  require 'form_api/api/pdf_api'
@@ -711,5 +711,64 @@ module FormAPI
711
711
  return data, status_code, headers
712
712
  end
713
713
 
714
+ # Update a submission data request
715
+ # @param data_request_id
716
+ # @param update_submission_data_request_data
717
+ # @param [Hash] opts the optional parameters
718
+ # @return [UpdateDataRequestResponse]
719
+ def update_data_request(data_request_id, update_submission_data_request_data, opts = {})
720
+ data, _status_code, _headers = update_data_request_with_http_info(data_request_id, update_submission_data_request_data, opts)
721
+ data
722
+ end
723
+
724
+ # Update a submission data request
725
+ # @param data_request_id
726
+ # @param update_submission_data_request_data
727
+ # @param [Hash] opts the optional parameters
728
+ # @return [Array<(UpdateDataRequestResponse, Fixnum, Hash)>] UpdateDataRequestResponse data, response status code and response headers
729
+ def update_data_request_with_http_info(data_request_id, update_submission_data_request_data, opts = {})
730
+ if @api_client.config.debugging
731
+ @api_client.config.logger.debug 'Calling API: PDFApi.update_data_request ...'
732
+ end
733
+ # verify the required parameter 'data_request_id' is set
734
+ if @api_client.config.client_side_validation && data_request_id.nil?
735
+ fail ArgumentError, "Missing the required parameter 'data_request_id' when calling PDFApi.update_data_request"
736
+ end
737
+ # verify the required parameter 'update_submission_data_request_data' is set
738
+ if @api_client.config.client_side_validation && update_submission_data_request_data.nil?
739
+ fail ArgumentError, "Missing the required parameter 'update_submission_data_request_data' when calling PDFApi.update_data_request"
740
+ end
741
+ # resource path
742
+ local_var_path = '/data_requests/{data_request_id}'.sub('{' + 'data_request_id' + '}', data_request_id.to_s)
743
+
744
+ # query parameters
745
+ query_params = {}
746
+
747
+ # header parameters
748
+ header_params = {}
749
+ # HTTP header 'Accept' (if needed)
750
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
751
+ # HTTP header 'Content-Type'
752
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
753
+
754
+ # form parameters
755
+ form_params = {}
756
+
757
+ # http body (model)
758
+ post_body = @api_client.object_to_http_body(update_submission_data_request_data)
759
+ auth_names = ['api_token_basic']
760
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
761
+ :header_params => header_params,
762
+ :query_params => query_params,
763
+ :form_params => form_params,
764
+ :body => post_body,
765
+ :auth_names => auth_names,
766
+ :return_type => 'UpdateDataRequestResponse')
767
+ if @api_client.config.debugging
768
+ @api_client.config.logger.debug "API called: PDFApi#update_data_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
769
+ end
770
+ return data, status_code, headers
771
+ end
772
+
714
773
  end
715
774
  end
@@ -46,7 +46,7 @@ module FormAPI
46
46
  :'html' => :'String',
47
47
  :'css' => :'String',
48
48
  :'metadata' => :'Object',
49
- :'data_requests' => :'Array<SubmissionDataRequestData>'
49
+ :'data_requests' => :'Array<CreateSubmissionDataRequestData>'
50
50
  }
51
51
  end
52
52
 
@@ -0,0 +1,339 @@
1
+ =begin
2
+ #API V1
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module FormAPI
16
+ class CreateSubmissionDataRequestData
17
+ attr_accessor :metadata
18
+
19
+ attr_accessor :auth_type
20
+
21
+ attr_accessor :auth_second_factor_type
22
+
23
+ attr_accessor :auth_phone_number_hash
24
+
25
+ attr_accessor :auth_session_started_at
26
+
27
+ attr_accessor :auth_user_id_hash
28
+
29
+ attr_accessor :auth_session_id_hash
30
+
31
+ attr_accessor :auth_username_hash
32
+
33
+ attr_accessor :name
34
+
35
+ attr_accessor :fields
36
+
37
+ attr_accessor :email
38
+
39
+ attr_accessor :auth_provider
40
+
41
+ attr_accessor :order
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'metadata' => :'metadata',
69
+ :'auth_type' => :'auth_type',
70
+ :'auth_second_factor_type' => :'auth_second_factor_type',
71
+ :'auth_phone_number_hash' => :'auth_phone_number_hash',
72
+ :'auth_session_started_at' => :'auth_session_started_at',
73
+ :'auth_user_id_hash' => :'auth_user_id_hash',
74
+ :'auth_session_id_hash' => :'auth_session_id_hash',
75
+ :'auth_username_hash' => :'auth_username_hash',
76
+ :'name' => :'name',
77
+ :'fields' => :'fields',
78
+ :'email' => :'email',
79
+ :'auth_provider' => :'auth_provider',
80
+ :'order' => :'order'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'metadata' => :'Object',
88
+ :'auth_type' => :'String',
89
+ :'auth_second_factor_type' => :'String',
90
+ :'auth_phone_number_hash' => :'String',
91
+ :'auth_session_started_at' => :'String',
92
+ :'auth_user_id_hash' => :'String',
93
+ :'auth_session_id_hash' => :'String',
94
+ :'auth_username_hash' => :'String',
95
+ :'name' => :'String',
96
+ :'fields' => :'Array<String>',
97
+ :'email' => :'String',
98
+ :'auth_provider' => :'String',
99
+ :'order' => :'Integer'
100
+ }
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ return unless attributes.is_a?(Hash)
107
+
108
+ # convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
110
+
111
+ if attributes.has_key?(:'metadata')
112
+ self.metadata = attributes[:'metadata']
113
+ end
114
+
115
+ if attributes.has_key?(:'auth_type')
116
+ self.auth_type = attributes[:'auth_type']
117
+ end
118
+
119
+ if attributes.has_key?(:'auth_second_factor_type')
120
+ self.auth_second_factor_type = attributes[:'auth_second_factor_type']
121
+ end
122
+
123
+ if attributes.has_key?(:'auth_phone_number_hash')
124
+ self.auth_phone_number_hash = attributes[:'auth_phone_number_hash']
125
+ end
126
+
127
+ if attributes.has_key?(:'auth_session_started_at')
128
+ self.auth_session_started_at = attributes[:'auth_session_started_at']
129
+ end
130
+
131
+ if attributes.has_key?(:'auth_user_id_hash')
132
+ self.auth_user_id_hash = attributes[:'auth_user_id_hash']
133
+ end
134
+
135
+ if attributes.has_key?(:'auth_session_id_hash')
136
+ self.auth_session_id_hash = attributes[:'auth_session_id_hash']
137
+ end
138
+
139
+ if attributes.has_key?(:'auth_username_hash')
140
+ self.auth_username_hash = attributes[:'auth_username_hash']
141
+ end
142
+
143
+ if attributes.has_key?(:'name')
144
+ self.name = attributes[:'name']
145
+ end
146
+
147
+ if attributes.has_key?(:'fields')
148
+ if (value = attributes[:'fields']).is_a?(Array)
149
+ self.fields = value
150
+ end
151
+ end
152
+
153
+ if attributes.has_key?(:'email')
154
+ self.email = attributes[:'email']
155
+ end
156
+
157
+ if attributes.has_key?(:'auth_provider')
158
+ self.auth_provider = attributes[:'auth_provider']
159
+ end
160
+
161
+ if attributes.has_key?(:'order')
162
+ self.order = attributes[:'order']
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ invalid_properties = Array.new
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ auth_type_validator = EnumAttributeValidator.new('String', ['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml'])
177
+ return false unless auth_type_validator.valid?(@auth_type)
178
+ auth_second_factor_type_validator = EnumAttributeValidator.new('String', ['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint'])
179
+ return false unless auth_second_factor_type_validator.valid?(@auth_second_factor_type)
180
+ true
181
+ end
182
+
183
+ # Custom attribute writer method checking allowed values (enum).
184
+ # @param [Object] auth_type Object to be assigned
185
+ def auth_type=(auth_type)
186
+ validator = EnumAttributeValidator.new('String', ['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml'])
187
+ unless validator.valid?(auth_type)
188
+ fail ArgumentError, 'invalid value for "auth_type", must be one of #{validator.allowable_values}.'
189
+ end
190
+ @auth_type = auth_type
191
+ end
192
+
193
+ # Custom attribute writer method checking allowed values (enum).
194
+ # @param [Object] auth_second_factor_type Object to be assigned
195
+ def auth_second_factor_type=(auth_second_factor_type)
196
+ validator = EnumAttributeValidator.new('String', ['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint'])
197
+ unless validator.valid?(auth_second_factor_type)
198
+ fail ArgumentError, 'invalid value for "auth_second_factor_type", must be one of #{validator.allowable_values}.'
199
+ end
200
+ @auth_second_factor_type = auth_second_factor_type
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ metadata == o.metadata &&
209
+ auth_type == o.auth_type &&
210
+ auth_second_factor_type == o.auth_second_factor_type &&
211
+ auth_phone_number_hash == o.auth_phone_number_hash &&
212
+ auth_session_started_at == o.auth_session_started_at &&
213
+ auth_user_id_hash == o.auth_user_id_hash &&
214
+ auth_session_id_hash == o.auth_session_id_hash &&
215
+ auth_username_hash == o.auth_username_hash &&
216
+ name == o.name &&
217
+ fields == o.fields &&
218
+ email == o.email &&
219
+ auth_provider == o.auth_provider &&
220
+ order == o.order
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Fixnum] Hash code
231
+ def hash
232
+ [metadata, auth_type, auth_second_factor_type, auth_phone_number_hash, auth_session_started_at, auth_user_id_hash, auth_session_id_hash, auth_username_hash, name, fields, email, auth_provider, order].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ self.class.openapi_types.each_pair do |key, type|
241
+ if type =~ /\AArray<(.*)>/i
242
+ # check to ensure the input is an array given that the the attribute
243
+ # is documented as an array but the input is not
244
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
245
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
246
+ end
247
+ elsif !attributes[self.class.attribute_map[key]].nil?
248
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
249
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
250
+ end
251
+
252
+ self
253
+ end
254
+
255
+ # Deserializes the data based on type
256
+ # @param string type Data type
257
+ # @param string value Value to be deserialized
258
+ # @return [Object] Deserialized data
259
+ def _deserialize(type, value)
260
+ case type.to_sym
261
+ when :DateTime
262
+ DateTime.parse(value)
263
+ when :Date
264
+ Date.parse(value)
265
+ when :String
266
+ value.to_s
267
+ when :Integer
268
+ value.to_i
269
+ when :Float
270
+ value.to_f
271
+ when :BOOLEAN
272
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ true
274
+ else
275
+ false
276
+ end
277
+ when :Object
278
+ # generic object (usually a Hash), return directly
279
+ value
280
+ when /\AArray<(?<inner_type>.+)>\z/
281
+ inner_type = Regexp.last_match[:inner_type]
282
+ value.map { |v| _deserialize(inner_type, v) }
283
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ k_type = Regexp.last_match[:k_type]
285
+ v_type = Regexp.last_match[:v_type]
286
+ {}.tap do |hash|
287
+ value.each do |k, v|
288
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
+ end
290
+ end
291
+ else # model
292
+ temp_model = FormAPI.const_get(type).new
293
+ temp_model.build_from_hash(value)
294
+ end
295
+ end
296
+
297
+ # Returns the string representation of the object
298
+ # @return [String] String presentation of the object
299
+ def to_s
300
+ to_hash.to_s
301
+ end
302
+
303
+ # to_body is an alias to to_hash (backward compatibility)
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_body
306
+ to_hash
307
+ end
308
+
309
+ # Returns the object in the form of hash
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_hash
312
+ hash = {}
313
+ self.class.attribute_map.each_pair do |attr, param|
314
+ value = self.send(attr)
315
+ next if value.nil?
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+ end
339
+ end