Class: OCI::OsManagementHub::Models::PackageGroupSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/package_group_summary.rb

Overview

The yum or DNF package group that is associated with a software source.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PackageGroupSummary

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

  • :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

  • :repositories (Array<String>)

    The value to assign to the #repositories 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



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
121
122
123
124
125
126
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 89

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

  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']
end

Instance Attribute Details

#descriptionString

Description of the package group.

Returns:

  • (String)


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

def description
  @description
end

#display_orderInteger

Indicates the order to display category or environment.

Returns:

  • (Integer)


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

def display_order
  @display_order
end

#group_typeString

Indicates if this is a group, category or environment.

Returns:

  • (String)


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

def group_type
  @group_type
end

#idString

[Required] Package group identifier.

Returns:

  • (String)


13
14
15
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 13

def id
  @id
end

#is_defaultBOOLEAN

Indicates if this package group is the default.

Returns:

  • (BOOLEAN)


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

def is_default
  @is_default
end

#is_user_visibleBOOLEAN

Indicates if this package group is visible to users.

Returns:

  • (BOOLEAN)


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

def is_user_visible
  @is_user_visible
end

#nameString

[Required] Package group name.

Returns:

  • (String)


17
18
19
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 17

def name
  @name
end

#repositoriesArray<String>

The repository IDs of the package group.

Returns:

  • (Array<String>)


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

def repositories
  @repositories
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'description': :'description',
    'is_user_visible': :'isUserVisible',
    'is_default': :'isDefault',
    'repositories': :'repositories',
    'group_type': :'groupType',
    'display_order': :'displayOrder'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'description': :'String',
    'is_user_visible': :'BOOLEAN',
    'is_default': :'BOOLEAN',
    'repositories': :'Array<String>',
    'group_type': :'String',
    'display_order': :'Integer'
    # 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



135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 135

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    description == other.description &&
    is_user_visible == other.is_user_visible &&
    is_default == other.is_default &&
    repositories == other.repositories &&
    group_type == other.group_type &&
    display_order == other.display_order
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



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 172

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


152
153
154
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 152

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



161
162
163
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 161

def hash
  [id, name, description, is_user_visible, is_default, repositories, group_type, display_order].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 205

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



199
200
201
# File 'lib/oci/os_management_hub/models/package_group_summary.rb', line 199

def to_s
  to_hash.to_s
end