Class: OCI::Jms::Models::DrsFileSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/jms/models/drs_file_summary.rb

Overview

A Deployment Rule Set(DRS) is a JAR (Java ARchive) file used in Java applications to enforce security and manage compatibility between different versions of Java applets and web start applications (docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_rules.html).

Constant Summary collapse

CHECKSUM_TYPE_ENUM =
[
  CHECKSUM_TYPE_SHA256 = 'SHA256'.freeze,
  CHECKSUM_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DrsFileSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :bucket_name (String)

    The value to assign to the #bucket_name property

  • :namespace (String)

    The value to assign to the #namespace property

  • :drs_file_name (String)

    The value to assign to the #drs_file_name property

  • :drs_file_key (String)

    The value to assign to the #drs_file_key property

  • :checksum_type (String)

    The value to assign to the #checksum_type property

  • :checksum_value (String)

    The value to assign to the #checksum_value property

  • :is_default (BOOLEAN)

    The value to assign to the #is_default property



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/jms/models/drs_file_summary.rb', line 91

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 }

  self.bucket_name = attributes[:'bucketName'] if attributes[:'bucketName']

  raise 'You cannot provide both :bucketName and :bucket_name' if attributes.key?(:'bucketName') && attributes.key?(:'bucket_name')

  self.bucket_name = attributes[:'bucket_name'] if attributes[:'bucket_name']

  self.namespace = attributes[:'namespace'] if attributes[:'namespace']

  self.drs_file_name = attributes[:'drsFileName'] if attributes[:'drsFileName']

  raise 'You cannot provide both :drsFileName and :drs_file_name' if attributes.key?(:'drsFileName') && attributes.key?(:'drs_file_name')

  self.drs_file_name = attributes[:'drs_file_name'] if attributes[:'drs_file_name']

  self.drs_file_key = attributes[:'drsFileKey'] if attributes[:'drsFileKey']

  raise 'You cannot provide both :drsFileKey and :drs_file_key' if attributes.key?(:'drsFileKey') && attributes.key?(:'drs_file_key')

  self.drs_file_key = attributes[:'drs_file_key'] if attributes[:'drs_file_key']

  self.checksum_type = attributes[:'checksumType'] if attributes[:'checksumType']

  raise 'You cannot provide both :checksumType and :checksum_type' if attributes.key?(:'checksumType') && attributes.key?(:'checksum_type')

  self.checksum_type = attributes[:'checksum_type'] if attributes[:'checksum_type']

  self.checksum_value = attributes[:'checksumValue'] if attributes[:'checksumValue']

  raise 'You cannot provide both :checksumValue and :checksum_value' if attributes.key?(:'checksumValue') && attributes.key?(:'checksum_value')

  self.checksum_value = attributes[:'checksum_value'] if attributes[:'checksum_value']

  self.is_default = attributes[:'isDefault'] unless attributes[:'isDefault'].nil?
  self.is_default = false if is_default.nil? && !attributes.key?(:'isDefault') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :isDefault and :is_default' if attributes.key?(:'isDefault') && attributes.key?(:'is_default')

  self.is_default = attributes[:'is_default'] unless attributes[:'is_default'].nil?
  self.is_default = false if is_default.nil? && !attributes.key?(:'isDefault') && !attributes.key?(:'is_default') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#bucket_nameString

[Required] The Object Storage bucket name where the DRS file is located.

Returns:

  • (String)


22
23
24
# File 'lib/oci/jms/models/drs_file_summary.rb', line 22

def bucket_name
  @bucket_name
end

#checksum_typeString

[Required] The checksum type for the DRS file in Object Storage.

Returns:

  • (String)


38
39
40
# File 'lib/oci/jms/models/drs_file_summary.rb', line 38

def checksum_type
  @checksum_type
end

#checksum_valueString

[Required] The checksum value for the DRS file in Object Storage.

Returns:

  • (String)


42
43
44
# File 'lib/oci/jms/models/drs_file_summary.rb', line 42

def checksum_value
  @checksum_value
end

#drs_file_keyString

[Required] The unique identifier of the DRS file in Object Storage.

Returns:

  • (String)


34
35
36
# File 'lib/oci/jms/models/drs_file_summary.rb', line 34

def drs_file_key
  @drs_file_key
end

#drs_file_nameString

[Required] The name of the DRS file in Object Store.

Returns:

  • (String)


30
31
32
# File 'lib/oci/jms/models/drs_file_summary.rb', line 30

def drs_file_name
  @drs_file_name
end

#is_defaultBOOLEAN

[Required] To check if the DRS file is the detfault ones.

Returns:

  • (BOOLEAN)


46
47
48
# File 'lib/oci/jms/models/drs_file_summary.rb', line 46

def is_default
  @is_default
end

#namespaceString

[Required] The namespace for Object Storage.

Returns:

  • (String)


26
27
28
# File 'lib/oci/jms/models/drs_file_summary.rb', line 26

def namespace
  @namespace
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/jms/models/drs_file_summary.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'bucket_name': :'bucketName',
    'namespace': :'namespace',
    'drs_file_name': :'drsFileName',
    'drs_file_key': :'drsFileKey',
    'checksum_type': :'checksumType',
    'checksum_value': :'checksumValue',
    'is_default': :'isDefault'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/jms/models/drs_file_summary.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'bucket_name': :'String',
    'namespace': :'String',
    'drs_file_name': :'String',
    'drs_file_key': :'String',
    'checksum_type': :'String',
    'checksum_value': :'String',
    'is_default': :'BOOLEAN'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/oci/jms/models/drs_file_summary.rb', line 158

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    bucket_name == other.bucket_name &&
    namespace == other.namespace &&
    drs_file_name == other.drs_file_name &&
    drs_file_key == other.drs_file_key &&
    checksum_type == other.checksum_type &&
    checksum_value == other.checksum_value &&
    is_default == other.is_default
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



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/jms/models/drs_file_summary.rb', line 194

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/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 attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


174
175
176
# File 'lib/oci/jms/models/drs_file_summary.rb', line 174

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



183
184
185
# File 'lib/oci/jms/models/drs_file_summary.rb', line 183

def hash
  [bucket_name, namespace, drs_file_name, drs_file_key, checksum_type, checksum_value, is_default].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/jms/models/drs_file_summary.rb', line 227

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



221
222
223
# File 'lib/oci/jms/models/drs_file_summary.rb', line 221

def to_s
  to_hash.to_s
end