Class: OCI::Limits::Models::LimitDefinitionSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/limits/models/limit_definition_summary.rb

Overview

The metadata specific to a resource limit definition.

Constant Summary collapse

SCOPE_TYPE_ENUM =
[
  SCOPE_TYPE_GLOBAL = 'GLOBAL'.freeze,
  SCOPE_TYPE_REGION = 'REGION'.freeze,
  SCOPE_TYPE_AD = 'AD'.freeze,
  SCOPE_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 = {}) ⇒ LimitDefinitionSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :service_name (String)

    The value to assign to the #service_name property

  • :description (String)

    The value to assign to the #description property

  • :scope_type (String)

    The value to assign to the #scope_type property

  • :are_quotas_supported (BOOLEAN)

    The value to assign to the #are_quotas_supported property

  • :is_resource_availability_supported (BOOLEAN)

    The value to assign to the #is_resource_availability_supported property



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
117
118
119
120
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 87

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

  self.service_name = attributes[:'serviceName'] if attributes[:'serviceName']

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

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

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

  self.scope_type = attributes[:'scopeType'] if attributes[:'scopeType']

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

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

  self.are_quotas_supported = attributes[:'areQuotasSupported'] unless attributes[:'areQuotasSupported'].nil?

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

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

  self.is_resource_availability_supported = attributes[:'isResourceAvailabilitySupported'] unless attributes[:'isResourceAvailabilitySupported'].nil?

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

  self.is_resource_availability_supported = attributes[:'is_resource_availability_supported'] unless attributes[:'is_resource_availability_supported'].nil?
end

Instance Attribute Details

#are_quotas_supportedBOOLEAN

If true, quota policies can be created on top of this resource limit.

Returns:

  • (BOOLEAN)


39
40
41
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 39

def are_quotas_supported
  @are_quotas_supported
end

#descriptionString

The limit description.

Returns:

  • (String)


29
30
31
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 29

def description
  @description
end

#is_resource_availability_supportedBOOLEAN

Reflects if the GetResourceAvailability API is supported for this limit or not. If not, the API will return an empty JSON response.

Returns:

  • (BOOLEAN)


45
46
47
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 45

def is_resource_availability_supported
  @is_resource_availability_supported
end

#nameString

The resource limit name. To be used for writing policies (in case of quotas) or other programmatic calls.

Returns:

  • (String)


21
22
23
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 21

def name
  @name
end

#scope_typeString

Reflects the scope of the resource limit: which can be Global (across all regions), regional or ad specific.

Returns:

  • (String)


34
35
36
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 34

def scope_type
  @scope_type
end

#service_nameString

The service name of the limit.

Returns:

  • (String)


25
26
27
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 25

def service_name
  @service_name
end

Class Method Details

.attribute_mapObject

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



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 48

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'service_name': :'serviceName',
    'description': :'description',
    'scope_type': :'scopeType',
    'are_quotas_supported': :'areQuotasSupported',
    'is_resource_availability_supported': :'isResourceAvailabilitySupported'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 62

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'service_name': :'String',
    'description': :'String',
    'scope_type': :'String',
    'are_quotas_supported': :'BOOLEAN',
    'is_resource_availability_supported': :'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



142
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 142

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

  self.class == other.class &&
    name == other.name &&
    service_name == other.service_name &&
    description == other.description &&
    scope_type == other.scope_type &&
    are_quotas_supported == other.are_quotas_supported &&
    is_resource_availability_supported == other.is_resource_availability_supported
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



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 177

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


157
158
159
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 157

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



166
167
168
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 166

def hash
  [name, service_name, description, scope_type, are_quotas_supported, is_resource_availability_supported].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 210

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



204
205
206
# File 'lib/oci/limits/models/limit_definition_summary.rb', line 204

def to_s
  to_hash.to_s
end