docusign_webforms 1.0.2.rc12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +34 -0
  3. data/Gemfile +7 -0
  4. data/README.md +131 -0
  5. data/Rakefile +8 -0
  6. data/docusign_webforms.gemspec +48 -0
  7. data/lib/docusign_webforms/api/form_instance_management_api.rb +272 -0
  8. data/lib/docusign_webforms/api/form_management_api.rb +192 -0
  9. data/lib/docusign_webforms/client/api_client.rb +600 -0
  10. data/lib/docusign_webforms/client/api_error.rb +37 -0
  11. data/lib/docusign_webforms/client/auth/oauth.rb +1061 -0
  12. data/lib/docusign_webforms/configuration.rb +203 -0
  13. data/lib/docusign_webforms/models/account_id.rb +175 -0
  14. data/lib/docusign_webforms/models/assertion_id.rb +175 -0
  15. data/lib/docusign_webforms/models/authentication_instant.rb +175 -0
  16. data/lib/docusign_webforms/models/authentication_method.rb +175 -0
  17. data/lib/docusign_webforms/models/brand_id.rb +175 -0
  18. data/lib/docusign_webforms/models/client_user_id.rb +175 -0
  19. data/lib/docusign_webforms/models/component_key.rb +174 -0
  20. data/lib/docusign_webforms/models/count.rb +175 -0
  21. data/lib/docusign_webforms/models/create_instance_request_body.rb +264 -0
  22. data/lib/docusign_webforms/models/created_date_time.rb +175 -0
  23. data/lib/docusign_webforms/models/date_time.rb +174 -0
  24. data/lib/docusign_webforms/models/envelope_id.rb +175 -0
  25. data/lib/docusign_webforms/models/expiration_date_time.rb +175 -0
  26. data/lib/docusign_webforms/models/expiration_offset.rb +175 -0
  27. data/lib/docusign_webforms/models/form_sort_by.rb +175 -0
  28. data/lib/docusign_webforms/models/form_url.rb +175 -0
  29. data/lib/docusign_webforms/models/guid.rb +174 -0
  30. data/lib/docusign_webforms/models/http_error.rb +195 -0
  31. data/lib/docusign_webforms/models/http_success.rb +184 -0
  32. data/lib/docusign_webforms/models/instance_id.rb +175 -0
  33. data/lib/docusign_webforms/models/instance_source.rb +31 -0
  34. data/lib/docusign_webforms/models/instance_status.rb +31 -0
  35. data/lib/docusign_webforms/models/instance_token.rb +175 -0
  36. data/lib/docusign_webforms/models/is_private_access.rb +175 -0
  37. data/lib/docusign_webforms/models/is_published.rb +175 -0
  38. data/lib/docusign_webforms/models/is_standalone.rb +175 -0
  39. data/lib/docusign_webforms/models/last_modified_date_time.rb +175 -0
  40. data/lib/docusign_webforms/models/return_url.rb +175 -0
  41. data/lib/docusign_webforms/models/search_text.rb +175 -0
  42. data/lib/docusign_webforms/models/security_domain.rb +175 -0
  43. data/lib/docusign_webforms/models/source.rb +31 -0
  44. data/lib/docusign_webforms/models/start_position.rb +175 -0
  45. data/lib/docusign_webforms/models/tags.rb +175 -0
  46. data/lib/docusign_webforms/models/template_properties.rb +217 -0
  47. data/lib/docusign_webforms/models/token_expiration_date_time.rb +175 -0
  48. data/lib/docusign_webforms/models/update_instance_request_body.rb +184 -0
  49. data/lib/docusign_webforms/models/user_filter.rb +30 -0
  50. data/lib/docusign_webforms/models/user_id.rb +175 -0
  51. data/lib/docusign_webforms/models/web_form.rb +268 -0
  52. data/lib/docusign_webforms/models/web_form_adm_type.rb +39 -0
  53. data/lib/docusign_webforms/models/web_form_component.rb +248 -0
  54. data/lib/docusign_webforms/models/web_form_component_type.rb +34 -0
  55. data/lib/docusign_webforms/models/web_form_components_map.rb +175 -0
  56. data/lib/docusign_webforms/models/web_form_content.rb +217 -0
  57. data/lib/docusign_webforms/models/web_form_id.rb +175 -0
  58. data/lib/docusign_webforms/models/web_form_instance.rb +295 -0
  59. data/lib/docusign_webforms/models/web_form_instance_envelopes.rb +183 -0
  60. data/lib/docusign_webforms/models/web_form_instance_list.rb +187 -0
  61. data/lib/docusign_webforms/models/web_form_instance_metadata.rb +237 -0
  62. data/lib/docusign_webforms/models/web_form_metadata.rb +377 -0
  63. data/lib/docusign_webforms/models/web_form_name.rb +175 -0
  64. data/lib/docusign_webforms/models/web_form_properties.rb +193 -0
  65. data/lib/docusign_webforms/models/web_form_published_names.rb +175 -0
  66. data/lib/docusign_webforms/models/web_form_source.rb +29 -0
  67. data/lib/docusign_webforms/models/web_form_state.rb +29 -0
  68. data/lib/docusign_webforms/models/web_form_summary.rb +250 -0
  69. data/lib/docusign_webforms/models/web_form_summary_list.rb +247 -0
  70. data/lib/docusign_webforms/models/web_form_user_info.rb +209 -0
  71. data/lib/docusign_webforms/models/web_form_values.rb +175 -0
  72. data/lib/docusign_webforms/models/web_form_version_id.rb +175 -0
  73. data/lib/docusign_webforms/version.rb +14 -0
  74. data/lib/docusign_webforms.rb +64 -0
  75. data/runLinter.sh +1 -0
  76. data/tests/Gemfile +5 -0
  77. data/tests/spec/unit_tests_using_jwt_spec.rb +38 -0
  78. metadata +382 -0
@@ -0,0 +1,31 @@
1
+ =begin
2
+ #Web Forms API version 1.1
3
+
4
+ #The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
5
+
6
+ OpenAPI spec version: 1.1.0
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_WebForms
15
+ class Source
16
+
17
+ PUBLIC_URL = 'PUBLIC_URL'.freeze
18
+ API_EMBEDDED = 'API_EMBEDDED'.freeze
19
+ API_REMOTE = 'API_REMOTE'.freeze
20
+ UI_REMOTE = 'UI_REMOTE'.freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def build_from_hash(value)
26
+ constantValues = Source.constants.select { |c| Source::const_get(c) == value }
27
+ raise "Invalid ENUM value #{value} for class #Source" if constantValues.empty?
28
+ value
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #Web Forms API version 1.1
3
+
4
+ #The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
5
+
6
+ OpenAPI spec version: 1.1.0
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_WebForms
15
+ # Starting position for desired page of results.
16
+ class StartPosition
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+
70
+ # Builds the object from hash
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @return [Object] Returns the model itself
73
+ def build_from_hash(attributes)
74
+ return nil unless attributes.is_a?(Hash)
75
+ self.class.swagger_types.each_pair do |key, type|
76
+ if type =~ /\AArray<(.*)>/i
77
+ # check to ensure the input is an array given that the attribute
78
+ # is documented as an array but the input is not
79
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
80
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
81
+ end
82
+ elsif !attributes[self.class.attribute_map[key]].nil?
83
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
84
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
85
+ end
86
+
87
+ self
88
+ end
89
+
90
+ # Deserializes the data based on type
91
+ # @param string type Data type
92
+ # @param string value Value to be deserialized
93
+ # @return [Object] Deserialized data
94
+ def _deserialize(type, value)
95
+ case type.to_sym
96
+ when :DateTime
97
+ DateTime.parse(value)
98
+ when :Date
99
+ Date.parse(value)
100
+ when :String
101
+ value.to_s
102
+ when :Integer
103
+ value.to_i
104
+ when :Float
105
+ value.to_f
106
+ when :BOOLEAN
107
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
+ true
109
+ else
110
+ false
111
+ end
112
+ when :Object
113
+ # generic object (usually a Hash), return directly
114
+ value
115
+ when /\AArray<(?<inner_type>.+)>\z/
116
+ inner_type = Regexp.last_match[:inner_type]
117
+ value.map { |v| _deserialize(inner_type, v) }
118
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
119
+ k_type = Regexp.last_match[:k_type]
120
+ v_type = Regexp.last_match[:v_type]
121
+ {}.tap do |hash|
122
+ value.each do |k, v|
123
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
124
+ end
125
+ end
126
+ else # model
127
+ temp_model = DocuSign_WebForms.const_get(type).new
128
+ temp_model.build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ next if value.nil?
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ # Outputs non-array value in the form of hash
157
+ # For object, use to_hash. Otherwise, just return the value
158
+ # @param [Object] value Any valid value
159
+ # @return [Hash] Returns the value in the form of hash
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map { |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+
174
+ end
175
+ end
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #Web Forms API version 1.1
3
+
4
+ #The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
5
+
6
+ OpenAPI spec version: 1.1.0
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_WebForms
15
+ # List of tags provided by the user with each request. This field is optional.
16
+ class Tags
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+
70
+ # Builds the object from hash
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @return [Object] Returns the model itself
73
+ def build_from_hash(attributes)
74
+ return nil unless attributes.is_a?(Hash)
75
+ self.class.swagger_types.each_pair do |key, type|
76
+ if type =~ /\AArray<(.*)>/i
77
+ # check to ensure the input is an array given that the attribute
78
+ # is documented as an array but the input is not
79
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
80
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
81
+ end
82
+ elsif !attributes[self.class.attribute_map[key]].nil?
83
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
84
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
85
+ end
86
+
87
+ self
88
+ end
89
+
90
+ # Deserializes the data based on type
91
+ # @param string type Data type
92
+ # @param string value Value to be deserialized
93
+ # @return [Object] Deserialized data
94
+ def _deserialize(type, value)
95
+ case type.to_sym
96
+ when :DateTime
97
+ DateTime.parse(value)
98
+ when :Date
99
+ Date.parse(value)
100
+ when :String
101
+ value.to_s
102
+ when :Integer
103
+ value.to_i
104
+ when :Float
105
+ value.to_f
106
+ when :BOOLEAN
107
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
+ true
109
+ else
110
+ false
111
+ end
112
+ when :Object
113
+ # generic object (usually a Hash), return directly
114
+ value
115
+ when /\AArray<(?<inner_type>.+)>\z/
116
+ inner_type = Regexp.last_match[:inner_type]
117
+ value.map { |v| _deserialize(inner_type, v) }
118
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
119
+ k_type = Regexp.last_match[:k_type]
120
+ v_type = Regexp.last_match[:v_type]
121
+ {}.tap do |hash|
122
+ value.each do |k, v|
123
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
124
+ end
125
+ end
126
+ else # model
127
+ temp_model = DocuSign_WebForms.const_get(type).new
128
+ temp_model.build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ next if value.nil?
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ # Outputs non-array value in the form of hash
157
+ # For object, use to_hash. Otherwise, just return the value
158
+ # @param [Object] value Any valid value
159
+ # @return [Hash] Returns the value in the form of hash
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map { |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+
174
+ end
175
+ end
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #Web Forms API version 1.1
3
+
4
+ #The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
5
+
6
+ OpenAPI spec version: 1.1.0
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_WebForms
15
+ # Information about a DocuSign template that will be used to seed a web form.
16
+ class TemplateProperties
17
+ # Template identifier for original Template that is used by the DocuSign Template API.
18
+ attr_accessor :original_template_id
19
+
20
+ # Template identifier for cloned Template that is used by the DocuSign Template API.
21
+ attr_accessor :cloned_template_id
22
+
23
+ # Track the time of assignment of Template information to the Form.
24
+ attr_accessor :imported_date_time
25
+
26
+ # Track mapped recipients on Template.
27
+ attr_accessor :recipient_ids
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'original_template_id' => :'originalTemplateId',
33
+ :'cloned_template_id' => :'clonedTemplateId',
34
+ :'imported_date_time' => :'importedDateTime',
35
+ :'recipient_ids' => :'recipientIds'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'original_template_id' => :'String',
43
+ :'cloned_template_id' => :'String',
44
+ :'imported_date_time' => :'DateTime',
45
+ :'recipient_ids' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'originalTemplateId')
58
+ self.original_template_id = attributes[:'originalTemplateId']
59
+ end
60
+
61
+ if attributes.has_key?(:'clonedTemplateId')
62
+ self.cloned_template_id = attributes[:'clonedTemplateId']
63
+ end
64
+
65
+ if attributes.has_key?(:'importedDateTime')
66
+ self.imported_date_time = attributes[:'importedDateTime']
67
+ end
68
+
69
+ if attributes.has_key?(:'recipientIds')
70
+ if (value = attributes[:'recipientIds']).is_a?(Array)
71
+ self.recipient_ids = value
72
+ end
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ original_template_id == o.original_template_id &&
95
+ cloned_template_id == o.cloned_template_id &&
96
+ imported_date_time == o.imported_date_time &&
97
+ recipient_ids == o.recipient_ids
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Fixnum] Hash code
108
+ def hash
109
+ [original_template_id, cloned_template_id, imported_date_time, recipient_ids].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :BOOLEAN
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ temp_model = DocuSign_WebForms.const_get(type).new
170
+ temp_model.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ next if value.nil?
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+ end