|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * This code was generated by |
| 5 | + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ |
| 6 | + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ |
| 7 | + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ |
| 8 | + * |
| 9 | + * Twilio - Api |
| 10 | + * This is the public Twilio REST API. |
| 11 | + * |
| 12 | + * NOTE: This class is auto generated by OpenAPI Generator. |
| 13 | + * https://openapi-generator.tech |
| 14 | + * Do not edit the class manually. |
| 15 | + */ |
| 16 | + |
| 17 | + |
| 18 | +namespace Twilio\Rest\Api\V2010\Account\Call; |
| 19 | + |
| 20 | +use Twilio\Exceptions\TwilioException; |
| 21 | +use Twilio\InstanceResource; |
| 22 | +use Twilio\Values; |
| 23 | +use Twilio\Version; |
| 24 | +use Twilio\Deserialize; |
| 25 | + |
| 26 | + |
| 27 | +/** |
| 28 | + * @property string|null $sid |
| 29 | + * @property string|null $accountSid |
| 30 | + * @property string|null $callSid |
| 31 | + * @property string|null $name |
| 32 | + * @property string $status |
| 33 | + * @property \DateTime|null $dateUpdated |
| 34 | + * @property string|null $uri |
| 35 | + */ |
| 36 | +class TranscriptionInstance extends InstanceResource |
| 37 | +{ |
| 38 | + /** |
| 39 | + * Initialize the TranscriptionInstance |
| 40 | + * |
| 41 | + * @param Version $version Version that contains the resource |
| 42 | + * @param mixed[] $payload The response payload |
| 43 | + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. |
| 44 | + * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. |
| 45 | + * @param string $sid The SID of the Transcription resource, or the `name` used when creating the resource |
| 46 | + */ |
| 47 | + public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) |
| 48 | + { |
| 49 | + parent::__construct($version); |
| 50 | + |
| 51 | + // Marshaled Properties |
| 52 | + $this->properties = [ |
| 53 | + 'sid' => Values::array_get($payload, 'sid'), |
| 54 | + 'accountSid' => Values::array_get($payload, 'account_sid'), |
| 55 | + 'callSid' => Values::array_get($payload, 'call_sid'), |
| 56 | + 'name' => Values::array_get($payload, 'name'), |
| 57 | + 'status' => Values::array_get($payload, 'status'), |
| 58 | + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), |
| 59 | + 'uri' => Values::array_get($payload, 'uri'), |
| 60 | + ]; |
| 61 | + |
| 62 | + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * Generate an instance context for the instance, the context is capable of |
| 67 | + * performing various actions. All instance actions are proxied to the context |
| 68 | + * |
| 69 | + * @return TranscriptionContext Context for this TranscriptionInstance |
| 70 | + */ |
| 71 | + protected function proxy(): TranscriptionContext |
| 72 | + { |
| 73 | + if (!$this->context) { |
| 74 | + $this->context = new TranscriptionContext( |
| 75 | + $this->version, |
| 76 | + $this->solution['accountSid'], |
| 77 | + $this->solution['callSid'], |
| 78 | + $this->solution['sid'] |
| 79 | + ); |
| 80 | + } |
| 81 | + |
| 82 | + return $this->context; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Update the TranscriptionInstance |
| 87 | + * |
| 88 | + * @param string $status |
| 89 | + * @return TranscriptionInstance Updated TranscriptionInstance |
| 90 | + * @throws TwilioException When an HTTP error occurs. |
| 91 | + */ |
| 92 | + public function update(string $status): TranscriptionInstance |
| 93 | + { |
| 94 | + |
| 95 | + return $this->proxy()->update($status); |
| 96 | + } |
| 97 | + |
| 98 | + /** |
| 99 | + * Magic getter to access properties |
| 100 | + * |
| 101 | + * @param string $name Property to access |
| 102 | + * @return mixed The requested property |
| 103 | + * @throws TwilioException For unknown properties |
| 104 | + */ |
| 105 | + public function __get(string $name) |
| 106 | + { |
| 107 | + if (\array_key_exists($name, $this->properties)) { |
| 108 | + return $this->properties[$name]; |
| 109 | + } |
| 110 | + |
| 111 | + if (\property_exists($this, '_' . $name)) { |
| 112 | + $method = 'get' . \ucfirst($name); |
| 113 | + return $this->$method(); |
| 114 | + } |
| 115 | + |
| 116 | + throw new TwilioException('Unknown property: ' . $name); |
| 117 | + } |
| 118 | + |
| 119 | + /** |
| 120 | + * Provide a friendly representation |
| 121 | + * |
| 122 | + * @return string Machine friendly representation |
| 123 | + */ |
| 124 | + public function __toString(): string |
| 125 | + { |
| 126 | + $context = []; |
| 127 | + foreach ($this->solution as $key => $value) { |
| 128 | + $context[] = "$key=$value"; |
| 129 | + } |
| 130 | + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; |
| 131 | + } |
| 132 | +} |
| 133 | + |
0 commit comments