Class: OCI::ApplicationMigration::Models::ImportManifest

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/application_migration/models/import_manifest.rb

Overview

Manifest describing details about an import source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ImportManifest

Initializes the object

Options Hash (attributes):

  • :version (String)

    The value to assign to the #version property

  • :export_type (String)

    The value to assign to the #export_type property

  • :export_details (Object)

    The value to assign to the #export_details property

  • :timestamp (DateTime)

    The value to assign to the #timestamp property

  • :md5 (String)

    The value to assign to the #md5 property

  • :signature (String)

    The value to assign to the #signature property



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
99
# File 'lib/oci/application_migration/models/import_manifest.rb', line 74

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.version = attributes[:'version'] if attributes[:'version']

  self.export_type = attributes[:'exportType'] if attributes[:'exportType']

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

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

  self.export_details = attributes[:'exportDetails'] if attributes[:'exportDetails']

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

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

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

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

  self.signature = attributes[:'signature'] if attributes[:'signature']
end

Instance Attribute Details

#export_detailsObject

application specific details as parsed from various sources of the application that was exported



20
21
22
# File 'lib/oci/application_migration/models/import_manifest.rb', line 20

def export_details
  @export_details
end

#export_typeString

the type of application that the export tool was executed against to generate this manifest



16
17
18
# File 'lib/oci/application_migration/models/import_manifest.rb', line 16

def export_type
  @export_type
end

#md5String

the MD5 hash of the export artifact archive that was produced by the export tool and should be used with this manifest



28
29
30
# File 'lib/oci/application_migration/models/import_manifest.rb', line 28

def md5
  @md5
end

#signatureString

a sha1 hash of all the fields of this manifest (excluding the signature)



32
33
34
# File 'lib/oci/application_migration/models/import_manifest.rb', line 32

def signature
  @signature
end

#timestampDateTime

when this manifest was generated



24
25
26
# File 'lib/oci/application_migration/models/import_manifest.rb', line 24

def timestamp
  @timestamp
end

#versionString

the version of the export tool that was used to generate the manifest



12
13
14
# File 'lib/oci/application_migration/models/import_manifest.rb', line 12

def version
  @version
end

Class Method Details

.attribute_mapObject

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



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/oci/application_migration/models/import_manifest.rb', line 35

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'version': :'version',
    'export_type': :'exportType',
    'export_details': :'exportDetails',
    'timestamp': :'timestamp',
    'md5': :'md5',
    'signature': :'signature'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'version': :'String',
    'export_type': :'String',
    'export_details': :'Object',
    'timestamp': :'DateTime',
    'md5': :'String',
    'signature': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/oci/application_migration/models/import_manifest.rb', line 108

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

  self.class == other.class &&
    version == other.version &&
    export_type == other.export_type &&
    export_details == other.export_details &&
    timestamp == other.timestamp &&
    md5 == other.md5 &&
    signature == other.signature
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/oci/application_migration/models/import_manifest.rb', line 143

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

See Also:

  • `==` method


123
124
125
# File 'lib/oci/application_migration/models/import_manifest.rb', line 123

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.



132
133
134
# File 'lib/oci/application_migration/models/import_manifest.rb', line 132

def hash
  [version, export_type, export_details, timestamp, md5, signature].hash
end

#to_hashHash

Returns the object in the form of hash



176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/application_migration/models/import_manifest.rb', line 176

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



170
171
172
# File 'lib/oci/application_migration/models/import_manifest.rb', line 170

def to_s
  to_hash.to_s
end