docusign_esign 3.25.0 → 3.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,28 +13,48 @@ require 'date'
13
13
 
14
14
  module DocuSign_eSign
15
15
  class DocGenFormField
16
+ #
17
+ attr_accessor :description
18
+
16
19
  #
17
20
  attr_accessor :label
18
21
 
19
22
  #
20
23
  attr_accessor :name
21
24
 
25
+ #
26
+ attr_accessor :options
27
+
28
+ #
29
+ attr_accessor :predefined_validation
30
+
22
31
  # When set to **true**, the signer is required to fill out this tab
23
32
  attr_accessor :required
24
33
 
34
+ #
35
+ attr_accessor :row_values
36
+
25
37
  #
26
38
  attr_accessor :type
27
39
 
40
+ #
41
+ attr_accessor :validation
42
+
28
43
  # Specifies the value of the tab.
29
44
  attr_accessor :value
30
45
 
31
46
  # Attribute mapping from ruby-style variable name to JSON key.
32
47
  def self.attribute_map
33
48
  {
49
+ :'description' => :'description',
34
50
  :'label' => :'label',
35
51
  :'name' => :'name',
52
+ :'options' => :'options',
53
+ :'predefined_validation' => :'predefinedValidation',
36
54
  :'required' => :'required',
55
+ :'row_values' => :'rowValues',
37
56
  :'type' => :'type',
57
+ :'validation' => :'validation',
38
58
  :'value' => :'value'
39
59
  }
40
60
  end
@@ -42,10 +62,15 @@ module DocuSign_eSign
42
62
  # Attribute type mapping.
43
63
  def self.swagger_types
44
64
  {
65
+ :'description' => :'String',
45
66
  :'label' => :'String',
46
67
  :'name' => :'String',
68
+ :'options' => :'Array<DocGenFormFieldOption>',
69
+ :'predefined_validation' => :'String',
47
70
  :'required' => :'String',
71
+ :'row_values' => :'Array<DocGenFormFieldRowValue>',
48
72
  :'type' => :'String',
73
+ :'validation' => :'DocGenFormFieldValidation',
49
74
  :'value' => :'String'
50
75
  }
51
76
  end
@@ -58,6 +83,10 @@ module DocuSign_eSign
58
83
  # convert string to symbol for hash key
59
84
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
85
 
86
+ if attributes.has_key?(:'description')
87
+ self.description = attributes[:'description']
88
+ end
89
+
61
90
  if attributes.has_key?(:'label')
62
91
  self.label = attributes[:'label']
63
92
  end
@@ -66,14 +95,34 @@ module DocuSign_eSign
66
95
  self.name = attributes[:'name']
67
96
  end
68
97
 
98
+ if attributes.has_key?(:'options')
99
+ if (value = attributes[:'options']).is_a?(Array)
100
+ self.options = value
101
+ end
102
+ end
103
+
104
+ if attributes.has_key?(:'predefinedValidation')
105
+ self.predefined_validation = attributes[:'predefinedValidation']
106
+ end
107
+
69
108
  if attributes.has_key?(:'required')
70
109
  self.required = attributes[:'required']
71
110
  end
72
111
 
112
+ if attributes.has_key?(:'rowValues')
113
+ if (value = attributes[:'rowValues']).is_a?(Array)
114
+ self.row_values = value
115
+ end
116
+ end
117
+
73
118
  if attributes.has_key?(:'type')
74
119
  self.type = attributes[:'type']
75
120
  end
76
121
 
122
+ if attributes.has_key?(:'validation')
123
+ self.validation = attributes[:'validation']
124
+ end
125
+
77
126
  if attributes.has_key?(:'value')
78
127
  self.value = attributes[:'value']
79
128
  end
@@ -97,10 +146,15 @@ module DocuSign_eSign
97
146
  def ==(o)
98
147
  return true if self.equal?(o)
99
148
  self.class == o.class &&
149
+ description == o.description &&
100
150
  label == o.label &&
101
151
  name == o.name &&
152
+ options == o.options &&
153
+ predefined_validation == o.predefined_validation &&
102
154
  required == o.required &&
155
+ row_values == o.row_values &&
103
156
  type == o.type &&
157
+ validation == o.validation &&
104
158
  value == o.value
105
159
  end
106
160
 
@@ -113,7 +167,7 @@ module DocuSign_eSign
113
167
  # Calculates hash code according to all attributes.
114
168
  # @return [Fixnum] Hash code
115
169
  def hash
116
- [label, name, required, type, value].hash
170
+ [description, label, name, options, predefined_validation, required, row_values, type, validation, value].hash
117
171
  end
118
172
 
119
173
  # Builds the object from hash
@@ -0,0 +1,214 @@
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
+ class DocGenFormFieldOption
16
+ #
17
+ attr_accessor :description
18
+
19
+ #
20
+ attr_accessor :label
21
+
22
+ #
23
+ attr_accessor :selected
24
+
25
+ # Specifies the value of the tab.
26
+ attr_accessor :value
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'description' => :'description',
32
+ :'label' => :'label',
33
+ :'selected' => :'selected',
34
+ :'value' => :'value'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'description' => :'String',
42
+ :'label' => :'String',
43
+ :'selected' => :'String',
44
+ :'value' => :'String'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'description')
57
+ self.description = attributes[:'description']
58
+ end
59
+
60
+ if attributes.has_key?(:'label')
61
+ self.label = attributes[:'label']
62
+ end
63
+
64
+ if attributes.has_key?(:'selected')
65
+ self.selected = attributes[:'selected']
66
+ end
67
+
68
+ if attributes.has_key?(:'value')
69
+ self.value = attributes[:'value']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ description == o.description &&
92
+ label == o.label &&
93
+ selected == o.selected &&
94
+ value == o.value
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [description, label, selected, value].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = DocuSign_eSign.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+ end
@@ -0,0 +1,186 @@
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
+ class DocGenFormFieldRowValue
16
+ #
17
+ attr_accessor :doc_gen_form_field_list
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'doc_gen_form_field_list' => :'docGenFormFieldList'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'doc_gen_form_field_list' => :'Array<DocGenFormField>'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'docGenFormFieldList')
42
+ if (value = attributes[:'docGenFormFieldList']).is_a?(Array)
43
+ self.doc_gen_form_field_list = value
44
+ end
45
+ end
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ doc_gen_form_field_list == o.doc_gen_form_field_list
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [doc_gen_form_field_list].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = DocuSign_eSign.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end