Class: OCI::FleetAppsManagement::Models::SubnetVariableDependsOn

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb

Overview

Depends on object for Subnet Variables.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubnetVariableDependsOn

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :vcn_id (String)

    The value to assign to the #vcn_id property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :hide_public_subnet (String)

    The value to assign to the #hide_public_subnet property

  • :hide_private_subnet (String)

    The value to assign to the #hide_private_subnet property

  • :hide_regional_subnet (String)

    The value to assign to the #hide_regional_subnet property

  • :hide_ad_subnet (String)

    The value to assign to the #hide_ad_subnet property



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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 75

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

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.hide_public_subnet = attributes[:'hidePublicSubnet'] if attributes[:'hidePublicSubnet']

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

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

  self.hide_private_subnet = attributes[:'hidePrivateSubnet'] if attributes[:'hidePrivateSubnet']

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

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

  self.hide_regional_subnet = attributes[:'hideRegionalSubnet'] if attributes[:'hideRegionalSubnet']

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

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

  self.hide_ad_subnet = attributes[:'hideAdSubnet'] if attributes[:'hideAdSubnet']

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

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

Instance Attribute Details

#compartment_idString

[Required] OCID of the compartment.

Returns:

  • (String)


17
18
19
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 17

def compartment_id
  @compartment_id
end

#hide_ad_subnetString

If present, hides AD subnet.

Returns:

  • (String)


33
34
35
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 33

def hide_ad_subnet
  @hide_ad_subnet
end

#hide_private_subnetString

If present, hides private subnets.

Returns:

  • (String)


25
26
27
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 25

def hide_private_subnet
  @hide_private_subnet
end

#hide_public_subnetString

If present, hides public subnets.

Returns:

  • (String)


21
22
23
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 21

def hide_public_subnet
  @hide_public_subnet
end

#hide_regional_subnetString

If present, hides regional subnets.

Returns:

  • (String)


29
30
31
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 29

def hide_regional_subnet
  @hide_regional_subnet
end

#vcn_idString

[Required] OCID of the VCN.

Returns:

  • (String)


13
14
15
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 13

def vcn_id
  @vcn_id
end

Class Method Details

.attribute_mapObject

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



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 36

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'vcn_id': :'vcnId',
    'compartment_id': :'compartmentId',
    'hide_public_subnet': :'hidePublicSubnet',
    'hide_private_subnet': :'hidePrivateSubnet',
    'hide_regional_subnet': :'hideRegionalSubnet',
    'hide_ad_subnet': :'hideAdSubnet'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'vcn_id': :'String',
    'compartment_id': :'String',
    'hide_public_subnet': :'String',
    'hide_private_subnet': :'String',
    'hide_regional_subnet': :'String',
    'hide_ad_subnet': :'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



125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 125

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

  self.class == other.class &&
    vcn_id == other.vcn_id &&
    compartment_id == other.compartment_id &&
    hide_public_subnet == other.hide_public_subnet &&
    hide_private_subnet == other.hide_private_subnet &&
    hide_regional_subnet == other.hide_regional_subnet &&
    hide_ad_subnet == other.hide_ad_subnet
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



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 160

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


140
141
142
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 140

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



149
150
151
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 149

def hash
  [vcn_id, compartment_id, hide_public_subnet, hide_private_subnet, hide_regional_subnet, hide_ad_subnet].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 193

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



187
188
189
# File 'lib/oci/fleet_apps_management/models/subnet_variable_depends_on.rb', line 187

def to_s
  to_hash.to_s
end