Class: OCI::DataCatalog::Models::CustomPropertyTypeUsage
- Inherits:
-
Object
- Object
- OCI::DataCatalog::Models::CustomPropertyTypeUsage
- Defined in:
- lib/oci/data_catalog/models/custom_property_type_usage.rb
Overview
Object which describes the indivial object stats for every custom property
Instance Attribute Summary collapse
-
#count ⇒ Integer
Number of objects associated with this type.
-
#is_event_enabled ⇒ BOOLEAN
If an OCI Event will be emitted when the custom property is modified.
-
#type_id ⇒ String
Unique type key identifier.
-
#type_name ⇒ String
Name of the type associated with.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CustomPropertyTypeUsage
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CustomPropertyTypeUsage
Initializes the object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 61 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.type_id = attributes[:'typeId'] if attributes[:'typeId'] raise 'You cannot provide both :typeId and :type_id' if attributes.key?(:'typeId') && attributes.key?(:'type_id') self.type_id = attributes[:'type_id'] if attributes[:'type_id'] self.type_name = attributes[:'typeName'] if attributes[:'typeName'] raise 'You cannot provide both :typeName and :type_name' if attributes.key?(:'typeName') && attributes.key?(:'type_name') self.type_name = attributes[:'type_name'] if attributes[:'type_name'] self.count = attributes[:'count'] if attributes[:'count'] self.is_event_enabled = attributes[:'isEventEnabled'] unless attributes[:'isEventEnabled'].nil? self.is_event_enabled = false if is_event_enabled.nil? && !attributes.key?(:'isEventEnabled') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isEventEnabled and :is_event_enabled' if attributes.key?(:'isEventEnabled') && attributes.key?(:'is_event_enabled') self.is_event_enabled = attributes[:'is_event_enabled'] unless attributes[:'is_event_enabled'].nil? self.is_event_enabled = false if is_event_enabled.nil? && !attributes.key?(:'isEventEnabled') && !attributes.key?(:'is_event_enabled') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#count ⇒ Integer
Number of objects associated with this type
21 22 23 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 21 def count @count end |
#is_event_enabled ⇒ BOOLEAN
If an OCI Event will be emitted when the custom property is modified.
25 26 27 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 25 def is_event_enabled @is_event_enabled end |
#type_id ⇒ String
Unique type key identifier
13 14 15 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 13 def type_id @type_id end |
#type_name ⇒ String
Name of the type associated with
17 18 19 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 17 def type_name @type_name end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 28 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'type_id': :'typeId', 'type_name': :'typeName', 'count': :'count', 'is_event_enabled': :'isEventEnabled' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 40 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'type_id': :'String', 'type_name': :'String', 'count': :'Integer', 'is_event_enabled': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
97 98 99 100 101 102 103 104 105 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 97 def ==(other) return true if equal?(other) self.class == other.class && type_id == other.type_id && type_name == other.type_name && count == other.count && is_event_enabled == other.is_event_enabled end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 130 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
110 111 112 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 110 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
119 120 121 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 119 def hash [type_id, type_name, count, is_event_enabled].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 163 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_s ⇒ String
Returns the string representation of the object
157 158 159 |
# File 'lib/oci/data_catalog/models/custom_property_type_usage.rb', line 157 def to_s to_hash.to_s end |