Class: AsposeSlidesCloud::Effect

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_slides_cloud/models/effect.rb

Overview

Represents comment of slide

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Effect

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/aspose_slides_cloud/models/effect.rb', line 154

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'Type')
    self.type = attributes[:'Type']
  end

  if attributes.has_key?(:'Subtype')
    self.subtype = attributes[:'Subtype']
  end

  if attributes.has_key?(:'PresetClassType')
    self.preset_class_type = attributes[:'PresetClassType']
  end

  if attributes.has_key?(:'ShapeIndex')
    self.shape_index = attributes[:'ShapeIndex']
  end

  if attributes.has_key?(:'ParagraphIndex')
    self.paragraph_index = attributes[:'ParagraphIndex']
  end

  if attributes.has_key?(:'TriggerType')
    self.trigger_type = attributes[:'TriggerType']
  end

  if attributes.has_key?(:'Accelerate')
    self.accelerate = attributes[:'Accelerate']
  end

  if attributes.has_key?(:'AutoReverse')
    self.auto_reverse = attributes[:'AutoReverse']
  end

  if attributes.has_key?(:'Decelerate')
    self.decelerate = attributes[:'Decelerate']
  end

  if attributes.has_key?(:'Duration')
    self.duration = attributes[:'Duration']
  end

  if attributes.has_key?(:'RepeatCount')
    self.repeat_count = attributes[:'RepeatCount']
  end

  if attributes.has_key?(:'RepeatDuration')
    self.repeat_duration = attributes[:'RepeatDuration']
  end

  if attributes.has_key?(:'Restart')
    self.restart = attributes[:'Restart']
  end

  if attributes.has_key?(:'Speed')
    self.speed = attributes[:'Speed']
  end

  if attributes.has_key?(:'TriggerDelayTime')
    self.trigger_delay_time = attributes[:'TriggerDelayTime']
  end

  if attributes.has_key?(:'RepeatUntilEndSlide')
    self.repeat_until_end_slide = attributes[:'RepeatUntilEndSlide']
  end

  if attributes.has_key?(:'RepeatUntilNextClick')
    self.repeat_until_next_click = attributes[:'RepeatUntilNextClick']
  end

  if attributes.has_key?(:'StopPreviousSound')
    self.stop_previous_sound = attributes[:'StopPreviousSound']
  end
end

Instance Attribute Details

#accelerateObject

The percentage of duration accelerate behavior effect.



47
48
49
# File 'lib/aspose_slides_cloud/models/effect.rb', line 47

def accelerate
  @accelerate
end

#auto_reverseObject

True to automatically play the animation in reverse after playing it in the forward direction.



50
51
52
# File 'lib/aspose_slides_cloud/models/effect.rb', line 50

def auto_reverse
  @auto_reverse
end

#decelerateObject

The percentage of duration decelerate behavior effect.



53
54
55
# File 'lib/aspose_slides_cloud/models/effect.rb', line 53

def decelerate
  @decelerate
end

#durationObject

The duration of animation effect.



56
57
58
# File 'lib/aspose_slides_cloud/models/effect.rb', line 56

def duration
  @duration
end

#paragraph_indexObject

Paragraph index.



41
42
43
# File 'lib/aspose_slides_cloud/models/effect.rb', line 41

def paragraph_index
  @paragraph_index
end

#preset_class_typeObject

Preset class type.



35
36
37
# File 'lib/aspose_slides_cloud/models/effect.rb', line 35

def preset_class_type
  @preset_class_type
end

#repeat_countObject

The number of times the effect should repeat.



59
60
61
# File 'lib/aspose_slides_cloud/models/effect.rb', line 59

def repeat_count
  @repeat_count
end

#repeat_durationObject

The number of times the effect should repeat.



62
63
64
# File 'lib/aspose_slides_cloud/models/effect.rb', line 62

def repeat_duration
  @repeat_duration
end

#repeat_until_end_slideObject

Specifies if the effect will repeat until the end of slide.



74
75
76
# File 'lib/aspose_slides_cloud/models/effect.rb', line 74

def repeat_until_end_slide
  @repeat_until_end_slide
end

#repeat_until_next_clickObject

Specifies if the effect will repeat until the next click.



77
78
79
# File 'lib/aspose_slides_cloud/models/effect.rb', line 77

def repeat_until_next_click
  @repeat_until_next_click
end

#restartObject

The way for a effect to restart after complete.



65
66
67
# File 'lib/aspose_slides_cloud/models/effect.rb', line 65

def restart
  @restart
end

#shape_indexObject

Shape index.



38
39
40
# File 'lib/aspose_slides_cloud/models/effect.rb', line 38

def shape_index
  @shape_index
end

#speedObject

The percentage by which to speed up (or slow down) the timing.



68
69
70
# File 'lib/aspose_slides_cloud/models/effect.rb', line 68

def speed
  @speed
end

#stop_previous_soundObject

This attribute specifies if the animation effect stops the previous sound.



80
81
82
# File 'lib/aspose_slides_cloud/models/effect.rb', line 80

def stop_previous_sound
  @stop_previous_sound
end

#subtypeObject

Effect subtype.



32
33
34
# File 'lib/aspose_slides_cloud/models/effect.rb', line 32

def subtype
  @subtype
end

#trigger_delay_timeObject

Delay time after trigger.



71
72
73
# File 'lib/aspose_slides_cloud/models/effect.rb', line 71

def trigger_delay_time
  @trigger_delay_time
end

#trigger_typeObject

Effect trigger type.



44
45
46
# File 'lib/aspose_slides_cloud/models/effect.rb', line 44

def trigger_type
  @trigger_type
end

#typeObject

Effect type.



29
30
31
# File 'lib/aspose_slides_cloud/models/effect.rb', line 29

def type
  @type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/aspose_slides_cloud/models/effect.rb', line 105

def self.attribute_map
  {
    :'type' => :'Type',
    :'subtype' => :'Subtype',
    :'preset_class_type' => :'PresetClassType',
    :'shape_index' => :'ShapeIndex',
    :'paragraph_index' => :'ParagraphIndex',
    :'trigger_type' => :'TriggerType',
    :'accelerate' => :'Accelerate',
    :'auto_reverse' => :'AutoReverse',
    :'decelerate' => :'Decelerate',
    :'duration' => :'Duration',
    :'repeat_count' => :'RepeatCount',
    :'repeat_duration' => :'RepeatDuration',
    :'restart' => :'Restart',
    :'speed' => :'Speed',
    :'trigger_delay_time' => :'TriggerDelayTime',
    :'repeat_until_end_slide' => :'RepeatUntilEndSlide',
    :'repeat_until_next_click' => :'RepeatUntilNextClick',
    :'stop_previous_sound' => :'StopPreviousSound',
  }
end

.swagger_typesObject

Attribute type mapping.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/aspose_slides_cloud/models/effect.rb', line 129

def self.swagger_types
  {
    :'type' => :'String',
    :'subtype' => :'String',
    :'preset_class_type' => :'String',
    :'shape_index' => :'Integer',
    :'paragraph_index' => :'Integer',
    :'trigger_type' => :'String',
    :'accelerate' => :'Float',
    :'auto_reverse' => :'BOOLEAN',
    :'decelerate' => :'Float',
    :'duration' => :'Float',
    :'repeat_count' => :'Float',
    :'repeat_duration' => :'Float',
    :'restart' => :'String',
    :'speed' => :'Float',
    :'trigger_delay_time' => :'Float',
    :'repeat_until_end_slide' => :'BOOLEAN',
    :'repeat_until_next_click' => :'BOOLEAN',
    :'stop_previous_sound' => :'BOOLEAN',
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/aspose_slides_cloud/models/effect.rb', line 313

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      subtype == o.subtype &&
      preset_class_type == o.preset_class_type &&
      shape_index == o.shape_index &&
      paragraph_index == o.paragraph_index &&
      trigger_type == o.trigger_type &&
      accelerate == o.accelerate &&
      auto_reverse == o.auto_reverse &&
      decelerate == o.decelerate &&
      duration == o.duration &&
      repeat_count == o.repeat_count &&
      repeat_duration == o.repeat_duration &&
      restart == o.restart &&
      speed == o.speed &&
      trigger_delay_time == o.trigger_delay_time &&
      repeat_until_end_slide == o.repeat_until_end_slide &&
      repeat_until_next_click == o.repeat_until_next_click &&
      stop_previous_sound == o.stop_previous_sound
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/aspose_slides_cloud/models/effect.rb', line 384

def _deserialize(type, value)
  if value.nil?
    nil
  else
    case type.to_sym
    when :DateTime
      DateTime.parse(value)
    when :Date
      Date.parse(value)
    when :String
      value.to_s
    when :Integer
      value.to_i
    when :Float
      value.to_f
    when :BOOLEAN
      if value.to_s =~ /\A(true|t|yes|y|1)\z/i
        true
      else
        false
      end
    when :Object
      # generic object (usually a Hash), return directly
      value
    when /\AArray<(?<inner_type>.+)>\z/
      inner_type = Regexp.last_match[:inner_type]
      value.map { |v| _deserialize(inner_type, v) }
    when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
      k_type = Regexp.last_match[:k_type]
      v_type = Regexp.last_match[:v_type]
      {}.tap do |hash|
        value.each do |k, v|
          hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
        end
      end
    else # model
      registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
      if registry_type
        type = registry_type
      end
      temp_model = AsposeSlidesCloud.const_get(type).new
      temp_model.build_from_hash(value)
    end
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/aspose_slides_cloud/models/effect.rb', line 458

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/aspose_slides_cloud/models/effect.rb', line 351

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    mapKey = self.class.attribute_map[key]
    if !mapKey.nil?
      val = attributes[mapKey]
      if val.nil?
        mapKeyString = mapKey.to_s
        mapKeyString[0] = mapKeyString[0].downcase
        mapKey = mapKeyString.to_sym
        val = attributes[mapKey]
      end
      if !val.nil?
        if type =~ /\AArray<(.*)>/i
          # check to ensure the input is an array given that the the attribute
          # is documented as an array but the input is not
          if val.is_a?(Array)
            self.send("#{key}=", val.map { |v| _deserialize($1, v) })
          end
        else
          self.send("#{key}=", _deserialize(type, val))
        end
      end
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


338
339
340
# File 'lib/aspose_slides_cloud/models/effect.rb', line 338

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



344
345
346
# File 'lib/aspose_slides_cloud/models/effect.rb', line 344

def hash
  [type, subtype, preset_class_type, shape_index, paragraph_index, trigger_type, accelerate, auto_reverse, decelerate, duration, repeat_count, repeat_duration, restart, speed, trigger_delay_time, repeat_until_end_slide, repeat_until_next_click, stop_previous_sound].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



235
236
237
238
239
240
241
242
# File 'lib/aspose_slides_cloud/models/effect.rb', line 235

def list_invalid_properties
  invalid_properties = Array.new
  if @shape_index.nil?
    invalid_properties.push('invalid value for "shape_index", shape_index cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



438
439
440
# File 'lib/aspose_slides_cloud/models/effect.rb', line 438

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



444
445
446
447
448
449
450
451
452
# File 'lib/aspose_slides_cloud/models/effect.rb', line 444

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



432
433
434
# File 'lib/aspose_slides_cloud/models/effect.rb', line 432

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/aspose_slides_cloud/models/effect.rb', line 246

def valid?
  type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])
  return false unless type_validator.valid?(@type)
  subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])
  return false unless subtype_validator.valid?(@subtype)
  preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])
  return false unless preset_class_type_validator.valid?(@preset_class_type)
  return false if @shape_index.nil?
  trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])
  return false unless trigger_type_validator.valid?(@trigger_type)
  restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])
  return false unless restart_validator.valid?(@restart)
  true
end