Google\Cloud\PubSub\Message::__construct PHP Method

__construct() public method

public __construct ( array $message, array $metadata )
$message array See [PubsubMessage](https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage).
$metadata array { Message metadata @type string $ackId The message ackId. This is only set when messages are pulled from the PubSub service. @type Subscription $subscription The subscription the message was obtained from. This is only set when messages are delivered by pushDelivery.
    public function __construct(array $message, array $metadata)
    {
        $this->message = $message + ['data' => null, 'messageId' => null, 'publishTime' => null, 'attributes' => []];
        $metadata += ['ackId' => null, 'subscription' => null];
        $this->ackId = $metadata['ackId'];
        $this->subscription = $metadata['subscription'];
    }