Class: AsposeSlidesCloud::ProtectionProperties

Inherits:
ResourceBase show all
Defined in:
lib/aspose_slides_cloud/models/protection_properties.rb

Overview

Protection properties.

Instance Attribute Summary collapse

Attributes inherited from ResourceBase

#alternate_links, #self_uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ProtectionProperties

Initializes the object

Parameters:

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

    Model attributes in the form of hash



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 72

def initialize(attributes = {})
  super

  if attributes.has_key?(:'EncryptDocumentProperties')
    self.encrypt_document_properties = attributes[:'EncryptDocumentProperties']
  end

  if attributes.has_key?(:'ReadOnlyRecommended')
    self.read_only_recommended = attributes[:'ReadOnlyRecommended']
  end

  if attributes.has_key?(:'ReadPassword')
    self.read_password = attributes[:'ReadPassword']
  end

  if attributes.has_key?(:'WritePassword')
    self.write_password = attributes[:'WritePassword']
  end

  if attributes.has_key?(:'IsWriteProtected')
    self.is_write_protected = attributes[:'IsWriteProtected']
  end

  if attributes.has_key?(:'IsEncrypted')
    self.is_encrypted = attributes[:'IsEncrypted']
  end
end

Instance Attribute Details

#encrypt_document_propertiesObject

True if document properties are encrypted. Has effect only for password protected presentations.



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

def encrypt_document_properties
  @encrypt_document_properties
end

#is_encryptedObject

Returns true if the presentation protected for reading.



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

def is_encrypted
  @is_encrypted
end

#is_write_protectedObject

Returns true if the presentation protected for editing.



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

def is_write_protected
  @is_write_protected
end

True if the document should be opened as read-only.



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

def read_only_recommended
  @read_only_recommended
end

#read_passwordObject

Password for read protection.



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

def read_password
  @read_password
end

#write_passwordObject

Password for write protection.



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

def write_password
  @write_password
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 47

def self.attribute_map
  super.merge({
    :'encrypt_document_properties' => :'EncryptDocumentProperties',
    :'read_only_recommended' => :'ReadOnlyRecommended',
    :'read_password' => :'ReadPassword',
    :'write_password' => :'WritePassword',
    :'is_write_protected' => :'IsWriteProtected',
    :'is_encrypted' => :'IsEncrypted',
  })
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 59

def self.swagger_types
  super.merge({
    :'encrypt_document_properties' => :'BOOLEAN',
    :'read_only_recommended' => :'BOOLEAN',
    :'read_password' => :'String',
    :'write_password' => :'String',
    :'is_write_protected' => :'BOOLEAN',
    :'is_encrypted' => :'BOOLEAN',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 126

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      self_uri == o.self_uri &&
      alternate_links == o.alternate_links &&
      encrypt_document_properties == o.encrypt_document_properties &&
      read_only_recommended == o.read_only_recommended &&
      read_password == o.read_password &&
      write_password == o.write_password &&
      is_write_protected == o.is_write_protected &&
      is_encrypted == o.is_encrypted
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


141
142
143
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 141

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



147
148
149
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 147

def hash
  [self_uri, alternate_links, encrypt_document_properties, read_only_recommended, read_password, write_password, is_write_protected, is_encrypted].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 102

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

  if @is_encrypted.nil?
    invalid_properties.push('invalid value for "is_encrypted", is_encrypted cannot be nil.')
  end

  invalid_properties
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



117
118
119
120
121
122
# File 'lib/aspose_slides_cloud/models/protection_properties.rb', line 117

def valid?
  return false if !super
  return false if @is_write_protected.nil?
  return false if @is_encrypted.nil?
  true
end