Файл: sngine-v2.8/Script/includes/libs/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php
Строк: 80
<?php
/**
* This code was generated by
* / _ _ _| _ _
* | (_)/(_)(_|/| |(/_ v1.0.0
* / /
*/
namespace TwilioRestSyncV1ServiceSyncStream;
use TwilioExceptionsTwilioException;
use TwilioListResource;
use TwilioSerialize;
use TwilioValues;
use TwilioVersion;
/**
* PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
*/
class StreamMessageList extends ListResource {
/**
* Construct the StreamMessageList
*
* @param Version $version Version that contains the resource
* @param string $serviceSid The SID of the Sync Service that the resource is
* associated with
* @param string $streamSid The unique string that identifies the resource
*/
public function __construct(Version $version, string $serviceSid, string $streamSid) {
parent::__construct($version);
// Path Solution
$this->solution = ['serviceSid' => $serviceSid, 'streamSid' => $streamSid, ];
$this->uri = '/Services/' . rawurlencode($serviceSid) . '/Streams/' . rawurlencode($streamSid) . '/Messages';
}
/**
* Create the StreamMessageInstance
*
* @param array $data A JSON string that represents an arbitrary, schema-less
* object that makes up the Stream Message body
* @return StreamMessageInstance Created StreamMessageInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function create(array $data): StreamMessageInstance {
$data = Values::of(['Data' => Serialize::jsonObject($data), ]);
$payload = $this->version->create('POST', $this->uri, [], $data);
return new StreamMessageInstance(
$this->version,
$payload,
$this->solution['serviceSid'],
$this->solution['streamSid']
);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Sync.V1.StreamMessageList]';
}
}