lib/fog/rackspace/models/queues/claim.rb in fog-maestrodev-1.18.0.20131125111730 vs lib/fog/rackspace/models/queues/claim.rb in fog-maestrodev-1.18.0.20131126122111
- old
+ new
@@ -3,26 +3,62 @@
module Fog
module Rackspace
class Queues
class Claim < Fog::Model
+ # @!attribute [r] identity
+ # @return [String] The claim's id
identity :identity
+ # @!attribute [rw] grace
+ # @return [Integer] The grace attribute specifies the message grace period in seconds. The value of grace value must be between 60 and 43200 seconds (12 hours).
+ # You must include a value for this attribute in your request. To deal with workers that have stopped responding (for up to 1209600 seconds or 14 days, including
+ # claim lifetime), the server extends the lifetime of claimed messages to be at least as long as the lifetime of the claim itself, plus the specified grace period.
+ # If a claimed message would normally live longer than the grace period, its expiration is not adjusted.
attribute :grace
+
+ # @!attribute [rw] ttl
+ # @return [Integer] The ttl attribute specifies how long the server waits before releasing the claim. The ttl value must be between 60 and 43200 seconds (12 hours).
attribute :ttl
+
+ # @!attribute [rw] limit
+ # @return [Integer] Specifies the number of messages to return, up to 20 messages. If limit is not specified, limit defaults to 10.
attribute :limit
+
+ # @!attribute [r] limit
+ # @return [Array<Fog::Rackspace::Queues::Messages>, Array<Strings>] Specifies the number of messages to return, up to 20 messages.
+ # If limit is not specified, limit defaults to 10.
attribute :messages
alias :id :identity
+ # Creates or updates a claim
+ #
+ # @return [Boolean] returns true if claim is being created
+ #
+ # @raise [Fog::Rackspace::Queues::NotFound] - HTTP 404
+ # @raise [Fog::Rackspace::Queues::BadRequest] - HTTP 400
+ # @raise [Fog::Rackspace::Queues::InternalServerError] - HTTP 500
+ # @raise [Fog::Rackspace::Queues::ServiceError]
+ # @see http://docs.rackspace.com/queues/api/v1.0/cq-devguide/content/POST_claimMessages__version__queues__queue_name__claims_claims-operations-dle001.html
+ # @see http://docs.rackspace.com/queues/api/v1.0/cq-devguide/content/PATCH_updateClaim__version__queues__queue_name__claims__claimId__claims-operations-dle001.html
def save
if identity.nil?
create
else
update
end
end
+ # Destroys Claim
+ #
+ # @return [Boolean] returns true if claim is deleted
+ #
+ # @raise [Fog::Rackspace::Queues::NotFound] - HTTP 404
+ # @raise [Fog::Rackspace::Queues::BadRequest] - HTTP 400
+ # @raise [Fog::Rackspace::Queues::InternalServerError] - HTTP 500
+ # @raise [Fog::Rackspace::Queues::ServiceError]
+ # @see http://docs.rackspace.com/queues/api/v1.0/cq-devguide/content/DELETE_deleteClaim__version__queues__queue_name__claims__claimId__claims-operations-dle001.html
def destroy
requires :identity, :queue
service.delete_claim(queue.name, identity)
#Since Claims aren't a server side collection, we should remove