docusign_maestro 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +230 -0
  4. data/docusign_maestro.gemspec +48 -0
  5. data/lib/docusign_maestro/api/workflow_instance_management_api.rb +248 -0
  6. data/lib/docusign_maestro/api/workflow_management_api.rb +440 -0
  7. data/lib/docusign_maestro/api/workflow_trigger_api.rb +95 -0
  8. data/lib/docusign_maestro/client/api_client.rb +600 -0
  9. data/lib/docusign_maestro/client/api_error.rb +37 -0
  10. data/lib/docusign_maestro/client/auth/oauth.rb +1061 -0
  11. data/lib/docusign_maestro/configuration.rb +203 -0
  12. data/lib/docusign_maestro/models/access_token_response.rb +204 -0
  13. data/lib/docusign_maestro/models/access_token_token_types.rb +30 -0
  14. data/lib/docusign_maestro/models/account_id.rb +175 -0
  15. data/lib/docusign_maestro/models/aow_uuid.rb +174 -0
  16. data/lib/docusign_maestro/models/aow_uuid_string.rb +174 -0
  17. data/lib/docusign_maestro/models/cancel_response.rb +197 -0
  18. data/lib/docusign_maestro/models/create_or_update_workflow_definition_request_body.rb +184 -0
  19. data/lib/docusign_maestro/models/deploy_request.rb +188 -0
  20. data/lib/docusign_maestro/models/deploy_response.rb +220 -0
  21. data/lib/docusign_maestro/models/deploy_status.rb +30 -0
  22. data/lib/docusign_maestro/models/deployment_status.rb +33 -0
  23. data/lib/docusign_maestro/models/ds_do_until_step.rb +247 -0
  24. data/lib/docusign_maestro/models/ds_doc_gen_step.rb +261 -0
  25. data/lib/docusign_maestro/models/ds_doc_gen_step_input.rb +246 -0
  26. data/lib/docusign_maestro/models/ds_idv_step.rb +261 -0
  27. data/lib/docusign_maestro/models/ds_idv_step_input.rb +234 -0
  28. data/lib/docusign_maestro/models/ds_if_else_step.rb +264 -0
  29. data/lib/docusign_maestro/models/ds_loop_step.rb +247 -0
  30. data/lib/docusign_maestro/models/ds_parallel_step.rb +246 -0
  31. data/lib/docusign_maestro/models/ds_service_step.rb +175 -0
  32. data/lib/docusign_maestro/models/ds_sign_step.rb +261 -0
  33. data/lib/docusign_maestro/models/ds_sign_step_input.rb +241 -0
  34. data/lib/docusign_maestro/models/ds_step_id.rb +175 -0
  35. data/lib/docusign_maestro/models/ds_transformation_step.rb +279 -0
  36. data/lib/docusign_maestro/models/ds_web_forms_step.rb +265 -0
  37. data/lib/docusign_maestro/models/ds_web_forms_step_config.rb +188 -0
  38. data/lib/docusign_maestro/models/ds_workflow_boolean_expression.rb +219 -0
  39. data/lib/docusign_maestro/models/ds_workflow_comparison_expression.rb +232 -0
  40. data/lib/docusign_maestro/models/ds_workflow_comparison_operator_types.rb +39 -0
  41. data/lib/docusign_maestro/models/ds_workflow_concat_expression.rb +200 -0
  42. data/lib/docusign_maestro/models/ds_workflow_doc_gen_doc_output_format.rb +29 -0
  43. data/lib/docusign_maestro/models/ds_workflow_expression_types_boolean_expression.rb +28 -0
  44. data/lib/docusign_maestro/models/ds_workflow_expression_types_comparison_expression.rb +28 -0
  45. data/lib/docusign_maestro/models/ds_workflow_expression_types_parallel_expression.rb +28 -0
  46. data/lib/docusign_maestro/models/ds_workflow_index_of_expression.rb +218 -0
  47. data/lib/docusign_maestro/models/ds_workflow_lane.rb +205 -0
  48. data/lib/docusign_maestro/models/ds_workflow_lanes_record.rb +174 -0
  49. data/lib/docusign_maestro/models/ds_workflow_last_index_of_expression.rb +218 -0
  50. data/lib/docusign_maestro/models/ds_workflow_logical_operator_types.rb +29 -0
  51. data/lib/docusign_maestro/models/ds_workflow_parallel_expression.rb +204 -0
  52. data/lib/docusign_maestro/models/ds_workflow_participant_record.rb +175 -0
  53. data/lib/docusign_maestro/models/ds_workflow_replace_expression.rb +233 -0
  54. data/lib/docusign_maestro/models/ds_workflow_step.rb +175 -0
  55. data/lib/docusign_maestro/models/ds_workflow_step_types_do_until.rb +28 -0
  56. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_doc_gen.rb +28 -0
  57. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_idv.rb +28 -0
  58. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_if_else.rb +28 -0
  59. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_sign.rb +28 -0
  60. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_transformation.rb +28 -0
  61. data/lib/docusign_maestro/models/ds_workflow_step_types_ds_web_forms.rb +28 -0
  62. data/lib/docusign_maestro/models/ds_workflow_step_types_loop.rb +28 -0
  63. data/lib/docusign_maestro/models/ds_workflow_step_types_parallel.rb +28 -0
  64. data/lib/docusign_maestro/models/ds_workflow_substring_expression.rb +228 -0
  65. data/lib/docusign_maestro/models/ds_workflow_to_lower_expression.rb +203 -0
  66. data/lib/docusign_maestro/models/ds_workflow_to_upper_expression.rb +203 -0
  67. data/lib/docusign_maestro/models/ds_workflow_transformation_expression.rb +175 -0
  68. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_concat_expression.rb +28 -0
  69. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_index_of_expression.rb +28 -0
  70. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_last_index_of_expression.rb +28 -0
  71. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_replace_expression.rb +28 -0
  72. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_substring_expression.rb +28 -0
  73. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_to_lower_expression.rb +28 -0
  74. data/lib/docusign_maestro/models/ds_workflow_transformation_expression_types_to_upper_expression.rb +28 -0
  75. data/lib/docusign_maestro/models/ds_workflow_trigger.rb +274 -0
  76. data/lib/docusign_maestro/models/ds_workflow_trigger_types.rb +29 -0
  77. data/lib/docusign_maestro/models/ds_workflow_variable.rb +175 -0
  78. data/lib/docusign_maestro/models/ds_workflow_variable_from_participant.rb +217 -0
  79. data/lib/docusign_maestro/models/ds_workflow_variable_from_step.rb +231 -0
  80. data/lib/docusign_maestro/models/ds_workflow_variable_from_variable.rb +231 -0
  81. data/lib/docusign_maestro/models/ds_workflow_variable_record.rb +175 -0
  82. data/lib/docusign_maestro/models/ds_workflow_variable_source_types_participant.rb +28 -0
  83. data/lib/docusign_maestro/models/ds_workflow_variable_source_types_step.rb +28 -0
  84. data/lib/docusign_maestro/models/ds_workflow_variable_source_types_variable.rb +28 -0
  85. data/lib/docusign_maestro/models/e_sign_document_from_e_sign_template.rb +231 -0
  86. data/lib/docusign_maestro/models/e_sign_document_from_previous_step.rb +232 -0
  87. data/lib/docusign_maestro/models/e_sign_document_types_from_ds_template.rb +28 -0
  88. data/lib/docusign_maestro/models/e_sign_document_types_from_previous_step.rb +28 -0
  89. data/lib/docusign_maestro/models/e_sign_documents.rb +175 -0
  90. data/lib/docusign_maestro/models/e_sign_locale_policy.rb +174 -0
  91. data/lib/docusign_maestro/models/e_sign_signer.rb +247 -0
  92. data/lib/docusign_maestro/models/e_sign_tabs.rb +416 -0
  93. data/lib/docusign_maestro/models/e_sign_tabs_record.rb +251 -0
  94. data/lib/docusign_maestro/models/error_codes.rb +44 -0
  95. data/lib/docusign_maestro/models/error_response.rb +193 -0
  96. data/lib/docusign_maestro/models/event_types.rb +31 -0
  97. data/lib/docusign_maestro/models/get_configuration_instance_response.rb +201 -0
  98. data/lib/docusign_maestro/models/get_configuration_instances_response.rb +203 -0
  99. data/lib/docusign_maestro/models/get_configuration_instances_response_config_instances.rb +192 -0
  100. data/lib/docusign_maestro/models/http_types.rb +31 -0
  101. data/lib/docusign_maestro/models/invalid_workflow_response.rb +204 -0
  102. data/lib/docusign_maestro/models/last_deployed_id.rb +174 -0
  103. data/lib/docusign_maestro/models/new_or_updated_workflow_definition_response.rb +232 -0
  104. data/lib/docusign_maestro/models/number_or_variable.rb +175 -0
  105. data/lib/docusign_maestro/models/participant.rb +231 -0
  106. data/lib/docusign_maestro/models/participant_keys.rb +30 -0
  107. data/lib/docusign_maestro/models/progress_instance.rb +205 -0
  108. data/lib/docusign_maestro/models/record_string_boolean.rb +174 -0
  109. data/lib/docusign_maestro/models/record_string_or_variable_or_transformation.rb +175 -0
  110. data/lib/docusign_maestro/models/record_to_never.rb +174 -0
  111. data/lib/docusign_maestro/models/replication_status.rb +37 -0
  112. data/lib/docusign_maestro/models/started_by_instance.rb +237 -0
  113. data/lib/docusign_maestro/models/string_or_variable_or_transformation.rb +175 -0
  114. data/lib/docusign_maestro/models/success_message_response.rb +184 -0
  115. data/lib/docusign_maestro/models/template_id.rb +175 -0
  116. data/lib/docusign_maestro/models/trigger_payload.rb +211 -0
  117. data/lib/docusign_maestro/models/trigger_workflow_via_post_response.rb +194 -0
  118. data/lib/docusign_maestro/models/user_id.rb +175 -0
  119. data/lib/docusign_maestro/models/validation_errors.rb +202 -0
  120. data/lib/docusign_maestro/models/version_string.rb +174 -0
  121. data/lib/docusign_maestro/models/workflow_creator_id.rb +175 -0
  122. data/lib/docusign_maestro/models/workflow_date_time.rb +174 -0
  123. data/lib/docusign_maestro/models/workflow_definition.rb +315 -0
  124. data/lib/docusign_maestro/models/workflow_definition_list.rb +197 -0
  125. data/lib/docusign_maestro/models/workflow_definition_metadata.rb +272 -0
  126. data/lib/docusign_maestro/models/workflow_definition_with_id.rb +292 -0
  127. data/lib/docusign_maestro/models/workflow_delete_response.rb +202 -0
  128. data/lib/docusign_maestro/models/workflow_instance.rb +304 -0
  129. data/lib/docusign_maestro/models/workflow_instance_id.rb +175 -0
  130. data/lib/docusign_maestro/models/workflow_instance_map.rb +174 -0
  131. data/lib/docusign_maestro/models/workflow_instance_state.rb +30 -0
  132. data/lib/docusign_maestro/models/workflow_instances_list.rb +175 -0
  133. data/lib/docusign_maestro/models/workflow_metadata_status.rb +33 -0
  134. data/lib/docusign_maestro/models/workflow_step_error.rb +224 -0
  135. data/lib/docusign_maestro/models/workflow_step_error_error.rb +194 -0
  136. data/lib/docusign_maestro/models/workflow_step_history.rb +298 -0
  137. data/lib/docusign_maestro/models/workflow_step_history_list.rb +175 -0
  138. data/lib/docusign_maestro/models/workflow_step_history_state.rb +30 -0
  139. data/lib/docusign_maestro/version.rb +14 -0
  140. data/lib/docusign_maestro.rb +160 -0
  141. data/runLinter.sh +1 -0
  142. metadata +446 -0
@@ -0,0 +1,247 @@
1
+ =begin
2
+ #Maestro API
3
+
4
+ #Maestro authors and executes experiences that allow non-coders the ability to define Simple Business Process without having to write code and to deploy them seamlessly without having to have development expertise
5
+
6
+ OpenAPI spec version: 1.0.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_Maestro
15
+ class ESignSigner
16
+ # Reference of #/definitions/StringOrVariableOrTransformation. Object stands for a String or a Variable or a Transformation. This object should be any of the following object models or types: [string, #/definitions/DSWorkflowVariable, #/definitions/DSWorkflowTransformationExpression]
17
+ attr_accessor :email
18
+
19
+ # Reference of #/definitions/StringOrVariableOrTransformation. Object stands for a String or a Variable or a Transformation. This object should be any of the following object models or types: [string, #/definitions/DSWorkflowVariable, #/definitions/DSWorkflowTransformationExpression]
20
+ attr_accessor :note
21
+
22
+ attr_accessor :routing_order
23
+
24
+ attr_accessor :tabs
25
+
26
+ # Reference of #/definitions/StringOrVariableOrTransformation. Object stands for a String or a Variable or a Transformation. This object should be any of the following object models or types: [string, #/definitions/DSWorkflowVariable, #/definitions/DSWorkflowTransformationExpression]
27
+ attr_accessor :user_name
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'email' => :'email',
33
+ :'note' => :'note',
34
+ :'routing_order' => :'routingOrder',
35
+ :'tabs' => :'tabs',
36
+ :'user_name' => :'userName'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'email' => :'Object',
44
+ :'note' => :'Object',
45
+ :'routing_order' => :'String',
46
+ :'tabs' => :'ESignTabsRecord',
47
+ :'user_name' => :'Object'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.has_key?(:'email')
60
+ self.email = attributes[:'email']
61
+ end
62
+
63
+ if attributes.has_key?(:'note')
64
+ self.note = attributes[:'note']
65
+ end
66
+
67
+ if attributes.has_key?(:'routingOrder')
68
+ self.routing_order = attributes[:'routingOrder']
69
+ end
70
+
71
+ if attributes.has_key?(:'tabs')
72
+ self.tabs = attributes[:'tabs']
73
+ end
74
+
75
+ if attributes.has_key?(:'userName')
76
+ self.user_name = attributes[:'userName']
77
+ end
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
+ if @email.nil?
85
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
86
+ end
87
+
88
+ if @note.nil?
89
+ invalid_properties.push('invalid value for "note", note cannot be nil.')
90
+ end
91
+
92
+ if @routing_order.nil?
93
+ invalid_properties.push('invalid value for "routing_order", routing_order cannot be nil.')
94
+ end
95
+
96
+ if @tabs.nil?
97
+ invalid_properties.push('invalid value for "tabs", tabs cannot be nil.')
98
+ end
99
+
100
+ if @user_name.nil?
101
+ invalid_properties.push('invalid value for "user_name", user_name cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @email.nil?
111
+ return false if @note.nil?
112
+ return false if @routing_order.nil?
113
+ return false if @tabs.nil?
114
+ return false if @user_name.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ email == o.email &&
124
+ note == o.note &&
125
+ routing_order == o.routing_order &&
126
+ tabs == o.tabs &&
127
+ user_name == o.user_name
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Fixnum] Hash code
138
+ def hash
139
+ [email, note, routing_order, tabs, user_name].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.swagger_types.each_pair do |key, type|
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :BOOLEAN
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ temp_model = DocuSign_Maestro.const_get(type).new
200
+ temp_model.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ next if value.nil?
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+
246
+ end
247
+ end
@@ -0,0 +1,416 @@
1
+ =begin
2
+ #Maestro API
3
+
4
+ #Maestro authors and executes experiences that allow non-coders the ability to define Simple Business Process without having to write code and to deploy them seamlessly without having to have development expertise
5
+
6
+ OpenAPI spec version: 1.0.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_Maestro
15
+ class ESignTabs
16
+ attr_accessor :anchor_string
17
+
18
+ attr_accessor :bold
19
+
20
+ attr_accessor :document_id
21
+
22
+ attr_accessor :font
23
+
24
+ attr_accessor :font_color
25
+
26
+ attr_accessor :font_size
27
+
28
+ attr_accessor :height
29
+
30
+ attr_accessor :italic
31
+
32
+ attr_accessor :locale_policy
33
+
34
+ attr_accessor :name
35
+
36
+ attr_accessor :optional
37
+
38
+ attr_accessor :page_number
39
+
40
+ attr_accessor :recipient_id
41
+
42
+ attr_accessor :scale_value
43
+
44
+ attr_accessor :stamp_type
45
+
46
+ attr_accessor :tab_id
47
+
48
+ attr_accessor :tab_label
49
+
50
+ attr_accessor :tab_type
51
+
52
+ attr_accessor :template_locked
53
+
54
+ attr_accessor :template_required
55
+
56
+ attr_accessor :tooltip
57
+
58
+ attr_accessor :underline
59
+
60
+ # Reference of #/definitions/StringOrVariableOrTransformation. Object stands for a String or a Variable or a Transformation. This object should be any of the following object models or types: [string, #/definitions/DSWorkflowVariable, #/definitions/DSWorkflowTransformationExpression]
61
+ attr_accessor :value
62
+
63
+ attr_accessor :width
64
+
65
+ attr_accessor :x_position
66
+
67
+ attr_accessor :y_position
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'anchor_string' => :'anchorString',
73
+ :'bold' => :'bold',
74
+ :'document_id' => :'documentId',
75
+ :'font' => :'font',
76
+ :'font_color' => :'fontColor',
77
+ :'font_size' => :'fontSize',
78
+ :'height' => :'height',
79
+ :'italic' => :'italic',
80
+ :'locale_policy' => :'localePolicy',
81
+ :'name' => :'name',
82
+ :'optional' => :'optional',
83
+ :'page_number' => :'pageNumber',
84
+ :'recipient_id' => :'recipientId',
85
+ :'scale_value' => :'scaleValue',
86
+ :'stamp_type' => :'stampType',
87
+ :'tab_id' => :'tabId',
88
+ :'tab_label' => :'tabLabel',
89
+ :'tab_type' => :'tabType',
90
+ :'template_locked' => :'templateLocked',
91
+ :'template_required' => :'templateRequired',
92
+ :'tooltip' => :'tooltip',
93
+ :'underline' => :'underline',
94
+ :'value' => :'value',
95
+ :'width' => :'width',
96
+ :'x_position' => :'xPosition',
97
+ :'y_position' => :'yPosition'
98
+ }
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.swagger_types
103
+ {
104
+ :'anchor_string' => :'String',
105
+ :'bold' => :'String',
106
+ :'document_id' => :'String',
107
+ :'font' => :'String',
108
+ :'font_color' => :'String',
109
+ :'font_size' => :'String',
110
+ :'height' => :'String',
111
+ :'italic' => :'String',
112
+ :'locale_policy' => :'Hash<String, Object>',
113
+ :'name' => :'String',
114
+ :'optional' => :'String',
115
+ :'page_number' => :'String',
116
+ :'recipient_id' => :'String',
117
+ :'scale_value' => :'String',
118
+ :'stamp_type' => :'String',
119
+ :'tab_id' => :'String',
120
+ :'tab_label' => :'String',
121
+ :'tab_type' => :'String',
122
+ :'template_locked' => :'String',
123
+ :'template_required' => :'String',
124
+ :'tooltip' => :'String',
125
+ :'underline' => :'String',
126
+ :'value' => :'Object',
127
+ :'width' => :'String',
128
+ :'x_position' => :'String',
129
+ :'y_position' => :'String'
130
+ }
131
+ end
132
+
133
+ # Initializes the object
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ def initialize(attributes = {})
136
+ return unless attributes.is_a?(Hash)
137
+
138
+ # convert string to symbol for hash key
139
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
140
+
141
+ if attributes.has_key?(:'anchorString')
142
+ self.anchor_string = attributes[:'anchorString']
143
+ end
144
+
145
+ if attributes.has_key?(:'bold')
146
+ self.bold = attributes[:'bold']
147
+ end
148
+
149
+ if attributes.has_key?(:'documentId')
150
+ self.document_id = attributes[:'documentId']
151
+ end
152
+
153
+ if attributes.has_key?(:'font')
154
+ self.font = attributes[:'font']
155
+ end
156
+
157
+ if attributes.has_key?(:'fontColor')
158
+ self.font_color = attributes[:'fontColor']
159
+ end
160
+
161
+ if attributes.has_key?(:'fontSize')
162
+ self.font_size = attributes[:'fontSize']
163
+ end
164
+
165
+ if attributes.has_key?(:'height')
166
+ self.height = attributes[:'height']
167
+ end
168
+
169
+ if attributes.has_key?(:'italic')
170
+ self.italic = attributes[:'italic']
171
+ end
172
+
173
+ if attributes.has_key?(:'localePolicy')
174
+ if (value = attributes[:'localePolicy']).is_a?(Hash)
175
+ self.locale_policy = value
176
+ end
177
+ end
178
+
179
+ if attributes.has_key?(:'name')
180
+ self.name = attributes[:'name']
181
+ end
182
+
183
+ if attributes.has_key?(:'optional')
184
+ self.optional = attributes[:'optional']
185
+ end
186
+
187
+ if attributes.has_key?(:'pageNumber')
188
+ self.page_number = attributes[:'pageNumber']
189
+ end
190
+
191
+ if attributes.has_key?(:'recipientId')
192
+ self.recipient_id = attributes[:'recipientId']
193
+ end
194
+
195
+ if attributes.has_key?(:'scaleValue')
196
+ self.scale_value = attributes[:'scaleValue']
197
+ end
198
+
199
+ if attributes.has_key?(:'stampType')
200
+ self.stamp_type = attributes[:'stampType']
201
+ end
202
+
203
+ if attributes.has_key?(:'tabId')
204
+ self.tab_id = attributes[:'tabId']
205
+ end
206
+
207
+ if attributes.has_key?(:'tabLabel')
208
+ self.tab_label = attributes[:'tabLabel']
209
+ end
210
+
211
+ if attributes.has_key?(:'tabType')
212
+ self.tab_type = attributes[:'tabType']
213
+ end
214
+
215
+ if attributes.has_key?(:'templateLocked')
216
+ self.template_locked = attributes[:'templateLocked']
217
+ end
218
+
219
+ if attributes.has_key?(:'templateRequired')
220
+ self.template_required = attributes[:'templateRequired']
221
+ end
222
+
223
+ if attributes.has_key?(:'tooltip')
224
+ self.tooltip = attributes[:'tooltip']
225
+ end
226
+
227
+ if attributes.has_key?(:'underline')
228
+ self.underline = attributes[:'underline']
229
+ end
230
+
231
+ if attributes.has_key?(:'value')
232
+ self.value = attributes[:'value']
233
+ end
234
+
235
+ if attributes.has_key?(:'width')
236
+ self.width = attributes[:'width']
237
+ end
238
+
239
+ if attributes.has_key?(:'xPosition')
240
+ self.x_position = attributes[:'xPosition']
241
+ end
242
+
243
+ if attributes.has_key?(:'yPosition')
244
+ self.y_position = attributes[:'yPosition']
245
+ end
246
+ end
247
+
248
+ # Show invalid properties with the reasons. Usually used together with valid?
249
+ # @return Array for valid properties with the reasons
250
+ def list_invalid_properties
251
+ invalid_properties = Array.new
252
+ if @tab_id.nil?
253
+ invalid_properties.push('invalid value for "tab_id", tab_id cannot be nil.')
254
+ end
255
+
256
+ invalid_properties
257
+ end
258
+
259
+ # Check to see if the all the properties in the model are valid
260
+ # @return true if the model is valid
261
+ def valid?
262
+ return false if @tab_id.nil?
263
+ true
264
+ end
265
+
266
+ # Checks equality by comparing each attribute.
267
+ # @param [Object] Object to be compared
268
+ def ==(o)
269
+ return true if self.equal?(o)
270
+ self.class == o.class &&
271
+ anchor_string == o.anchor_string &&
272
+ bold == o.bold &&
273
+ document_id == o.document_id &&
274
+ font == o.font &&
275
+ font_color == o.font_color &&
276
+ font_size == o.font_size &&
277
+ height == o.height &&
278
+ italic == o.italic &&
279
+ locale_policy == o.locale_policy &&
280
+ name == o.name &&
281
+ optional == o.optional &&
282
+ page_number == o.page_number &&
283
+ recipient_id == o.recipient_id &&
284
+ scale_value == o.scale_value &&
285
+ stamp_type == o.stamp_type &&
286
+ tab_id == o.tab_id &&
287
+ tab_label == o.tab_label &&
288
+ tab_type == o.tab_type &&
289
+ template_locked == o.template_locked &&
290
+ template_required == o.template_required &&
291
+ tooltip == o.tooltip &&
292
+ underline == o.underline &&
293
+ value == o.value &&
294
+ width == o.width &&
295
+ x_position == o.x_position &&
296
+ y_position == o.y_position
297
+ end
298
+
299
+ # @see the `==` method
300
+ # @param [Object] Object to be compared
301
+ def eql?(o)
302
+ self == o
303
+ end
304
+
305
+ # Calculates hash code according to all attributes.
306
+ # @return [Fixnum] Hash code
307
+ def hash
308
+ [anchor_string, bold, document_id, font, font_color, font_size, height, italic, locale_policy, name, optional, page_number, recipient_id, scale_value, stamp_type, tab_id, tab_label, tab_type, template_locked, template_required, tooltip, underline, value, width, x_position, y_position].hash
309
+ end
310
+
311
+ # Builds the object from hash
312
+ # @param [Hash] attributes Model attributes in the form of hash
313
+ # @return [Object] Returns the model itself
314
+ def build_from_hash(attributes)
315
+ return nil unless attributes.is_a?(Hash)
316
+ self.class.swagger_types.each_pair do |key, type|
317
+ if type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
321
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
322
+ end
323
+ elsif !attributes[self.class.attribute_map[key]].nil?
324
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
325
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
326
+ end
327
+
328
+ self
329
+ end
330
+
331
+ # Deserializes the data based on type
332
+ # @param string type Data type
333
+ # @param string value Value to be deserialized
334
+ # @return [Object] Deserialized data
335
+ def _deserialize(type, value)
336
+ case type.to_sym
337
+ when :DateTime
338
+ DateTime.parse(value)
339
+ when :Date
340
+ Date.parse(value)
341
+ when :String
342
+ value.to_s
343
+ when :Integer
344
+ value.to_i
345
+ when :Float
346
+ value.to_f
347
+ when :BOOLEAN
348
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
349
+ true
350
+ else
351
+ false
352
+ end
353
+ when :Object
354
+ # generic object (usually a Hash), return directly
355
+ value
356
+ when /\AArray<(?<inner_type>.+)>\z/
357
+ inner_type = Regexp.last_match[:inner_type]
358
+ value.map { |v| _deserialize(inner_type, v) }
359
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
360
+ k_type = Regexp.last_match[:k_type]
361
+ v_type = Regexp.last_match[:v_type]
362
+ {}.tap do |hash|
363
+ value.each do |k, v|
364
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
365
+ end
366
+ end
367
+ else # model
368
+ temp_model = DocuSign_Maestro.const_get(type).new
369
+ temp_model.build_from_hash(value)
370
+ end
371
+ end
372
+
373
+ # Returns the string representation of the object
374
+ # @return [String] String presentation of the object
375
+ def to_s
376
+ to_hash.to_s
377
+ end
378
+
379
+ # to_body is an alias to to_hash (backward compatibility)
380
+ # @return [Hash] Returns the object in the form of hash
381
+ def to_body
382
+ to_hash
383
+ end
384
+
385
+ # Returns the object in the form of hash
386
+ # @return [Hash] Returns the object in the form of hash
387
+ def to_hash
388
+ hash = {}
389
+ self.class.attribute_map.each_pair do |attr, param|
390
+ value = self.send(attr)
391
+ next if value.nil?
392
+ hash[param] = _to_hash(value)
393
+ end
394
+ hash
395
+ end
396
+
397
+ # Outputs non-array value in the form of hash
398
+ # For object, use to_hash. Otherwise, just return the value
399
+ # @param [Object] value Any valid value
400
+ # @return [Hash] Returns the value in the form of hash
401
+ def _to_hash(value)
402
+ if value.is_a?(Array)
403
+ value.compact.map { |v| _to_hash(v) }
404
+ elsif value.is_a?(Hash)
405
+ {}.tap do |hash|
406
+ value.each { |k, v| hash[k] = _to_hash(v) }
407
+ end
408
+ elsif value.respond_to? :to_hash
409
+ value.to_hash
410
+ else
411
+ value
412
+ end
413
+ end
414
+
415
+ end
416
+ end