# Class Message

A message is a task, a notification, or any meaningful data that gets posted to the queue. A message exists until it is deleted by a recipient or automatically by the system based on a TTL (time-to-live) value.

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource
  OpenCloud\Common\PersistentObject
  OpenCloud\Queues\Resource\Message

Namespace: OpenCloud\Queues\Resource
Located at OpenCloud/Queues/Resource/Message.php

Methods summary
`public `OpenCloud\Queues\Resource\Message`` | # `setHref( string $href )` Set href (and ID). Set href (and ID). #### Parameters $href `string` $href #### Returns ``OpenCloud\Queues\Resource\Message``
`public string` | # `getHref( )` #### Returns `string`
`public object` | # `createJson( )` Provides JSON for create request body Provides JSON for create request body #### Returns `object` #### Throws ``RuntimeException`` #### Overrides `OpenCloud\Common\Resource\PersistentResource::createJson()`
`public Guzzle\Http\Message\Response` | # `create( array $params = array() )` Create a new resource Create a new resource #### Parameters $params `array` $params #### Returns `Guzzle\Http\Message\Response` #### Overrides `OpenCloud\Common\Resource\PersistentResource::create()`
`public Guzzle\Http\Message\Response` | # `update( array $params = array() )` Update a resource Update a resource #### Parameters $params `array` $params #### Returns `Guzzle\Http\Message\Response` #### Overrides `OpenCloud\Common\Resource\PersistentResource::update()`
`public boolean` | # `delete( string $claimId = null )` This operation immediately deletes the specified message. This operation immediately deletes the specified message. #### Parameters $claimId `string` $claimId Specifies that the message should be deleted only if it has the specified claim ID, and that claim has not expired. This is useful for ensuring only one agent processes any given message. Whenever a worker client's claim expires before it has a chance to delete a message it has processed, the worker must roll back any actions it took based on that message because another worker will now be able to claim and process the same message. If you do not specify $claimId, but the message is claimed, the operation fails. You can only delete claimed messages by providing an appropriate $claimId. #### Returns `boolean` #### Throws ``OpenCloud\Queues\Exception\DeleteMessageException`` #### Overrides `OpenCloud\Common\Resource\PersistentResource::delete()`
`public string` | # `getClaimIdFromHref( )` If this message has been claimed, retrieve the claim id. If this message has been claimed, retrieve the claim id. #### Returns `string`

Methods inherited from OpenCloud\Common\Resource\PersistentResource
`checkExtension(), getAlias(), noCreate(), noDelete(), noUpdate(), refresh(), refreshFromLocationUrl(), updateJson(), waitFor()`

Methods inherited from OpenCloud\Common\Resource\BaseResource
`__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), primaryKeyField(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties summary
`protected static string` | $url_resource | `'messages'` | #
`protected static string` | $json_collection_name | `'messages'` | #
`protected static string` | $json_name | `''` | #

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`

Properties inherited from OpenCloud\Common\Base
`$aliases`