Skip to content

Commit bc3f61f

Browse files
Merge branch 'master' into release
2 parents ce79cf7 + 8f012a8 commit bc3f61f

File tree

3 files changed

+307
-2
lines changed

3 files changed

+307
-2
lines changed

lib/aspose_words_cloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
require_relative 'aspose_words_cloud/models/footnotes_response'
125125
require_relative 'aspose_words_cloud/models/footnotes_stat_data'
126126
require_relative 'aspose_words_cloud/models/footnote_update'
127+
require_relative 'aspose_words_cloud/models/form_field'
127128
require_relative 'aspose_words_cloud/models/form_field_checkbox'
128129
require_relative 'aspose_words_cloud/models/form_field_collection'
129130
require_relative 'aspose_words_cloud/models/form_field_drop_down'
Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
# ------------------------------------------------------------------------------------
2+
# <copyright company="Aspose" file="form_field.rb">
3+
# Copyright (c) 2023 Aspose.Words for Cloud
4+
# </copyright>
5+
# <summary>
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
# </summary>
24+
# ------------------------------------------------------------------------------------
25+
26+
require 'date'
27+
28+
module AsposeWordsCloud
29+
30+
# FromField.
31+
class FormField
32+
# Gets or sets the link to the document.
33+
attr_accessor :link
34+
35+
# Gets or sets the node id.
36+
attr_accessor :node_id
37+
38+
# Gets or sets a value indicating whether references to the specified form field are automatically updated whenever the field is exited.
39+
attr_accessor :calculate_on_exit
40+
41+
# Gets or sets a value indicating whether a form field is enabled.
42+
attr_accessor :enabled
43+
44+
# Gets or sets the entry macro name for the form field.
45+
attr_accessor :entry_macro
46+
47+
# Gets or sets the exit macro name for the form field.
48+
attr_accessor :exit_macro
49+
50+
# Gets or sets text, displayed in a message box when the form field has the focus and the user presses F1.
51+
attr_accessor :help_text
52+
53+
# Gets or sets the form field name.
54+
attr_accessor :name
55+
56+
# Gets or sets a value indicating whether the source of the text that's displayed in a message box when a form field has the focus and the user presses F1.
57+
attr_accessor :own_help
58+
59+
# Gets or sets a value indicating whether the source of the text that's displayed in the status bar when a form field has the focus.
60+
attr_accessor :own_status
61+
62+
# Gets or sets text, displayed in the status bar when a form field has the focus.
63+
attr_accessor :status_text
64+
# Attribute mapping from ruby-style variable name to JSON key.
65+
def self.attribute_map
66+
{
67+
:'link' => :'Link',
68+
:'node_id' => :'NodeId',
69+
:'calculate_on_exit' => :'CalculateOnExit',
70+
:'enabled' => :'Enabled',
71+
:'entry_macro' => :'EntryMacro',
72+
:'exit_macro' => :'ExitMacro',
73+
:'help_text' => :'HelpText',
74+
:'name' => :'Name',
75+
:'own_help' => :'OwnHelp',
76+
:'own_status' => :'OwnStatus',
77+
:'status_text' => :'StatusText'
78+
}
79+
end
80+
81+
# Attribute type mapping.
82+
def self.swagger_types
83+
{
84+
:'link' => :'WordsApiLink',
85+
:'node_id' => :'String',
86+
:'calculate_on_exit' => :'BOOLEAN',
87+
:'enabled' => :'BOOLEAN',
88+
:'entry_macro' => :'String',
89+
:'exit_macro' => :'String',
90+
:'help_text' => :'String',
91+
:'name' => :'String',
92+
:'own_help' => :'BOOLEAN',
93+
:'own_status' => :'BOOLEAN',
94+
:'status_text' => :'String'
95+
}
96+
end
97+
98+
# Initializes the object
99+
# @param [Hash] attributes Model attributes in the form of hash
100+
def initialize(attributes = {})
101+
return unless attributes.is_a?(Hash)
102+
103+
# convert string to symbol for hash key
104+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
105+
106+
if attributes.key?(:'Link')
107+
self.link = attributes[:'Link']
108+
end
109+
110+
if attributes.key?(:'NodeId')
111+
self.node_id = attributes[:'NodeId']
112+
end
113+
114+
if attributes.key?(:'CalculateOnExit')
115+
self.calculate_on_exit = attributes[:'CalculateOnExit']
116+
end
117+
118+
if attributes.key?(:'Enabled')
119+
self.enabled = attributes[:'Enabled']
120+
end
121+
122+
if attributes.key?(:'EntryMacro')
123+
self.entry_macro = attributes[:'EntryMacro']
124+
end
125+
126+
if attributes.key?(:'ExitMacro')
127+
self.exit_macro = attributes[:'ExitMacro']
128+
end
129+
130+
if attributes.key?(:'HelpText')
131+
self.help_text = attributes[:'HelpText']
132+
end
133+
134+
if attributes.key?(:'Name')
135+
self.name = attributes[:'Name']
136+
end
137+
138+
if attributes.key?(:'OwnHelp')
139+
self.own_help = attributes[:'OwnHelp']
140+
end
141+
142+
if attributes.key?(:'OwnStatus')
143+
self.own_status = attributes[:'OwnStatus']
144+
end
145+
146+
if attributes.key?(:'StatusText')
147+
self.status_text = attributes[:'StatusText']
148+
end
149+
end
150+
151+
# Show invalid properties with the reasons. Usually used together with valid?
152+
# @return Array for valid properies with the reasons
153+
def list_invalid_properties
154+
invalid_properties = []
155+
return invalid_properties
156+
end
157+
158+
# Check to see if the all the properties in the model are valid
159+
# @return true if the model is valid
160+
def valid?
161+
return true
162+
end
163+
164+
# Checks equality by comparing each attribute.
165+
# @param [Object] Object to be compared
166+
def ==(other)
167+
return true if self.equal?(other)
168+
self.class == other.class &&
169+
link == other.link &&
170+
node_id == other.node_id &&
171+
calculate_on_exit == other.calculate_on_exit &&
172+
enabled == other.enabled &&
173+
entry_macro == other.entry_macro &&
174+
exit_macro == other.exit_macro &&
175+
help_text == other.help_text &&
176+
name == other.name &&
177+
own_help == other.own_help &&
178+
own_status == other.own_status &&
179+
status_text == other.status_text
180+
end
181+
182+
# @see the `==` method
183+
# @param [Object] Object to be compared
184+
def eql?(other)
185+
self == other
186+
end
187+
188+
# Calculates hash code according to all attributes.
189+
# @return [Fixnum] Hash code
190+
def hash
191+
[link, node_id, calculate_on_exit, enabled, entry_macro, exit_macro, help_text, name, own_help, own_status, status_text].hash
192+
end
193+
194+
# Builds the object from hash
195+
# @param [Hash] attributes Model attributes in the form of hash
196+
# @return [Object] Returns the model itself
197+
def build_from_hash(attributes)
198+
return nil unless attributes.is_a?(Hash)
199+
self.class.swagger_types.each_pair do |key, type|
200+
if type =~ /\AArray<(.*)>/i
201+
# check to ensure the input is an array given that the the attribute
202+
# is documented as an array but the input is not
203+
if attributes[self.class.attribute_map[key]].is_a?(Array)
204+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
205+
end
206+
elsif !attributes[self.class.attribute_map[key]].nil?
207+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
208+
end
209+
# or else data not found in attributes(hash), not an issue as the data can be optional
210+
end
211+
212+
self
213+
end
214+
215+
# Deserializes the data based on type
216+
# @param string type Data type
217+
# @param string value Value to be deserialized
218+
# @return [Object] Deserialized data
219+
def _deserialize(type, value)
220+
case type.to_sym
221+
when :DateTime
222+
Time.at(/\d/.match(value)[0].to_f).to_datetime
223+
when :Date
224+
Time.at(/\d/.match(value)[0].to_f).to_date
225+
when :String
226+
value.to_s
227+
when :Integer
228+
value.to_i
229+
when :Float
230+
value.to_f
231+
when :BOOLEAN
232+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233+
true
234+
else
235+
false
236+
end
237+
when :Object
238+
# generic object (usually a Hash), return directly
239+
value
240+
when /\AArray<(?<inner_type>.+)>\z/
241+
inner_type = Regexp.last_match[:inner_type]
242+
value.map { |v| _deserialize(inner_type, v) }
243+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244+
k_type = Regexp.last_match[:k_type]
245+
v_type = Regexp.last_match[:v_type]
246+
{}.tap do |hash|
247+
value.each do |k, v|
248+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249+
end
250+
end
251+
else
252+
# model
253+
temp_model = AsposeWordsCloud.const_get(type).new
254+
temp_model.build_from_hash(value)
255+
end
256+
end
257+
258+
# Returns the string representation of the object
259+
# @return [String] String presentation of the object
260+
def to_s
261+
to_hash.to_s
262+
end
263+
264+
# to_body is an alias to to_hash (backward compatibility)
265+
# @return [Hash] Returns the object in the form of hash
266+
def to_body
267+
to_hash
268+
end
269+
270+
# Returns the object in the form of hash
271+
# @return [Hash] Returns the object in the form of hash
272+
def to_hash
273+
hash = {}
274+
self.class.attribute_map.each_pair do |attr, param|
275+
value = self.send(attr)
276+
next if value.nil?
277+
hash[param] = _to_hash(value)
278+
end
279+
hash
280+
end
281+
282+
# Outputs non-array value in the form of hash
283+
# For object, use to_hash. Otherwise, just return the value
284+
# @param [Object] value Any valid value
285+
# @return [Hash] Returns the value in the form of hash
286+
def _to_hash(value)
287+
if value.is_a?(Array)
288+
value.compact.map { |v| _to_hash(v) }
289+
elsif value.is_a?(Hash)
290+
{}.tap do |hash|
291+
value.each { |k, v| hash[k] = _to_hash(v) }
292+
end
293+
elsif value.respond_to? :to_hash
294+
value.to_hash
295+
else
296+
value
297+
end
298+
end
299+
300+
def collectFilesContent(resultFilesContent)
301+
end
302+
303+
end
304+
end

lib/aspose_words_cloud/models/requests/insert_section_online_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def to_batch_part(api_client, requestId, parentRequestId = nil)
124124
# http body (model)
125125
body = api_client.build_request_body_batch(header_params, form_params, files_content)
126126
part = ""
127-
part.concat("POST".force_encoding('UTF-8'))
127+
part.concat("PUT".force_encoding('UTF-8'))
128128
part.concat(" ".force_encoding('UTF-8'))
129129
part.concat(local_var_path.force_encoding('UTF-8'))
130130
part.concat(" \r\n".force_encoding('UTF-8'))
@@ -180,7 +180,7 @@ def create_http_request(api_client)
180180

181181
body = api_client.build_request_body(header_params, form_params, files_content)
182182
{
183-
'method': :POST,
183+
'method': :PUT,
184184
'path': local_var_path,
185185
'header_params': header_params,
186186
'query_params': query_params,

0 commit comments

Comments
 (0)