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.
-
#created_at ⇒ DateTime
[Required] The time when message was created in queue.
-
#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
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 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/oci/queue/models/get_message.rb', line 99 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.created_at = attributes[:'createdAt'] if attributes[:'createdAt'] raise 'You cannot provide both :createdAt and :created_at' if attributes.key?(:'createdAt') && attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] if attributes[:'created_at'] 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 |
#created_at ⇒ DateTime
[Required] The time when message was created in queue.
Example: 2018-04-20T00:00:07.405Z
48 49 50 |
# File 'lib/oci/queue/models/get_message.rb', line 48 def created_at @created_at 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
51 52 53 |
# File 'lib/oci/queue/models/get_message.rb', line 51 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.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/oci/queue/models/get_message.rb', line 54 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'content': :'content', 'receipt': :'receipt', 'delivery_count': :'deliveryCount', 'visible_after': :'visibleAfter', 'expire_after': :'expireAfter', 'created_at': :'createdAt', 'metadata': :'metadata' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/oci/queue/models/get_message.rb', line 70 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'Integer', 'content': :'String', 'receipt': :'String', 'delivery_count': :'Integer', 'visible_after': :'DateTime', 'expire_after': :'DateTime', 'created_at': :'DateTime', 'metadata': :'OCI::Queue::Models::MessageMetadata' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/oci/queue/models/get_message.rb', line 145 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 && created_at == other.created_at && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/oci/queue/models/get_message.rb', line 182 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
162 163 164 |
# File 'lib/oci/queue/models/get_message.rb', line 162 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
171 172 173 |
# File 'lib/oci/queue/models/get_message.rb', line 171 def hash [id, content, receipt, delivery_count, visible_after, expire_after, created_at, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/oci/queue/models/get_message.rb', line 215 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
209 210 211 |
# File 'lib/oci/queue/models/get_message.rb', line 209 def to_s to_hash.to_s end |