aspose_email_cloud 20.5.0 → 20.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +74 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +147 -0
  4. data/lib/aspose-email-cloud/models/ai_bcr_image_storage_file.rb +3 -3
  5. data/lib/aspose-email-cloud/models/ai_bcr_parse_storage_rq.rb +3 -3
  6. data/lib/aspose-email-cloud/models/append_email_base_request.rb +3 -3
  7. data/lib/aspose-email-cloud/models/append_email_model_rq.rb +3 -3
  8. data/lib/aspose-email-cloud/models/calendar_dto.rb +17 -4
  9. data/lib/aspose-email-cloud/models/contact_photo.rb +29 -5
  10. data/lib/aspose-email-cloud/models/daily_recurrence_pattern_dto.rb +296 -0
  11. data/lib/aspose-email-cloud/models/mapi_attachment_dto.rb +226 -0
  12. data/lib/aspose-email-cloud/models/mapi_binary_property_dto.rb +250 -0
  13. data/lib/aspose-email-cloud/models/mapi_boolean_property_dto.rb +255 -0
  14. data/lib/aspose-email-cloud/models/mapi_calendar_attendees_dto.rb +266 -0
  15. data/lib/aspose-email-cloud/models/mapi_calendar_daily_recurrence_pattern_dto.rb +464 -0
  16. data/lib/aspose-email-cloud/models/mapi_calendar_dto.rb +728 -0
  17. data/lib/aspose-email-cloud/models/mapi_calendar_event_recurrence_dto.rb +293 -0
  18. data/lib/aspose-email-cloud/models/mapi_calendar_exception_info_dto.rb +431 -0
  19. data/lib/aspose-email-cloud/models/mapi_calendar_recurrence_pattern_dto.rb +449 -0
  20. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_dto.rb +228 -0
  21. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_info_dto.rb +313 -0
  22. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_rule_dto.rb +362 -0
  23. data/lib/aspose-email-cloud/models/mapi_calendar_weekly_recurrence_pattern_dto.rb +464 -0
  24. data/lib/aspose-email-cloud/models/mapi_calendar_yearly_and_monthly_recurrence_pattern_dto.rb +500 -0
  25. data/lib/aspose-email-cloud/models/mapi_contact_dto.rb +569 -0
  26. data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_dto.rb +283 -0
  27. data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb +327 -0
  28. data/lib/aspose-email-cloud/models/mapi_contact_event_property_set_dto.rb +236 -0
  29. data/lib/aspose-email-cloud/models/mapi_contact_name_property_set_dto.rb +335 -0
  30. data/lib/aspose-email-cloud/models/mapi_contact_other_property_set_dto.rb +319 -0
  31. data/lib/aspose-email-cloud/models/mapi_contact_personal_info_property_set_dto.rb +454 -0
  32. data/lib/aspose-email-cloud/models/mapi_contact_photo_dto.rb +255 -0
  33. data/lib/aspose-email-cloud/models/mapi_contact_physical_address_dto.rb +322 -0
  34. data/lib/aspose-email-cloud/models/mapi_contact_physical_address_property_set_dto.rb +239 -0
  35. data/lib/aspose-email-cloud/models/mapi_contact_professional_property_set_dto.rb +291 -0
  36. data/lib/aspose-email-cloud/models/mapi_contact_telephone_property_set_dto.rb +457 -0
  37. data/lib/aspose-email-cloud/models/mapi_date_time_property_dto.rb +255 -0
  38. data/lib/aspose-email-cloud/models/mapi_electronic_address_dto.rb +265 -0
  39. data/lib/aspose-email-cloud/models/mapi_file_as_property_dto.rb +255 -0
  40. data/lib/aspose-email-cloud/models/mapi_importance_property_dto.rb +255 -0
  41. data/lib/aspose-email-cloud/models/mapi_int_property_dto.rb +255 -0
  42. data/lib/aspose-email-cloud/models/mapi_known_property_descriptor.rb +237 -0
  43. data/lib/aspose-email-cloud/models/mapi_legacy_free_busy_property_dto.rb +255 -0
  44. data/lib/aspose-email-cloud/models/mapi_message_dto.rb +801 -0
  45. data/lib/aspose-email-cloud/models/mapi_message_item_base_dto.rb +452 -0
  46. data/lib/aspose-email-cloud/models/mapi_multi_int_property_dto.rb +252 -0
  47. data/lib/aspose-email-cloud/models/mapi_multi_string_property_dto.rb +252 -0
  48. data/lib/aspose-email-cloud/models/mapi_physical_address_index_property_dto.rb +255 -0
  49. data/lib/aspose-email-cloud/models/mapi_pid_lid_property_descriptor.rb +322 -0
  50. data/lib/aspose-email-cloud/models/mapi_pid_name_property_descriptor.rb +304 -0
  51. data/lib/aspose-email-cloud/models/mapi_pid_property_descriptor.rb +286 -0
  52. data/lib/aspose-email-cloud/models/mapi_pid_tag_property_descriptor.rb +322 -0
  53. data/lib/aspose-email-cloud/models/mapi_property_descriptor.rb +224 -0
  54. data/lib/aspose-email-cloud/models/mapi_property_dto.rb +237 -0
  55. data/lib/aspose-email-cloud/models/mapi_recipient_dto.rb +257 -0
  56. data/lib/aspose-email-cloud/models/mapi_response_type_property_dto.rb +255 -0
  57. data/lib/aspose-email-cloud/models/mapi_string_property_dto.rb +250 -0
  58. data/lib/aspose-email-cloud/models/monthly_recurrence_pattern_dto.rb +350 -0
  59. data/lib/aspose-email-cloud/models/recurrence_pattern_dto.rb +296 -0
  60. data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_mapi_model_request_data.rb +79 -0
  61. data/lib/aspose-email-cloud/models/requests/convert_contact_model_to_mapi_model_request_data.rb +79 -0
  62. data/lib/aspose-email-cloud/models/requests/convert_email_model_to_file_request_data.rb +2 -2
  63. data/lib/aspose-email-cloud/models/requests/convert_email_model_to_mapi_model_request_data.rb +79 -0
  64. data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +2 -2
  65. data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_calendar_model_request_data.rb +79 -0
  66. data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_file_request_data.rb +89 -0
  67. data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_contact_model_request_data.rb +79 -0
  68. data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_file_request_data.rb +89 -0
  69. data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_email_model_request_data.rb +79 -0
  70. data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_file_request_data.rb +89 -0
  71. data/lib/aspose-email-cloud/models/requests/get_calendar_file_as_mapi_model_request_data.rb +80 -0
  72. data/lib/aspose-email-cloud/models/requests/get_contact_file_as_mapi_model_request_data.rb +90 -0
  73. data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +2 -2
  74. data/lib/aspose-email-cloud/models/requests/get_email_file_as_mapi_model_request_data.rb +90 -0
  75. data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +2 -2
  76. data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +2 -2
  77. data/lib/aspose-email-cloud/models/requests/get_mapi_calendar_model_request_data.rb +91 -0
  78. data/lib/aspose-email-cloud/models/requests/get_mapi_contact_model_request_data.rb +101 -0
  79. data/lib/aspose-email-cloud/models/requests/get_mapi_message_model_request_data.rb +101 -0
  80. data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +2 -2
  81. data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +2 -2
  82. data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +4 -4
  83. data/lib/aspose-email-cloud/models/requests/save_mapi_calendar_model_request_data.rb +99 -0
  84. data/lib/aspose-email-cloud/models/requests/save_mapi_contact_model_request_data.rb +99 -0
  85. data/lib/aspose-email-cloud/models/requests/save_mapi_message_model_request_data.rb +99 -0
  86. data/lib/aspose-email-cloud/models/send_email_base_request.rb +3 -3
  87. data/lib/aspose-email-cloud/models/send_email_model_rq.rb +3 -3
  88. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_calendar_dto.rb +225 -0
  89. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_contact_dto.rb +225 -0
  90. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_message_dto.rb +225 -0
  91. data/lib/aspose-email-cloud/models/task_regenerating_pattern_dto.rb +314 -0
  92. data/lib/aspose-email-cloud/models/weekly_recurrence_pattern_dto.rb +311 -0
  93. data/lib/aspose-email-cloud/models/yearly_recurrence_pattern_dto.rb +368 -0
  94. data/lib/aspose-email-cloud/version.rb +1 -1
  95. metadata +76 -2
@@ -0,0 +1,99 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="save_mapi_contact_model_request_data.rb">
4
+ # Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a
8
+ # copy of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom the
12
+ # Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ # DEALINGS IN THE SOFTWARE.
24
+ # </summary>
25
+ # ----------------------------------------------------------------------------
26
+
27
+
28
+ require_relative './email_request'
29
+ require_relative './http_request'
30
+
31
+ module AsposeEmailCloud
32
+ # Request model for save_mapi_contact_model operation.
33
+ class SaveMapiContactModelRequestData < EmailRequest
34
+
35
+ # Contact document format. Enum, available values: VCard, WebDav, Msg
36
+ # @return [String]
37
+ attr_accessor :format
38
+ # Contact document file name.
39
+ # @return [String]
40
+ attr_accessor :name
41
+ # Create/Update contact request.
42
+ # @return [StorageModelRqOfMapiContactDto]
43
+ attr_accessor :rq
44
+
45
+ # Save MAPI Contact to storage.
46
+ # @param [String] format Contact document format. Enum, available values: VCard, WebDav, Msg
47
+ # @param [String] name Contact document file name.
48
+ # @param [StorageModelRqOfMapiContactDto] rq Create/Update contact request.
49
+ def initialize(format, name, rq)
50
+ self.format = format if format
51
+ self.name = name if name
52
+ self.rq = rq if rq
53
+ end
54
+
55
+ def to_http_info(api_client)
56
+ # verify the required parameter 'format' is set
57
+ if api_client.config.client_side_validation && self.format.nil?
58
+ raise ArgumentError, "Missing the required parameter 'format' when calling EmailApi.save_mapi_contact_model"
59
+ end
60
+
61
+ # verify the required parameter 'name' is set
62
+ if api_client.config.client_side_validation && self.name.nil?
63
+ raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.save_mapi_contact_model"
64
+ end
65
+
66
+ # verify the required parameter 'rq' is set
67
+ if api_client.config.client_side_validation && self.rq.nil?
68
+ raise ArgumentError, "Missing the required parameter 'rq' when calling EmailApi.save_mapi_contact_model"
69
+ end
70
+
71
+ # resource path
72
+ local_var_path = '/email/MapiContact/{format}/{name}'.sub('{' + 'format' + '}', self.format.to_s).sub('{' + 'name' + '}', self.name.to_s)
73
+
74
+ # query parameters
75
+ query_params = {}
76
+
77
+ # form parameters
78
+ form_params = {}
79
+
80
+ # http body (model)
81
+ post_body = api_client.object_to_http_body(self.rq)
82
+ auth_names = ['JWT']
83
+
84
+ # header parameters
85
+ header_params = {}
86
+ # HTTP header 'Accept' (if needed)
87
+ header_params['Accept'] = select_header_accept(['application/json'])
88
+ # HTTP header 'Content-Type'
89
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
90
+
91
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
92
+ header_params,
93
+ query_params,
94
+ form_params,
95
+ post_body,
96
+ auth_names)
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,99 @@
1
+
2
+ # ----------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="save_mapi_message_model_request_data.rb">
4
+ # Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a
8
+ # copy of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom the
12
+ # Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ # DEALINGS IN THE SOFTWARE.
24
+ # </summary>
25
+ # ----------------------------------------------------------------------------
26
+
27
+
28
+ require_relative './email_request'
29
+ require_relative './http_request'
30
+
31
+ module AsposeEmailCloud
32
+ # Request model for save_mapi_message_model operation.
33
+ class SaveMapiMessageModelRequestData < EmailRequest
34
+
35
+ # File format. Enum, available values: Eml, Msg, MsgUnicode, Mhtml, Html, Tnef
36
+ # @return [String]
37
+ attr_accessor :format
38
+ # Message file name in storage.
39
+ # @return [String]
40
+ attr_accessor :name
41
+ # Message create/update request.
42
+ # @return [StorageModelRqOfMapiMessageDto]
43
+ attr_accessor :rq
44
+
45
+ # Save MAPI message to storage.
46
+ # @param [String] format File format. Enum, available values: Eml, Msg, MsgUnicode, Mhtml, Html, Tnef
47
+ # @param [String] name Message file name in storage.
48
+ # @param [StorageModelRqOfMapiMessageDto] rq Message create/update request.
49
+ def initialize(format, name, rq)
50
+ self.format = format if format
51
+ self.name = name if name
52
+ self.rq = rq if rq
53
+ end
54
+
55
+ def to_http_info(api_client)
56
+ # verify the required parameter 'format' is set
57
+ if api_client.config.client_side_validation && self.format.nil?
58
+ raise ArgumentError, "Missing the required parameter 'format' when calling EmailApi.save_mapi_message_model"
59
+ end
60
+
61
+ # verify the required parameter 'name' is set
62
+ if api_client.config.client_side_validation && self.name.nil?
63
+ raise ArgumentError, "Missing the required parameter 'name' when calling EmailApi.save_mapi_message_model"
64
+ end
65
+
66
+ # verify the required parameter 'rq' is set
67
+ if api_client.config.client_side_validation && self.rq.nil?
68
+ raise ArgumentError, "Missing the required parameter 'rq' when calling EmailApi.save_mapi_message_model"
69
+ end
70
+
71
+ # resource path
72
+ local_var_path = '/email/MapiMessage/{format}/{name}'.sub('{' + 'format' + '}', self.format.to_s).sub('{' + 'name' + '}', self.name.to_s)
73
+
74
+ # query parameters
75
+ query_params = {}
76
+
77
+ # form parameters
78
+ form_params = {}
79
+
80
+ # http body (model)
81
+ post_body = api_client.object_to_http_body(self.rq)
82
+ auth_names = ['JWT']
83
+
84
+ # header parameters
85
+ header_params = {}
86
+ # HTTP header 'Accept' (if needed)
87
+ header_params['Accept'] = select_header_accept(['application/json'])
88
+ # HTTP header 'Content-Type'
89
+ header_params['Content-Type'] = form_params.any? ? 'multipart/form-data' : select_header_content_type(['application/json'])
90
+
91
+ AsposeEmailCloud::HttpRequest.new(local_var_path,
92
+ header_params,
93
+ query_params,
94
+ form_params,
95
+ post_body,
96
+ auth_names)
97
+ end
98
+ end
99
+ end
@@ -42,7 +42,7 @@ module AsposeEmailCloud
42
42
  attr_accessor :storage_folder
43
43
 
44
44
  # Email document (*.eml) file location in storage
45
- # @return [Object]
45
+ # @return [StorageFileLocation]
46
46
  attr_accessor :email_file
47
47
 
48
48
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -61,7 +61,7 @@ module AsposeEmailCloud
61
61
  :'first_account' => :'String',
62
62
  :'second_account' => :'String',
63
63
  :'storage_folder' => :'StorageFolderLocation',
64
- :'email_file' => :'Object'
64
+ :'email_file' => :'StorageFileLocation'
65
65
  }
66
66
  end
67
67
 
@@ -94,7 +94,7 @@ module AsposeEmailCloud
94
94
  # @param [String] first_account First account storage file name
95
95
  # @param [String] second_account Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
96
96
  # @param [StorageFolderLocation] storage_folder Storage folder location of account files
97
- # @param [Object] email_file Email document (*.eml) file location in storage
97
+ # @param [StorageFileLocation] email_file Email document (*.eml) file location in storage
98
98
  def initialize(first_account=nil, second_account=nil, storage_folder=nil, email_file=nil)
99
99
  self.first_account = first_account if first_account
100
100
  self.second_account = second_account if second_account
@@ -42,7 +42,7 @@ module AsposeEmailCloud
42
42
  attr_accessor :storage_folder
43
43
 
44
44
  # Message to send
45
- # @return [Object]
45
+ # @return [EmailDto]
46
46
  attr_accessor :message
47
47
 
48
48
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -61,7 +61,7 @@ module AsposeEmailCloud
61
61
  :'first_account' => :'String',
62
62
  :'second_account' => :'String',
63
63
  :'storage_folder' => :'StorageFolderLocation',
64
- :'message' => :'Object'
64
+ :'message' => :'EmailDto'
65
65
  }
66
66
  end
67
67
 
@@ -94,7 +94,7 @@ module AsposeEmailCloud
94
94
  # @param [String] first_account First account storage file name
95
95
  # @param [String] second_account Additional email account (for example, FirstAccount could be IMAP, and second one could be SMTP)
96
96
  # @param [StorageFolderLocation] storage_folder Storage folder location of account files
97
- # @param [Object] message Message to send
97
+ # @param [EmailDto] message Message to send
98
98
  def initialize(first_account=nil, second_account=nil, storage_folder=nil, message=nil)
99
99
  self.first_account = first_account if first_account
100
100
  self.second_account = second_account if second_account
@@ -0,0 +1,225 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="StorageModelRqOfMapiCalendarDto.rb">
3
+ # Copyright (c) 2018-2020 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 StorageModelRqOfMapiCalendarDto
31
+
32
+ # @return [MapiCalendarDto]
33
+ attr_accessor :value
34
+
35
+
36
+ # @return [StorageFolderLocation]
37
+ attr_accessor :storage_folder
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'value' => :'value',
43
+ :'storage_folder' => :'storageFolder'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'value' => :'MapiCalendarDto',
51
+ :'storage_folder' => :'StorageFolderLocation'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
+
63
+ if attributes.has_key?(:'value')
64
+ self.value = attributes[:'value']
65
+ end
66
+
67
+ if attributes.has_key?(:'storageFolder')
68
+ self.storage_folder = attributes[:'storageFolder']
69
+ end
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [MapiCalendarDto] value
74
+ # @param [StorageFolderLocation] storage_folder
75
+ def initialize(value=nil, storage_folder=nil)
76
+ self.value = value if value
77
+ self.storage_folder = storage_folder if storage_folder
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ value == o.value &&
99
+ storage_folder == o.storage_folder
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Fixnum] Hash code
110
+ def hash
111
+ [value, storage_folder].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ attribute_key = self.class.attribute_map[key]
121
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_key].is_a?(Array)
126
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[attribute_key].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ sub_type = value[:type] || value[:discriminator] || type
174
+ if AsposeEmailCloud.const_defined?(sub_type)
175
+ type = sub_type
176
+ end
177
+ temp_model = AsposeEmailCloud.const_get(type).new
178
+ temp_model.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_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
+ next if value.nil?
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+ end