Class: OCI::CloudMigrations::Models::OlvmAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_migrations/models/olvm_agent.rb

Overview

Type representing a fence agent.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OlvmAgent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :address (String)

    The value to assign to the #address property

  • :comment (String)

    The value to assign to the #comment property

  • :is_concurrent (BOOLEAN)

    The value to assign to the #is_concurrent property

  • :description (String)

    The value to assign to the #description property

  • :is_encrypt_options (BOOLEAN)

    The value to assign to the #is_encrypt_options property

  • :id (String)

    The value to assign to the #id property

  • :name (String)

    The value to assign to the #name property

  • :order (Integer)

    The value to assign to the #order property

  • :port (Integer)

    The value to assign to the #port property

  • :type (String)

    The value to assign to the #type property

  • :username (String)

    The value to assign to the #username property



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
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 110

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

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

  self.is_concurrent = attributes[:'isConcurrent'] unless attributes[:'isConcurrent'].nil?

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

  self.is_concurrent = attributes[:'is_concurrent'] unless attributes[:'is_concurrent'].nil?

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

  self.is_encrypt_options = attributes[:'isEncryptOptions'] unless attributes[:'isEncryptOptions'].nil?

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

  self.is_encrypt_options = attributes[:'is_encrypt_options'] unless attributes[:'is_encrypt_options'].nil?

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

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

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

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

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

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

Instance Attribute Details

#addressString

Fence agent address

Returns:

  • (String)


13
14
15
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 13

def address
  @address
end

#commentString

Free text containing comments about this object.

Returns:

  • (String)


17
18
19
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 17

def comment
  @comment
end

#descriptionString

Free text containing comments about this object.

Returns:

  • (String)


25
26
27
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 25

def description
  @description
end

#idString

A unique identifier.

Returns:

  • (String)


33
34
35
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 33

def id
  @id
end

#is_concurrentBOOLEAN

Specified whether the agent should be used concurrently or sequentially

Returns:

  • (BOOLEAN)


21
22
23
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 21

def is_concurrent
  @is_concurrent
end

#is_encrypt_optionsBOOLEAN

Specifies whether the options should be encrypted.

Returns:

  • (BOOLEAN)


29
30
31
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 29

def is_encrypt_options
  @is_encrypt_options
end

#nameString

A human-readable name in plain text

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 37

def name
  @name
end

#orderInteger

The order of this agent if used with other agents.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 41

def order
  @order
end

#portInteger

Fence agent port.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 45

def port
  @port
end

#typeString

Fence agent type.

Returns:

  • (String)


49
50
51
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 49

def type
  @type
end

#usernameString

Fence agent user name.

Returns:

  • (String)


53
54
55
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 53

def username
  @username
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'address',
    'comment': :'comment',
    'is_concurrent': :'isConcurrent',
    'description': :'description',
    'is_encrypt_options': :'isEncryptOptions',
    'id': :'id',
    'name': :'name',
    'order': :'order',
    'port': :'port',
    'type': :'type',
    'username': :'username'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'String',
    'comment': :'String',
    'is_concurrent': :'BOOLEAN',
    'description': :'String',
    'is_encrypt_options': :'BOOLEAN',
    'id': :'String',
    'name': :'String',
    'order': :'Integer',
    'port': :'Integer',
    'type': :'String',
    'username': :'String'
    # 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



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/oci/cloud_migrations/models/olvm_agent.rb', line 154

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

  self.class == other.class &&
    address == other.address &&
    comment == other.comment &&
    is_concurrent == other.is_concurrent &&
    description == other.description &&
    is_encrypt_options == other.is_encrypt_options &&
    id == other.id &&
    name == other.name &&
    order == other.order &&
    port == other.port &&
    type == other.type &&
    username == other.username
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/cloud_migrations/models/olvm_agent.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/cloud_migrations/models/olvm_agent.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/cloud_migrations/models/olvm_agent.rb', line 183

def hash
  [address, comment, is_concurrent, description, is_encrypt_options, id, name, order, port, type, username].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/cloud_migrations/models/olvm_agent.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/cloud_migrations/models/olvm_agent.rb', line 221

def to_s
  to_hash.to_s
end