docusign_esign 3.0.0 → 3.1.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -2
  3. data/lib/docusign_esign.rb +464 -447
  4. data/{tests → lib/docusign_esign/api}/.DS_Store +0 -0
  5. data/lib/docusign_esign/api/accounts_api.rb +69 -8
  6. data/lib/docusign_esign/api/authentication_api.rb +8 -8
  7. data/lib/docusign_esign/api/bulk_envelopes_api.rb +335 -0
  8. data/lib/docusign_esign/api/connect_api.rb +400 -0
  9. data/lib/docusign_esign/api/envelopes_api.rb +77 -588
  10. data/lib/docusign_esign/api/notary_api.rb +439 -0
  11. data/lib/docusign_esign/api/organizations_api.rb +232 -0
  12. data/lib/docusign_esign/api/tsps_api.rb +256 -0
  13. data/lib/docusign_esign/models/account_settings_information.rb +125 -10
  14. data/lib/docusign_esign/models/account_ui_settings.rb +60 -4
  15. data/lib/docusign_esign/models/admin_message.rb +198 -0
  16. data/lib/docusign_esign/models/agent.rb +21 -1
  17. data/lib/docusign_esign/models/approve.rb +29 -1
  18. data/lib/docusign_esign/models/ask_an_admin.rb +218 -0
  19. data/lib/docusign_esign/models/carbon_copy.rb +39 -1
  20. data/lib/docusign_esign/models/certified_delivery.rb +39 -1
  21. data/lib/docusign_esign/models/checkbox.rb +29 -1
  22. data/lib/docusign_esign/models/comment_thread.rb +29 -1
  23. data/lib/docusign_esign/models/company.rb +29 -1
  24. data/lib/docusign_esign/models/complete_sign_request.rb +22 -2
  25. data/lib/docusign_esign/models/connect_custom_configuration.rb +19 -19
  26. data/lib/docusign_esign/models/credential.rb +12 -2
  27. data/lib/docusign_esign/models/date.rb +29 -1
  28. data/lib/docusign_esign/models/date_signed.rb +29 -1
  29. data/lib/docusign_esign/models/decline.rb +29 -1
  30. data/lib/docusign_esign/models/document.rb +53 -1
  31. data/lib/docusign_esign/models/document_fields_information.rb +1 -1
  32. data/lib/docusign_esign/models/document_html_display_settings.rb +11 -1
  33. data/lib/docusign_esign/models/document_security_store.rb +1 -1
  34. data/lib/docusign_esign/models/document_update_info.rb +1 -1
  35. data/lib/docusign_esign/models/editor.rb +21 -1
  36. data/lib/docusign_esign/models/email.rb +29 -1
  37. data/lib/docusign_esign/models/email_address.rb +29 -1
  38. data/lib/docusign_esign/models/envelope_document.rb +11 -1
  39. data/lib/docusign_esign/models/envelope_id.rb +29 -1
  40. data/lib/docusign_esign/models/envelope_template.rb +1 -11
  41. data/lib/docusign_esign/models/first_name.rb +29 -1
  42. data/lib/docusign_esign/models/formula_tab.rb +29 -1
  43. data/lib/docusign_esign/models/full_name.rb +29 -1
  44. data/lib/docusign_esign/models/in_person_signer.rb +21 -1
  45. data/lib/docusign_esign/models/initial_here.rb +29 -1
  46. data/lib/docusign_esign/models/intermediary.rb +21 -1
  47. data/lib/docusign_esign/models/last_name.rb +29 -1
  48. data/lib/docusign_esign/models/list.rb +29 -1
  49. data/lib/docusign_esign/models/notarize.rb +29 -1
  50. data/lib/docusign_esign/models/notary.rb +217 -0
  51. data/lib/docusign_esign/models/notary_host.rb +21 -1
  52. data/lib/docusign_esign/models/notary_jurisdiction.rb +246 -0
  53. data/lib/docusign_esign/models/notary_jurisdiction_list.rb +250 -0
  54. data/lib/docusign_esign/models/notary_result.rb +199 -0
  55. data/lib/docusign_esign/models/note.rb +29 -1
  56. data/lib/docusign_esign/models/number.rb +29 -1
  57. data/lib/docusign_esign/models/ocr_request.rb +238 -0
  58. data/lib/docusign_esign/models/offline_attributes.rb +238 -0
  59. data/lib/docusign_esign/models/poly_line_overlay.rb +29 -1
  60. data/lib/docusign_esign/models/proof_service_resource_token.rb +188 -0
  61. data/lib/docusign_esign/models/proof_service_view_link.rb +188 -0
  62. data/lib/docusign_esign/models/radio.rb +20 -1
  63. data/lib/docusign_esign/models/recipient_email_notification.rb +1 -1
  64. data/lib/docusign_esign/models/recipient_proof_file.rb +188 -0
  65. data/lib/docusign_esign/models/revision.rb +11 -2
  66. data/lib/docusign_esign/models/seal_sign.rb +21 -1
  67. data/lib/docusign_esign/models/sender.rb +1 -1
  68. data/lib/docusign_esign/models/sign_hash_document.rb +12 -3
  69. data/lib/docusign_esign/models/sign_hash_session_info_response.rb +12 -3
  70. data/lib/docusign_esign/models/sign_here.rb +38 -1
  71. data/lib/docusign_esign/models/sign_session_info_request.rb +12 -2
  72. data/lib/docusign_esign/models/signature_data_info.rb +1 -1
  73. data/lib/docusign_esign/models/signer.rb +31 -2
  74. data/lib/docusign_esign/models/signer_attachment.rb +29 -1
  75. data/lib/docusign_esign/models/smart_contract_information.rb +198 -0
  76. data/lib/docusign_esign/models/smart_section.rb +29 -1
  77. data/lib/docusign_esign/models/smart_section_display_settings.rb +11 -1
  78. data/lib/docusign_esign/models/ssn.rb +29 -1
  79. data/lib/docusign_esign/models/stamp.rb +336 -0
  80. data/lib/docusign_esign/models/tab_group.rb +29 -1
  81. data/lib/docusign_esign/models/text.rb +29 -1
  82. data/lib/docusign_esign/models/time_stamp_field.rb +1 -1
  83. data/lib/docusign_esign/models/title.rb +29 -1
  84. data/lib/docusign_esign/models/tsp_health_check_request.rb +1 -1
  85. data/lib/docusign_esign/models/tsp_health_check_status_description.rb +1 -1
  86. data/lib/docusign_esign/models/update_transaction_request.rb +1 -1
  87. data/lib/docusign_esign/models/update_transaction_response.rb +1 -1
  88. data/lib/docusign_esign/models/usage_history.rb +1 -1
  89. data/lib/docusign_esign/models/user.rb +27 -5
  90. data/lib/docusign_esign/models/user_info_response.rb +1 -1
  91. data/lib/docusign_esign/models/user_information.rb +1 -1
  92. data/lib/docusign_esign/models/user_signature.rb +14 -4
  93. data/lib/docusign_esign/models/view.rb +29 -1
  94. data/lib/docusign_esign/models/witness.rb +30 -1
  95. data/lib/docusign_esign/models/zip.rb +29 -1
  96. data/lib/docusign_esign/version.rb +1 -1
  97. data/tests/Gemfile.lock +1 -1
  98. metadata +20 -7
  99. data/Gemfile.lock +0 -73
  100. data/docusign_esign-2.1.0.gem +0 -0
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+ # Reserved for DocuSign use.
16
+ class OfflineAttributes
17
+ # A GUID identifying the account associated with the consumer disclosure
18
+ attr_accessor :account_esign_id
19
+
20
+ # A string containing information about the model of the device used for offline signing.
21
+ attr_accessor :device_model
22
+
23
+ # A string containing information about the type of device used for offline signing.
24
+ attr_accessor :device_name
25
+
26
+ # A string containing the latitude of the device location at the time of signing.
27
+ attr_accessor :gps_latitude
28
+
29
+ # A string containing the longitude of the device location at the time of signing.
30
+ attr_accessor :gps_longitude
31
+
32
+ #
33
+ attr_accessor :offline_signing_hash
34
+
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'account_esign_id' => :'accountEsignId',
40
+ :'device_model' => :'deviceModel',
41
+ :'device_name' => :'deviceName',
42
+ :'gps_latitude' => :'gpsLatitude',
43
+ :'gps_longitude' => :'gpsLongitude',
44
+ :'offline_signing_hash' => :'offlineSigningHash'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'account_esign_id' => :'String',
52
+ :'device_model' => :'String',
53
+ :'device_name' => :'String',
54
+ :'gps_latitude' => :'String',
55
+ :'gps_longitude' => :'String',
56
+ :'offline_signing_hash' => :'String'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
67
+
68
+ if attributes.has_key?(:'accountEsignId')
69
+ self.account_esign_id = attributes[:'accountEsignId']
70
+ end
71
+
72
+ if attributes.has_key?(:'deviceModel')
73
+ self.device_model = attributes[:'deviceModel']
74
+ end
75
+
76
+ if attributes.has_key?(:'deviceName')
77
+ self.device_name = attributes[:'deviceName']
78
+ end
79
+
80
+ if attributes.has_key?(:'gpsLatitude')
81
+ self.gps_latitude = attributes[:'gpsLatitude']
82
+ end
83
+
84
+ if attributes.has_key?(:'gpsLongitude')
85
+ self.gps_longitude = attributes[:'gpsLongitude']
86
+ end
87
+
88
+ if attributes.has_key?(:'offlineSigningHash')
89
+ self.offline_signing_hash = attributes[:'offlineSigningHash']
90
+ end
91
+
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properies with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ return invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ account_esign_id == o.account_esign_id &&
113
+ device_model == o.device_model &&
114
+ device_name == o.device_name &&
115
+ gps_latitude == o.gps_latitude &&
116
+ gps_longitude == o.gps_longitude &&
117
+ offline_signing_hash == o.offline_signing_hash
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [account_esign_id, device_model, device_name, gps_latitude, gps_longitude, offline_signing_hash].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = DocuSign_eSign.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map{ |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -14,6 +14,11 @@ require 'date'
14
14
  module DocuSign_eSign
15
15
 
16
16
  class PolyLineOverlay
17
+ #
18
+ attr_accessor :anchor_allow_white_space_in_characters
19
+
20
+ attr_accessor :anchor_allow_white_space_in_characters_metadata
21
+
17
22
  # When set to **true**, the anchor string does not consider case when matching strings in the document. The default value is **true**.
18
23
  attr_accessor :anchor_case_sensitive
19
24
 
@@ -141,6 +146,8 @@ module DocuSign_eSign
141
146
 
142
147
  attr_accessor :shared_metadata
143
148
 
149
+ attr_accessor :smart_contract_information
150
+
144
151
  # Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.
145
152
  attr_accessor :status
146
153
 
@@ -203,6 +210,8 @@ module DocuSign_eSign
203
210
  # Attribute mapping from ruby-style variable name to JSON key.
204
211
  def self.attribute_map
205
212
  {
213
+ :'anchor_allow_white_space_in_characters' => :'anchorAllowWhiteSpaceInCharacters',
214
+ :'anchor_allow_white_space_in_characters_metadata' => :'anchorAllowWhiteSpaceInCharactersMetadata',
206
215
  :'anchor_case_sensitive' => :'anchorCaseSensitive',
207
216
  :'anchor_case_sensitive_metadata' => :'anchorCaseSensitiveMetadata',
208
217
  :'anchor_horizontal_alignment' => :'anchorHorizontalAlignment',
@@ -254,6 +263,7 @@ module DocuSign_eSign
254
263
  :'recipient_id_metadata' => :'recipientIdMetadata',
255
264
  :'shared' => :'shared',
256
265
  :'shared_metadata' => :'sharedMetadata',
266
+ :'smart_contract_information' => :'smartContractInformation',
257
267
  :'status' => :'status',
258
268
  :'status_metadata' => :'statusMetadata',
259
269
  :'tab_group_labels' => :'tabGroupLabels',
@@ -283,6 +293,8 @@ module DocuSign_eSign
283
293
  # Attribute type mapping.
284
294
  def self.swagger_types
285
295
  {
296
+ :'anchor_allow_white_space_in_characters' => :'String',
297
+ :'anchor_allow_white_space_in_characters_metadata' => :'PropertyMetadata',
286
298
  :'anchor_case_sensitive' => :'String',
287
299
  :'anchor_case_sensitive_metadata' => :'PropertyMetadata',
288
300
  :'anchor_horizontal_alignment' => :'String',
@@ -334,6 +346,7 @@ module DocuSign_eSign
334
346
  :'recipient_id_metadata' => :'PropertyMetadata',
335
347
  :'shared' => :'String',
336
348
  :'shared_metadata' => :'PropertyMetadata',
349
+ :'smart_contract_information' => :'SmartContractInformation',
337
350
  :'status' => :'String',
338
351
  :'status_metadata' => :'PropertyMetadata',
339
352
  :'tab_group_labels' => :'Array<String>',
@@ -368,6 +381,14 @@ module DocuSign_eSign
368
381
  # convert string to symbol for hash key
369
382
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
370
383
 
384
+ if attributes.has_key?(:'anchorAllowWhiteSpaceInCharacters')
385
+ self.anchor_allow_white_space_in_characters = attributes[:'anchorAllowWhiteSpaceInCharacters']
386
+ end
387
+
388
+ if attributes.has_key?(:'anchorAllowWhiteSpaceInCharactersMetadata')
389
+ self.anchor_allow_white_space_in_characters_metadata = attributes[:'anchorAllowWhiteSpaceInCharactersMetadata']
390
+ end
391
+
371
392
  if attributes.has_key?(:'anchorCaseSensitive')
372
393
  self.anchor_case_sensitive = attributes[:'anchorCaseSensitive']
373
394
  end
@@ -574,6 +595,10 @@ module DocuSign_eSign
574
595
  self.shared_metadata = attributes[:'sharedMetadata']
575
596
  end
576
597
 
598
+ if attributes.has_key?(:'smartContractInformation')
599
+ self.smart_contract_information = attributes[:'smartContractInformation']
600
+ end
601
+
577
602
  if attributes.has_key?(:'status')
578
603
  self.status = attributes[:'status']
579
604
  end
@@ -688,6 +713,8 @@ module DocuSign_eSign
688
713
  def ==(o)
689
714
  return true if self.equal?(o)
690
715
  self.class == o.class &&
716
+ anchor_allow_white_space_in_characters == o.anchor_allow_white_space_in_characters &&
717
+ anchor_allow_white_space_in_characters_metadata == o.anchor_allow_white_space_in_characters_metadata &&
691
718
  anchor_case_sensitive == o.anchor_case_sensitive &&
692
719
  anchor_case_sensitive_metadata == o.anchor_case_sensitive_metadata &&
693
720
  anchor_horizontal_alignment == o.anchor_horizontal_alignment &&
@@ -739,6 +766,7 @@ module DocuSign_eSign
739
766
  recipient_id_metadata == o.recipient_id_metadata &&
740
767
  shared == o.shared &&
741
768
  shared_metadata == o.shared_metadata &&
769
+ smart_contract_information == o.smart_contract_information &&
742
770
  status == o.status &&
743
771
  status_metadata == o.status_metadata &&
744
772
  tab_group_labels == o.tab_group_labels &&
@@ -773,7 +801,7 @@ module DocuSign_eSign
773
801
  # Calculates hash code according to all attributes.
774
802
  # @return [Fixnum] Hash code
775
803
  def hash
776
- [anchor_case_sensitive, anchor_case_sensitive_metadata, anchor_horizontal_alignment, anchor_horizontal_alignment_metadata, anchor_ignore_if_not_present, anchor_ignore_if_not_present_metadata, anchor_match_whole_word, anchor_match_whole_word_metadata, anchor_string, anchor_string_metadata, anchor_tab_processor_version, anchor_tab_processor_version_metadata, anchor_units, anchor_units_metadata, anchor_x_offset, anchor_x_offset_metadata, anchor_y_offset, anchor_y_offset_metadata, conditional_parent_label, conditional_parent_label_metadata, conditional_parent_value, conditional_parent_value_metadata, custom_tab_id, custom_tab_id_metadata, document_id, document_id_metadata, error_details, form_order, form_order_metadata, form_page_label, form_page_label_metadata, form_page_number, form_page_number_metadata, graphics_context, height, height_metadata, locked, locked_metadata, merge_field, merge_field_xml, overlay_type, overlay_type_metadata, page_number, page_number_metadata, poly_lines, recipient_id, recipient_id_guid, recipient_id_guid_metadata, recipient_id_metadata, shared, shared_metadata, status, status_metadata, tab_group_labels, tab_group_labels_metadata, tab_id, tab_id_metadata, tab_label, tab_order, tab_order_metadata, tab_type, tab_type_metadata, template_locked, template_locked_metadata, template_required, template_required_metadata, tooltip, tool_tip_metadata, width, width_metadata, x_position, x_position_metadata, y_position, y_position_metadata].hash
804
+ [anchor_allow_white_space_in_characters, anchor_allow_white_space_in_characters_metadata, anchor_case_sensitive, anchor_case_sensitive_metadata, anchor_horizontal_alignment, anchor_horizontal_alignment_metadata, anchor_ignore_if_not_present, anchor_ignore_if_not_present_metadata, anchor_match_whole_word, anchor_match_whole_word_metadata, anchor_string, anchor_string_metadata, anchor_tab_processor_version, anchor_tab_processor_version_metadata, anchor_units, anchor_units_metadata, anchor_x_offset, anchor_x_offset_metadata, anchor_y_offset, anchor_y_offset_metadata, conditional_parent_label, conditional_parent_label_metadata, conditional_parent_value, conditional_parent_value_metadata, custom_tab_id, custom_tab_id_metadata, document_id, document_id_metadata, error_details, form_order, form_order_metadata, form_page_label, form_page_label_metadata, form_page_number, form_page_number_metadata, graphics_context, height, height_metadata, locked, locked_metadata, merge_field, merge_field_xml, overlay_type, overlay_type_metadata, page_number, page_number_metadata, poly_lines, recipient_id, recipient_id_guid, recipient_id_guid_metadata, recipient_id_metadata, shared, shared_metadata, smart_contract_information, status, status_metadata, tab_group_labels, tab_group_labels_metadata, tab_id, tab_id_metadata, tab_label, tab_order, tab_order_metadata, tab_type, tab_type_metadata, template_locked, template_locked_metadata, template_required, template_required_metadata, tooltip, tool_tip_metadata, width, width_metadata, x_position, x_position_metadata, y_position, y_position_metadata].hash
777
805
  end
778
806
 
779
807
  # Builds the object from hash
@@ -0,0 +1,188 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+
16
+ class ProofServiceResourceToken
17
+ #
18
+ attr_accessor :resource_token
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'resource_token' => :'ResourceToken'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'resource_token' => :'String'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'ResourceToken')
44
+ self.resource_token = attributes[:'ResourceToken']
45
+ end
46
+
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properies with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ return invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ return true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ resource_token == o.resource_token
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [resource_token].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /\AArray<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ # Deserializes the data based on type
103
+ # @param string type Data type
104
+ # @param string value Value to be deserialized
105
+ # @return [Object] Deserialized data
106
+ def _deserialize(type, value)
107
+ case type.to_sym
108
+ when :DateTime
109
+ DateTime.parse(value)
110
+ when :Date
111
+ Date.parse(value)
112
+ when :String
113
+ value.to_s
114
+ when :Integer
115
+ value.to_i
116
+ when :Float
117
+ value.to_f
118
+ when :BOOLEAN
119
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
120
+ true
121
+ else
122
+ false
123
+ end
124
+ when :Object
125
+ # generic object (usually a Hash), return directly
126
+ value
127
+ when /\AArray<(?<inner_type>.+)>\z/
128
+ inner_type = Regexp.last_match[:inner_type]
129
+ value.map { |v| _deserialize(inner_type, v) }
130
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
131
+ k_type = Regexp.last_match[:k_type]
132
+ v_type = Regexp.last_match[:v_type]
133
+ {}.tap do |hash|
134
+ value.each do |k, v|
135
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
136
+ end
137
+ end
138
+ else # model
139
+ temp_model = DocuSign_eSign.const_get(type).new
140
+ temp_model.build_from_hash(value)
141
+ end
142
+ end
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_hash (backward compatibility)
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_body
153
+ to_hash
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ next if value.nil?
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+
188
+ end