Class: OCI::Queue::Models::GetMessage
- Inherits:
-
Object
- Object
- OCI::Queue::Models::GetMessage
- Defined in:
- lib/oci/queue/models/get_message.rb
Overview
A message consumed from a queue.
Instance Attribute Summary collapse
-
#content ⇒ String
[Required] The content of the message.
-
#delivery_count ⇒ Integer
[Required] The number of times that the message has been delivered to a consumer.
-
#expire_after ⇒ DateTime
[Required] The time after which the message will be automatically deleted, expressed in RFC 3339 timestamp format.
-
#id ⇒ Integer
[Required] The ID of the message.
- #metadata ⇒ OCI::Queue::Models::MessageMetadata
-
#receipt ⇒ String
[Required] A receipt is a base64urlencode opaque token, uniquely representing a message.
-
#visible_after ⇒ DateTime
[Required] The time after which the message will be visible to other consumers, expressed in RFC 3339 timestamp format.
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 = {}) ⇒ GetMessage
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 = {}) ⇒ GetMessage
Initializes the object
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 |
# File 'lib/oci/queue/models/get_message.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.content = attributes[:'content'] if attributes[:'content'] self.receipt = attributes[:'receipt'] if attributes[:'receipt'] self.delivery_count = attributes[:'deliveryCount'] if attributes[:'deliveryCount'] raise 'You cannot provide both :deliveryCount and :delivery_count' if attributes.key?(:'deliveryCount') && attributes.key?(:'delivery_count') self.delivery_count = attributes[:'delivery_count'] if attributes[:'delivery_count'] self.visible_after = attributes[:'visibleAfter'] if attributes[:'visibleAfter'] raise 'You cannot provide both :visibleAfter and :visible_after' if attributes.key?(:'visibleAfter') && attributes.key?(:'visible_after') self.visible_after = attributes[:'visible_after'] if attributes[:'visible_after'] self.expire_after = attributes[:'expireAfter'] if attributes[:'expireAfter'] raise 'You cannot provide both :expireAfter and :expire_after' if attributes.key?(:'expireAfter') && attributes.key?(:'expire_after') self.expire_after = attributes[:'expire_after'] if attributes[:'expire_after'] self. = attributes[:'metadata'] if attributes[:'metadata'] end |
Instance Attribute Details
#content ⇒ String
[Required] The content of the message.
17 18 19 |
# File 'lib/oci/queue/models/get_message.rb', line 17 def content @content end |
#delivery_count ⇒ Integer
[Required] The number of times that the message has been delivered to a consumer.
27 28 29 |
# File 'lib/oci/queue/models/get_message.rb', line 27 def delivery_count @delivery_count end |
#expire_after ⇒ DateTime
[Required] The time after which the message will be automatically deleted, expressed in RFC 3339 timestamp format.
Example: 2018-04-20T00:00:07.405Z
41 42 43 |
# File 'lib/oci/queue/models/get_message.rb', line 41 def expire_after @expire_after end |
#id ⇒ Integer
[Required] The ID of the message. This ID is only used for tracing and debugging purposes and isn't used as a parameter in any request.
13 14 15 |
# File 'lib/oci/queue/models/get_message.rb', line 13 def id @id end |
#metadata ⇒ OCI::Queue::Models::MessageMetadata
44 45 46 |
# File 'lib/oci/queue/models/get_message.rb', line 44 def @metadata end |
#receipt ⇒ String
[Required] A receipt is a base64urlencode opaque token, uniquely representing a message. The receipt can be used to delete a message or update its visibility.
23 24 25 |
# File 'lib/oci/queue/models/get_message.rb', line 23 def receipt @receipt end |
#visible_after ⇒ DateTime
[Required] The time after which the message will be visible to other consumers, expressed in RFC 3339 timestamp format.
Example: 2018-04-20T00:00:07.405Z
34 35 36 |
# File 'lib/oci/queue/models/get_message.rb', line 34 def visible_after @visible_after end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/queue/models/get_message.rb', line 47 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'content': :'content', 'receipt': :'receipt', 'delivery_count': :'deliveryCount', 'visible_after': :'visibleAfter', 'expire_after': :'expireAfter', 'metadata': :'metadata' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/queue/models/get_message.rb', line 62 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'Integer', 'content': :'String', 'receipt': :'String', 'delivery_count': :'Integer', 'visible_after': :'DateTime', 'expire_after': :'DateTime', 'metadata': :'OCI::Queue::Models::MessageMetadata' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/oci/queue/models/get_message.rb', line 129 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && content == other.content && receipt == other.receipt && delivery_count == other.delivery_count && visible_after == other.visible_after && expire_after == other.expire_after && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/queue/models/get_message.rb', line 165 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
145 146 147 |
# File 'lib/oci/queue/models/get_message.rb', line 145 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
154 155 156 |
# File 'lib/oci/queue/models/get_message.rb', line 154 def hash [id, content, receipt, delivery_count, visible_after, expire_after, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/oci/queue/models/get_message.rb', line 198 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
192 193 194 |
# File 'lib/oci/queue/models/get_message.rb', line 192 def to_s to_hash.to_s end |