Class: DdrClient::DdrAPITechnicalMetadataEntity

Inherits:
Object
  • Object
show all
Defined in:
lib/ddr_client/models/ddr_api_technical_metadata_entity.rb

Overview

Ddr_API_TechnicalMetadataEntity model

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DdrAPITechnicalMetadataEntity

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 100

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?(:'id')
    self.id = attributes[:'id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#color_spaceObject

Returns the value of attribute color_space.



22
23
24
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 22

def color_space
  @color_space
end

#createdObject

Returns the value of attribute created.



24
25
26
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 24

def created
  @created
end

#creating_applicationObject

Returns the value of attribute creating_application.



26
27
28
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 26

def creating_application
  @creating_application
end

#extentObject

Returns the value of attribute extent.



28
29
30
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 28

def extent
  @extent
end

#format_labelObject

Returns the value of attribute format_label.



30
31
32
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 30

def format_label
  @format_label
end

#format_versionObject

Returns the value of attribute format_version.



32
33
34
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 32

def format_version
  @format_version
end

#icc_profile_nameObject

Returns the value of attribute icc_profile_name.



34
35
36
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 34

def icc_profile_name
  @icc_profile_name
end

#icc_profile_versionObject

Returns the value of attribute icc_profile_version.



36
37
38
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 36

def icc_profile_version
  @icc_profile_version
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 18

def id
  @id
end

#image_heightObject

Returns the value of attribute image_height.



38
39
40
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 38

def image_height
  @image_height
end

#image_widthObject

Returns the value of attribute image_width.



40
41
42
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 40

def image_width
  @image_width
end

#local_idObject

Returns the value of attribute local_id.



20
21
22
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 20

def local_id
  @local_id
end

#media_typeObject

Returns the value of attribute media_type.



42
43
44
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 42

def media_type
  @media_type
end

#modifiedObject

Returns the value of attribute modified.



44
45
46
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 44

def modified
  @modified
end

#pronom_identifierObject

Returns the value of attribute pronom_identifier.



46
47
48
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 46

def pronom_identifier
  @pronom_identifier
end

#validObject

Returns the value of attribute valid.



48
49
50
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 48

def valid
  @valid
end

#well_formedObject

Returns the value of attribute well_formed.



50
51
52
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 50

def well_formed
  @well_formed
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 53

def self.attribute_map
  {
    :'id' => :'id',
    :'local_id' => :'local_id',
    :'color_space' => :'color_space',
    :'created' => :'created',
    :'creating_application' => :'creating_application',
    :'extent' => :'extent',
    :'format_label' => :'format_label',
    :'format_version' => :'format_version',
    :'icc_profile_name' => :'icc_profile_name',
    :'icc_profile_version' => :'icc_profile_version',
    :'image_height' => :'image_height',
    :'image_width' => :'image_width',
    :'media_type' => :'media_type',
    :'modified' => :'modified',
    :'pronom_identifier' => :'pronom_identifier',
    :'valid' => :'valid',
    :'well_formed' => :'well_formed'
  }
end

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 76

def self.swagger_types
  {
    :'id' => :'String',
    :'local_id' => :'String',
    :'color_space' => :'String',
    :'created' => :'String',
    :'creating_application' => :'String',
    :'extent' => :'String',
    :'format_label' => :'String',
    :'format_version' => :'String',
    :'icc_profile_name' => :'String',
    :'icc_profile_version' => :'String',
    :'image_height' => :'String',
    :'image_width' => :'String',
    :'media_type' => :'String',
    :'modified' => :'String',
    :'pronom_identifier' => :'String',
    :'valid' => :'String',
    :'well_formed' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 190

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      local_id == o.local_id &&
      color_space == o.color_space &&
      created == o.created &&
      creating_application == o.creating_application &&
      extent == o.extent &&
      format_label == o.format_label &&
      format_version == o.format_version &&
      icc_profile_name == o.icc_profile_name &&
      icc_profile_version == o.icc_profile_version &&
      image_height == o.image_height &&
      image_width == o.image_width &&
      media_type == o.media_type &&
      modified == o.modified &&
      pronom_identifier == o.pronom_identifier &&
      valid == o.valid &&
      well_formed == o.well_formed
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



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 248

def _deserialize(type, value)
  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
    temp_model = DdrClient.const_get(type).new
    temp_model.build_from_hash(value)
  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



314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 314

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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 227

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


214
215
216
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 214

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



220
221
222
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 220

def hash
  [id, local_id, color_space, created, creating_application, extent, format_label, format_version, icc_profile_name, icc_profile_version, image_height, image_width, media_type, modified, pronom_identifier, valid, well_formed].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



177
178
179
180
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 177

def list_invalid_properties
  invalid_properties = Array.new
  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



294
295
296
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 294

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



300
301
302
303
304
305
306
307
308
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 300

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



288
289
290
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 288

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



184
185
186
# File 'lib/ddr_client/models/ddr_api_technical_metadata_entity.rb', line 184

def valid?
  true
end