aspose_email_cloud 20.1.0 → 20.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +10 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +24 -0
  4. data/lib/aspose-email-cloud/models/discover_email_config_oauth.rb +388 -0
  5. data/lib/aspose-email-cloud/models/discover_email_config_password.rb +301 -0
  6. data/lib/aspose-email-cloud/models/discover_email_config_rq.rb +265 -0
  7. data/lib/aspose-email-cloud/models/email_account_config.rb +320 -0
  8. data/lib/aspose-email-cloud/models/email_account_config_list.rb +212 -0
  9. data/lib/aspose-email-cloud/models/list_response_of_email_account_config.rb +211 -0
  10. data/lib/aspose-email-cloud/models/name_value_pair.rb +222 -0
  11. data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +18 -8
  12. data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +23 -10
  13. data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +18 -8
  14. data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +18 -8
  15. data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_request_data.rb +7 -3
  16. data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_storage_request_data.rb +7 -3
  17. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_model_request_data.rb +7 -3
  18. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_ocr_data_model_request_data.rb +7 -3
  19. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_request_data.rb +7 -3
  20. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_storage_request_data.rb +7 -3
  21. data/lib/aspose-email-cloud/models/requests/ai_name_complete_request_data.rb +32 -13
  22. data/lib/aspose-email-cloud/models/requests/ai_name_expand_parsed_request_data.rb +7 -3
  23. data/lib/aspose-email-cloud/models/requests/ai_name_expand_request_data.rb +32 -13
  24. data/lib/aspose-email-cloud/models/requests/ai_name_format_parsed_request_data.rb +7 -3
  25. data/lib/aspose-email-cloud/models/requests/ai_name_format_request_data.rb +37 -15
  26. data/lib/aspose-email-cloud/models/requests/ai_name_genderize_parsed_request_data.rb +7 -3
  27. data/lib/aspose-email-cloud/models/requests/ai_name_genderize_request_data.rb +32 -13
  28. data/lib/aspose-email-cloud/models/requests/ai_name_match_parsed_request_data.rb +7 -3
  29. data/lib/aspose-email-cloud/models/requests/ai_name_match_request_data.rb +38 -16
  30. data/lib/aspose-email-cloud/models/requests/ai_name_parse_email_address_request_data.rb +32 -13
  31. data/lib/aspose-email-cloud/models/requests/ai_name_parse_request_data.rb +32 -13
  32. data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +7 -3
  33. data/lib/aspose-email-cloud/models/requests/append_email_model_message_request_data.rb +7 -3
  34. data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +7 -3
  35. data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_alternate_request_data.rb +7 -3
  36. data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +13 -6
  37. data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +28 -12
  38. data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +23 -10
  39. data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +13 -6
  40. data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +18 -8
  41. data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +7 -3
  42. data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +14 -7
  43. data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +12 -5
  44. data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +13 -6
  45. data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +23 -10
  46. data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +28 -12
  47. data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +7 -3
  48. data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +7 -3
  49. data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +17 -7
  50. data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +17 -7
  51. data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +18 -8
  52. data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +13 -6
  53. data/lib/aspose-email-cloud/models/requests/discover_email_config_oauth_request_data.rb +79 -0
  54. data/lib/aspose-email-cloud/models/requests/discover_email_config_password_request_data.rb +79 -0
  55. data/lib/aspose-email-cloud/models/requests/discover_email_config_request_data.rb +86 -0
  56. data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +17 -7
  57. data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +28 -12
  58. data/lib/aspose-email-cloud/models/requests/fetch_email_model_request_data.rb +28 -12
  59. data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +23 -10
  60. data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +24 -11
  61. data/lib/aspose-email-cloud/models/requests/get_calendar_model_as_alternate_request_data.rb +27 -11
  62. data/lib/aspose-email-cloud/models/requests/get_calendar_model_list_request_data.rb +22 -9
  63. data/lib/aspose-email-cloud/models/requests/get_calendar_model_request_data.rb +17 -7
  64. data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +17 -7
  65. data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +28 -12
  66. data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +27 -11
  67. data/lib/aspose-email-cloud/models/requests/get_contact_model_list_request_data.rb +27 -11
  68. data/lib/aspose-email-cloud/models/requests/get_contact_model_request_data.rb +22 -9
  69. data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +22 -9
  70. data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +6 -2
  71. data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +23 -10
  72. data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +23 -10
  73. data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +27 -11
  74. data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +22 -9
  75. data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +22 -9
  76. data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +17 -7
  77. data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +12 -5
  78. data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +12 -5
  79. data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +23 -10
  80. data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +17 -7
  81. data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +21 -8
  82. data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +17 -7
  83. data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +27 -11
  84. data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +39 -17
  85. data/lib/aspose-email-cloud/models/requests/list_email_models_request_data.rb +39 -17
  86. data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +28 -12
  87. data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +23 -10
  88. data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +17 -7
  89. data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +13 -6
  90. data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +18 -8
  91. data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +18 -8
  92. data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +7 -3
  93. data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +7 -3
  94. data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +7 -3
  95. data/lib/aspose-email-cloud/models/requests/send_email_model_request_data.rb +7 -3
  96. data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +7 -3
  97. data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +18 -8
  98. data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +7 -3
  99. data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +7 -3
  100. data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +13 -6
  101. data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +18 -8
  102. data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +13 -6
  103. data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +18 -8
  104. data/lib/aspose-email-cloud/version.rb +1 -1
  105. metadata +12 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c49e8dbd0a3fd74cb819c46738da142d1c43434f1e7a4b446e892487fa5c6d4
4
- data.tar.gz: c0c9819dc6f9e1363122fabcf3035c758b7fa7008a6f3fa99318b3cd65d5b49d
3
+ metadata.gz: b00a1fb44618852859397be2419126c0414282f6f6e9e6f0b2a41902bb6e6ac8
4
+ data.tar.gz: 98d5a2f5d692371922332d1df9bae6d02b4b4aed44adf678f02215d185bdfc58
5
5
  SHA512:
6
- metadata.gz: fe7f588de77a7dec6e30643746ae363e033a611f59dd685944dd504c49cb007ce9920bd9844f03a33a2b56c6d2c6c98bc384cca7b7ef35f429aa2b4dfd6f6dca
7
- data.tar.gz: 4ca8c9046d0dd6d2ff251952396f8e964fd027d35aa41d8643c424a2a2ca862aefa836d2143729f5c514687c27e2867cb173fa5989fddadfb69b400cfdd9d834
6
+ metadata.gz: 5abb3f96bf2f552936ea72462a65432a8556905d8d308712009c49a7e4c69cb5af730d3bd8de1672afbd2c837487468c24c24c7c657246c69a54660b1cf09105
7
+ data.tar.gz: c19577f0e204a37b1ec442819d45e6a8b64753ed983ded2e1a590b25338a57c35481868183b35a344d26a9aeb8cdc76cada82d19b6b9c6c992350eb1b0bfb451
@@ -62,6 +62,8 @@ require_relative './aspose-email-cloud/models/content_type_parameter'
62
62
  require_relative './aspose-email-cloud/models/create_email_request'
63
63
  require_relative './aspose-email-cloud/models/customer_event'
64
64
  require_relative './aspose-email-cloud/models/disc_usage'
65
+ require_relative './aspose-email-cloud/models/discover_email_config_rq'
66
+ require_relative './aspose-email-cloud/models/email_account_config'
65
67
  require_relative './aspose-email-cloud/models/email_account_request'
66
68
  require_relative './aspose-email-cloud/models/email_address'
67
69
  require_relative './aspose-email-cloud/models/email_document'
@@ -91,6 +93,7 @@ require_relative './aspose-email-cloud/models/list_response_of_ai_name_component
91
93
  require_relative './aspose-email-cloud/models/list_response_of_ai_name_extracted'
92
94
  require_relative './aspose-email-cloud/models/list_response_of_ai_name_gender_hypothesis'
93
95
  require_relative './aspose-email-cloud/models/list_response_of_contact_dto'
96
+ require_relative './aspose-email-cloud/models/list_response_of_email_account_config'
94
97
  require_relative './aspose-email-cloud/models/list_response_of_email_dto'
95
98
  require_relative './aspose-email-cloud/models/list_response_of_hierarchical_object'
96
99
  require_relative './aspose-email-cloud/models/list_response_of_hierarchical_object_response'
@@ -103,6 +106,7 @@ require_relative './aspose-email-cloud/models/list_response_of_string'
103
106
  require_relative './aspose-email-cloud/models/mail_address'
104
107
  require_relative './aspose-email-cloud/models/mail_server_folder'
105
108
  require_relative './aspose-email-cloud/models/mime_response'
109
+ require_relative './aspose-email-cloud/models/name_value_pair'
106
110
  require_relative './aspose-email-cloud/models/object_exist'
107
111
  require_relative './aspose-email-cloud/models/phone_number'
108
112
  require_relative './aspose-email-cloud/models/postal_address'
@@ -134,6 +138,9 @@ require_relative './aspose-email-cloud/models/contact_dto_list'
134
138
  require_relative './aspose-email-cloud/models/create_folder_base_request'
135
139
  require_relative './aspose-email-cloud/models/delete_folder_base_request'
136
140
  require_relative './aspose-email-cloud/models/delete_message_base_request'
141
+ require_relative './aspose-email-cloud/models/discover_email_config_oauth'
142
+ require_relative './aspose-email-cloud/models/discover_email_config_password'
143
+ require_relative './aspose-email-cloud/models/email_account_config_list'
137
144
  require_relative './aspose-email-cloud/models/email_dto_list'
138
145
  require_relative './aspose-email-cloud/models/file_version'
139
146
  require_relative './aspose-email-cloud/models/hierarchical_object'
@@ -200,6 +207,9 @@ require_relative './aspose-email-cloud/models/requests/delete_file_request_data.
200
207
  require_relative './aspose-email-cloud/models/requests/delete_folder_request_data.rb'
201
208
  require_relative './aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb'
202
209
  require_relative './aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb'
210
+ require_relative './aspose-email-cloud/models/requests/discover_email_config_oauth_request_data.rb'
211
+ require_relative './aspose-email-cloud/models/requests/discover_email_config_password_request_data.rb'
212
+ require_relative './aspose-email-cloud/models/requests/discover_email_config_request_data.rb'
203
213
  require_relative './aspose-email-cloud/models/requests/download_file_request_data.rb'
204
214
  require_relative './aspose-email-cloud/models/requests/email_request.rb'
205
215
  require_relative './aspose-email-cloud/models/requests/fetch_email_message_request_data.rb'
@@ -396,6 +396,30 @@ module AsposeEmailCloud
396
396
  nil
397
397
  end
398
398
 
399
+ # Discover email accounts by email address. Does not validate discovered accounts.
400
+ # @param [DiscoverEmailConfigRequestData] request Request object.
401
+ # @return [EmailAccountConfigList]
402
+ def discover_email_config(request)
403
+ http_request = request.to_http_info(@api_client)
404
+ make_request(http_request, :GET, 'EmailAccountConfigList')
405
+ end
406
+
407
+ # Discover email accounts by email address. Validates discovered accounts using OAuth 2.0.
408
+ # @param [DiscoverEmailConfigOauthRequestData] request Request object.
409
+ # @return [EmailAccountConfigList]
410
+ def discover_email_config_oauth(request)
411
+ http_request = request.to_http_info(@api_client)
412
+ make_request(http_request, :POST, 'EmailAccountConfigList')
413
+ end
414
+
415
+ # Discover email accounts by email address. Validates discovered accounts using login and password.
416
+ # @param [DiscoverEmailConfigPasswordRequestData] request Request object.
417
+ # @return [EmailAccountConfigList]
418
+ def discover_email_config_password(request)
419
+ http_request = request.to_http_info(@api_client)
420
+ make_request(http_request, :POST, 'EmailAccountConfigList')
421
+ end
422
+
399
423
  # Download file
400
424
  # @param [DownloadFileRequestData] request Request object.
401
425
  # @return [File]
@@ -0,0 +1,388 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="DiscoverEmailConfigOauth.rb">
3
+ # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+ # </summary>
24
+ # ----------------------------------------------------------------------------
25
+
26
+
27
+ require 'date'
28
+
29
+ module AsposeEmailCloud
30
+ class DiscoverEmailConfigOauth
31
+ # Email address to discover.
32
+ # @return [String]
33
+ attr_accessor :address
34
+
35
+ # Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
36
+ # @return [BOOLEAN]
37
+ attr_accessor :fast_processing
38
+
39
+ # Email account login. If not specified, address used as a login.
40
+ # @return [String]
41
+ attr_accessor :login
42
+
43
+ # OAuth client id.
44
+ # @return [String]
45
+ attr_accessor :client_id
46
+
47
+ # OAuth client secret.
48
+ # @return [String]
49
+ attr_accessor :client_secret
50
+
51
+ # OAuth refresh token.
52
+ # @return [String]
53
+ attr_accessor :refresh_token
54
+
55
+ # The url to obtain access token. If not specified, will be discovered from email configuration.
56
+ # @return [String]
57
+ attr_accessor :request_url
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'address' => :'address',
63
+ :'fast_processing' => :'fastProcessing',
64
+ :'login' => :'login',
65
+ :'client_id' => :'clientId',
66
+ :'client_secret' => :'clientSecret',
67
+ :'refresh_token' => :'refreshToken',
68
+ :'request_url' => :'requestUrl'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'address' => :'String',
76
+ :'fast_processing' => :'BOOLEAN',
77
+ :'login' => :'String',
78
+ :'client_id' => :'String',
79
+ :'client_secret' => :'String',
80
+ :'refresh_token' => :'String',
81
+ :'request_url' => :'String'
82
+ }
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ return unless attributes.is_a?(Hash)
89
+
90
+ # convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
+
93
+ if attributes.has_key?(:'address')
94
+ self.address = attributes[:'address']
95
+ end
96
+
97
+ if attributes.has_key?(:'fastProcessing')
98
+ self.fast_processing = attributes[:'fastProcessing']
99
+ end
100
+
101
+ if attributes.has_key?(:'login')
102
+ self.login = attributes[:'login']
103
+ end
104
+
105
+ if attributes.has_key?(:'clientId')
106
+ self.client_id = attributes[:'clientId']
107
+ end
108
+
109
+ if attributes.has_key?(:'clientSecret')
110
+ self.client_secret = attributes[:'clientSecret']
111
+ end
112
+
113
+ if attributes.has_key?(:'refreshToken')
114
+ self.refresh_token = attributes[:'refreshToken']
115
+ end
116
+
117
+ if attributes.has_key?(:'requestUrl')
118
+ self.request_url = attributes[:'requestUrl']
119
+ end
120
+ end
121
+
122
+ # Initializes the object
123
+ # @param [String] address Email address to discover.
124
+ # @param [BOOLEAN] fast_processing Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
125
+ # @param [String] login Email account login. If not specified, address used as a login.
126
+ # @param [String] client_id OAuth client id.
127
+ # @param [String] client_secret OAuth client secret.
128
+ # @param [String] refresh_token OAuth refresh token.
129
+ # @param [String] request_url The url to obtain access token. If not specified, will be discovered from email configuration.
130
+ def initialize(address=nil, fast_processing=nil, login=nil, client_id=nil, client_secret=nil, refresh_token=nil, request_url=nil)
131
+ self.address = address if address
132
+ self.fast_processing = fast_processing if fast_processing
133
+ self.login = login if login
134
+ self.client_id = client_id if client_id
135
+ self.client_secret = client_secret if client_secret
136
+ self.refresh_token = refresh_token if refresh_token
137
+ self.request_url = request_url if request_url
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ invalid_properties = Array.new
144
+ if @address.nil?
145
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
146
+ end
147
+
148
+ if @address.to_s.length < 1
149
+ invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.')
150
+ end
151
+
152
+ if @fast_processing.nil?
153
+ invalid_properties.push('invalid value for "fast_processing", fast_processing cannot be nil.')
154
+ end
155
+
156
+ if @client_id.nil?
157
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
158
+ end
159
+
160
+ if @client_id.to_s.length < 1
161
+ invalid_properties.push('invalid value for "client_id", the character length must be great than or equal to 1.')
162
+ end
163
+
164
+ if @client_secret.nil?
165
+ invalid_properties.push('invalid value for "client_secret", client_secret cannot be nil.')
166
+ end
167
+
168
+ if @client_secret.to_s.length < 1
169
+ invalid_properties.push('invalid value for "client_secret", the character length must be great than or equal to 1.')
170
+ end
171
+
172
+ if @refresh_token.nil?
173
+ invalid_properties.push('invalid value for "refresh_token", refresh_token cannot be nil.')
174
+ end
175
+
176
+ if @refresh_token.to_s.length < 1
177
+ invalid_properties.push('invalid value for "refresh_token", the character length must be great than or equal to 1.')
178
+ end
179
+
180
+ invalid_properties
181
+ end
182
+
183
+ # Check to see if the all the properties in the model are valid
184
+ # @return true if the model is valid
185
+ def valid?
186
+ return false if @address.nil?
187
+ return false if @address.to_s.length < 1
188
+ return false if @fast_processing.nil?
189
+ return false if @client_id.nil?
190
+ return false if @client_id.to_s.length < 1
191
+ return false if @client_secret.nil?
192
+ return false if @client_secret.to_s.length < 1
193
+ return false if @refresh_token.nil?
194
+ return false if @refresh_token.to_s.length < 1
195
+ true
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] address Value to be assigned
200
+ def address=(address)
201
+ if address.nil?
202
+ fail ArgumentError, 'address cannot be nil'
203
+ end
204
+
205
+ if address.to_s.length < 1
206
+ fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.'
207
+ end
208
+
209
+ @address = address
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] client_id Value to be assigned
214
+ def client_id=(client_id)
215
+ if client_id.nil?
216
+ fail ArgumentError, 'client_id cannot be nil'
217
+ end
218
+
219
+ if client_id.to_s.length < 1
220
+ fail ArgumentError, 'invalid value for "client_id", the character length must be great than or equal to 1.'
221
+ end
222
+
223
+ @client_id = client_id
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] client_secret Value to be assigned
228
+ def client_secret=(client_secret)
229
+ if client_secret.nil?
230
+ fail ArgumentError, 'client_secret cannot be nil'
231
+ end
232
+
233
+ if client_secret.to_s.length < 1
234
+ fail ArgumentError, 'invalid value for "client_secret", the character length must be great than or equal to 1.'
235
+ end
236
+
237
+ @client_secret = client_secret
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] refresh_token Value to be assigned
242
+ def refresh_token=(refresh_token)
243
+ if refresh_token.nil?
244
+ fail ArgumentError, 'refresh_token cannot be nil'
245
+ end
246
+
247
+ if refresh_token.to_s.length < 1
248
+ fail ArgumentError, 'invalid value for "refresh_token", the character length must be great than or equal to 1.'
249
+ end
250
+
251
+ @refresh_token = refresh_token
252
+ end
253
+
254
+ # Checks equality by comparing each attribute.
255
+ # @param [Object] Object to be compared
256
+ def ==(o)
257
+ return true if self.equal?(o)
258
+ self.class == o.class &&
259
+ address == o.address &&
260
+ fast_processing == o.fast_processing &&
261
+ login == o.login &&
262
+ client_id == o.client_id &&
263
+ client_secret == o.client_secret &&
264
+ refresh_token == o.refresh_token &&
265
+ request_url == o.request_url
266
+ end
267
+
268
+ # @see the `==` method
269
+ # @param [Object] Object to be compared
270
+ def eql?(o)
271
+ self == o
272
+ end
273
+
274
+ # Calculates hash code according to all attributes.
275
+ # @return [Fixnum] Hash code
276
+ def hash
277
+ [address, fast_processing, login, client_id, client_secret, refresh_token, request_url].hash
278
+ end
279
+
280
+ # Builds the object from hash
281
+ # @param [Hash] attributes Model attributes in the form of hash
282
+ # @return [Object] Returns the model itself
283
+ def build_from_hash(attributes)
284
+ return nil unless attributes.is_a?(Hash)
285
+ self.class.swagger_types.each_pair do |key, type|
286
+ attribute_key = self.class.attribute_map[key]
287
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
288
+ if type =~ /\AArray<(.*)>/i
289
+ # check to ensure the input is an array given that the the attribute
290
+ # is documented as an array but the input is not
291
+ if attributes[attribute_key].is_a?(Array)
292
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
293
+ end
294
+ elsif !attributes[attribute_key].nil?
295
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
296
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
297
+ end
298
+
299
+ self
300
+ end
301
+
302
+ # Deserializes the data based on type
303
+ # @param string type Data type
304
+ # @param string value Value to be deserialized
305
+ # @return [Object] Deserialized data
306
+ def _deserialize(type, value)
307
+ case type.to_sym
308
+ when :DateTime
309
+ DateTime.parse(value)
310
+ when :Date
311
+ Date.parse(value)
312
+ when :String
313
+ value.to_s
314
+ when :Integer
315
+ value.to_i
316
+ when :Float
317
+ value.to_f
318
+ when :BOOLEAN
319
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
320
+ true
321
+ else
322
+ false
323
+ end
324
+ when :Object
325
+ # generic object (usually a Hash), return directly
326
+ value
327
+ when /\AArray<(?<inner_type>.+)>\z/
328
+ inner_type = Regexp.last_match[:inner_type]
329
+ value.map { |v| _deserialize(inner_type, v) }
330
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
331
+ k_type = Regexp.last_match[:k_type]
332
+ v_type = Regexp.last_match[:v_type]
333
+ {}.tap do |hash|
334
+ value.each do |k, v|
335
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
336
+ end
337
+ end
338
+ else # model
339
+ type = value[:type] || type
340
+ temp_model = AsposeEmailCloud.const_get(type).new
341
+ temp_model.build_from_hash(value)
342
+ end
343
+ end
344
+
345
+ # Returns the string representation of the object
346
+ # @return [String] String presentation of the object
347
+ def to_s
348
+ to_hash.to_s
349
+ end
350
+
351
+ # to_body is an alias to to_hash (backward compatibility)
352
+ # @return [Hash] Returns the object in the form of hash
353
+ def to_body
354
+ to_hash
355
+ end
356
+
357
+ # Returns the object in the form of hash
358
+ # @return [Hash] Returns the object in the form of hash
359
+ def to_hash
360
+ hash = {}
361
+ self.class.attribute_map.each_pair do |attr, param|
362
+ value = self.send(attr)
363
+ next if value.nil?
364
+ hash[param] = _to_hash(value)
365
+ end
366
+ hash
367
+ end
368
+
369
+ # Outputs non-array value in the form of hash
370
+ # For object, use to_hash. Otherwise, just return the value
371
+ # @param [Object] value Any valid value
372
+ # @return [Hash] Returns the value in the form of hash
373
+ def _to_hash(value)
374
+ if value.is_a?(Array)
375
+ value.compact.map { |v| _to_hash(v) }
376
+ elsif value.is_a?(Hash)
377
+ {}.tap do |hash|
378
+ value.each { |k, v| hash[k] = _to_hash(v) }
379
+ end
380
+ elsif value.respond_to? :to_hash
381
+ value.to_hash
382
+ else
383
+ value
384
+ end
385
+ end
386
+
387
+ end
388
+ end