Class: OCI::OsManagementHub::Models::PackageGroup

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PackageGroup

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :name (String)

    The value to assign to the #name property

  • :repositories (Array<String>)

    The value to assign to the #repositories property

  • :description (String)

    The value to assign to the #description property

  • :is_user_visible (BOOLEAN)

    The value to assign to the #is_user_visible property

  • :is_default (BOOLEAN)

    The value to assign to the #is_default property

  • :group_type (String)

    The value to assign to the #group_type property

  • :display_order (Integer)

    The value to assign to the #display_order property

  • :packages (Array<String>)

    The value to assign to the #packages property



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

#descriptionString

Description of the package group.

Returns:

  • (String)


33
34
35
# File 'lib/oci/os_management_hub/models/package_group.rb', line 33

def description
  @description
end

#display_orderInteger

Indicates the order to display category or environment.

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/os_management_hub/models/package_group.rb', line 49

def display_order
  @display_order
end

#group_typeString

Indicates if this is a group, category, or environment.

Returns:

  • (String)


45
46
47
# File 'lib/oci/os_management_hub/models/package_group.rb', line 45

def group_type
  @group_type
end

#idString

[Required] Package group identifier.

Returns:

  • (String)


21
22
23
# File 'lib/oci/os_management_hub/models/package_group.rb', line 21

def id
  @id
end

#is_defaultBOOLEAN

Indicates if this package group is the default.

Returns:

  • (BOOLEAN)


41
42
43
# File 'lib/oci/os_management_hub/models/package_group.rb', line 41

def is_default
  @is_default
end

#is_user_visibleBOOLEAN

Indicates if this package group is visible to users.

Returns:

  • (BOOLEAN)


37
38
39
# File 'lib/oci/os_management_hub/models/package_group.rb', line 37

def is_user_visible
  @is_user_visible
end

#nameString

[Required] Package group name.

Returns:

  • (String)


25
26
27
# File 'lib/oci/os_management_hub/models/package_group.rb', line 25

def name
  @name
end

#packagesArray<String>

[Required] The list of packages in the package group.

Returns:

  • (Array<String>)


53
54
55
# File 'lib/oci/os_management_hub/models/package_group.rb', line 53

def packages
  @packages
end

#repositoriesArray<String>

The repository IDs of the package group's repositories.

Returns:

  • (Array<String>)


29
30
31
# File 'lib/oci/os_management_hub/models/package_group.rb', line 29

def repositories
  @repositories
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
# 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_typesObject

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.

Parameters:

  • other (Object)

    the other object to be compared



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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


183
184
185
# File 'lib/oci/os_management_hub/models/package_group.rb', line 183

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation 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