Class: OCI::Queue::Models::ConsumerGroupsCapabilityDetails

Inherits:
CapabilityDetails show all
Defined in:
lib/oci/queue/models/consumer_groups_capability_details.rb

Overview

Specifies the details for the consumer group capability. All fields are optional and are only used when the capability is added. Fields will be null when the capability is returned as part of the GetQueue API.

Constant Summary

Constants inherited from CapabilityDetails

OCI::Queue::Models::CapabilityDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CapabilityDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CapabilityDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ConsumerGroupsCapabilityDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 71

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'CONSUMER_GROUPS'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.is_primary_consumer_group_enabled = attributes[:'isPrimaryConsumerGroupEnabled'] unless attributes[:'isPrimaryConsumerGroupEnabled'].nil?

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

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

  self.primary_consumer_group_display_name = attributes[:'primaryConsumerGroupDisplayName'] if attributes[:'primaryConsumerGroupDisplayName']

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

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

  self.primary_consumer_group_filter = attributes[:'primaryConsumerGroupFilter'] if attributes[:'primaryConsumerGroupFilter']

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

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

  self.primary_consumer_group_dead_letter_queue_delivery_count = attributes[:'primaryConsumerGroupDeadLetterQueueDeliveryCount'] if attributes[:'primaryConsumerGroupDeadLetterQueueDeliveryCount']

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

  self.primary_consumer_group_dead_letter_queue_delivery_count = attributes[:'primary_consumer_group_dead_letter_queue_delivery_count'] if attributes[:'primary_consumer_group_dead_letter_queue_delivery_count']
end

Instance Attribute Details

#is_primary_consumer_group_enabledBOOLEAN

Specifies if the primary consumer group should be automatically enabled after adding the capability.

Returns:

  • (BOOLEAN)


16
17
18
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 16

def is_primary_consumer_group_enabled
  @is_primary_consumer_group_enabled
end

#primary_consumer_group_dead_letter_queue_delivery_countInteger

The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 33

def primary_consumer_group_dead_letter_queue_delivery_count
  @primary_consumer_group_dead_letter_queue_delivery_count
end

#primary_consumer_group_display_nameString

Name of the primary consumer group. If omitted, it will be named "Primary Consumer Group".

Returns:

  • (String)


20
21
22
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 20

def primary_consumer_group_display_name
  @primary_consumer_group_display_name
end

#primary_consumer_group_filterString

The filter used by the primary consumer group. Only messages matching the filter will be available by consumers of the group. An empty value means that all messages will be available in the group.

Returns:

  • (String)


26
27
28
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 26

def primary_consumer_group_filter
  @primary_consumer_group_filter
end

Class Method Details

.attribute_mapObject

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



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 36

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'is_primary_consumer_group_enabled': :'isPrimaryConsumerGroupEnabled',
    'primary_consumer_group_display_name': :'primaryConsumerGroupDisplayName',
    'primary_consumer_group_filter': :'primaryConsumerGroupFilter',
    'primary_consumer_group_dead_letter_queue_delivery_count': :'primaryConsumerGroupDeadLetterQueueDeliveryCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'is_primary_consumer_group_enabled': :'BOOLEAN',
    'primary_consumer_group_display_name': :'String',
    'primary_consumer_group_filter': :'String',
    'primary_consumer_group_dead_letter_queue_delivery_count': :'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



113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 113

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

  self.class == other.class &&
    type == other.type &&
    is_primary_consumer_group_enabled == other.is_primary_consumer_group_enabled &&
    primary_consumer_group_display_name == other.primary_consumer_group_display_name &&
    primary_consumer_group_filter == other.primary_consumer_group_filter &&
    primary_consumer_group_dead_letter_queue_delivery_count == other.primary_consumer_group_dead_letter_queue_delivery_count
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



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 147

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


127
128
129
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 127

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



136
137
138
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 136

def hash
  [type, is_primary_consumer_group_enabled, primary_consumer_group_display_name, primary_consumer_group_filter, primary_consumer_group_dead_letter_queue_delivery_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



180
181
182
183
184
185
186
187
188
189
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 180

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



174
175
176
# File 'lib/oci/queue/models/consumer_groups_capability_details.rb', line 174

def to_s
  to_hash.to_s
end