Class: OCI::OsManagementHub::Models::PackageGroup
- Inherits:
-
Object
- Object
- OCI::OsManagementHub::Models::PackageGroup
- Defined in:
- lib/oci/os_management_hub/models/package_group.rb
Overview
Yum or DNF package group, category, or environment.
Constant Summary collapse
- GROUP_TYPE_ENUM =
[ GROUP_TYPE_GROUP = 'GROUP'.freeze, GROUP_TYPE_ENVIRONMENT = 'ENVIRONMENT'.freeze, GROUP_TYPE_CATEGORY = 'CATEGORY'.freeze, GROUP_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#description ⇒ String
Description of the package group.
-
#display_order ⇒ Integer
Indicates the order to display category or environment.
-
#group_type ⇒ String
Indicates if this is a group, category, or environment.
-
#id ⇒ String
[Required] Package group identifier.
-
#is_default ⇒ BOOLEAN
Indicates if this package group is the default.
-
#is_user_visible ⇒ BOOLEAN
Indicates if this package group is visible to users.
-
#name ⇒ String
[Required] Package group name.
-
#packages ⇒ Array<String>
[Required] The list of packages in the package group.
-
#repositories ⇒ Array<String>
The repository IDs of the package group's repositories.
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 = {}) ⇒ PackageGroup
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 = {}) ⇒ PackageGroup
Initializes the object
104 105 106 107 108 109 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 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 104 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.id = attributes[:'id'] if attributes[:'id'] self.name = attributes[:'name'] if attributes[:'name'] self.repositories = attributes[:'repositories'] if attributes[:'repositories'] self.description = attributes[:'description'] if attributes[:'description'] self.is_user_visible = attributes[:'isUserVisible'] unless attributes[:'isUserVisible'].nil? raise 'You cannot provide both :isUserVisible and :is_user_visible' if attributes.key?(:'isUserVisible') && attributes.key?(:'is_user_visible') self.is_user_visible = attributes[:'is_user_visible'] unless attributes[:'is_user_visible'].nil? self.is_default = attributes[:'isDefault'] unless attributes[:'isDefault'].nil? raise 'You cannot provide both :isDefault and :is_default' if attributes.key?(:'isDefault') && attributes.key?(:'is_default') self.is_default = attributes[:'is_default'] unless attributes[:'is_default'].nil? self.group_type = attributes[:'groupType'] if attributes[:'groupType'] raise 'You cannot provide both :groupType and :group_type' if attributes.key?(:'groupType') && attributes.key?(:'group_type') self.group_type = attributes[:'group_type'] if attributes[:'group_type'] self.display_order = attributes[:'displayOrder'] if attributes[:'displayOrder'] raise 'You cannot provide both :displayOrder and :display_order' if attributes.key?(:'displayOrder') && attributes.key?(:'display_order') self.display_order = attributes[:'display_order'] if attributes[:'display_order'] self.packages = attributes[:'packages'] if attributes[:'packages'] end |
Instance Attribute Details
#description ⇒ String
Description of the package group.
33 34 35 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 33 def description @description end |
#display_order ⇒ Integer
Indicates the order to display category or environment.
49 50 51 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 49 def display_order @display_order end |
#group_type ⇒ String
Indicates if this is a group, category, or environment.
45 46 47 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 45 def group_type @group_type end |
#id ⇒ String
[Required] Package group identifier.
21 22 23 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 21 def id @id end |
#is_default ⇒ BOOLEAN
Indicates if this package group is the default.
41 42 43 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 41 def is_default @is_default end |
#is_user_visible ⇒ BOOLEAN
Indicates if this package group is visible to users.
37 38 39 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 37 def is_user_visible @is_user_visible end |
#name ⇒ String
[Required] Package group name.
25 26 27 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 25 def name @name end |
#packages ⇒ Array<String>
[Required] The list of packages in the package group.
53 54 55 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 53 def packages @packages end |
#repositories ⇒ Array<String>
The repository IDs of the package group's repositories.
29 30 31 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 29 def repositories @repositories end |
Class Method Details
.attribute_map ⇒ Object
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 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 56 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'name': :'name', 'repositories': :'repositories', 'description': :'description', 'is_user_visible': :'isUserVisible', 'is_default': :'isDefault', 'group_type': :'groupType', 'display_order': :'displayOrder', 'packages': :'packages' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 73 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'name': :'String', 'repositories': :'Array<String>', 'description': :'String', 'is_user_visible': :'BOOLEAN', 'is_default': :'BOOLEAN', 'group_type': :'String', 'display_order': :'Integer', 'packages': :'Array<String>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 165 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && name == other.name && repositories == other.repositories && description == other.description && is_user_visible == other.is_user_visible && is_default == other.is_default && group_type == other.group_type && display_order == other.display_order && packages == other.packages end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 203 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
183 184 185 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 183 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
192 193 194 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 192 def hash [id, name, repositories, description, is_user_visible, is_default, group_type, display_order, packages].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
236 237 238 239 240 241 242 243 244 245 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 236 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
230 231 232 |
# File 'lib/oci/os_management_hub/models/package_group.rb', line 230 def to_s to_hash.to_s end |