PageRenderTime 22ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php

http://github.com/twilio/twilio-php
PHP | 195 lines | 88 code | 15 blank | 92 comment | 3 complexity | 7742cc927c964cfc5e8f642ce1d1706e MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\Rest\FlexApi\V1;
  9. use Twilio\Deserialize;
  10. use Twilio\Exceptions\TwilioException;
  11. use Twilio\InstanceResource;
  12. use Twilio\Options;
  13. use Twilio\Values;
  14. use Twilio\Version;
  15. /**
  16. * @property string $accountSid
  17. * @property \DateTime $dateCreated
  18. * @property \DateTime $dateUpdated
  19. * @property array $attributes
  20. * @property string $status
  21. * @property string $taskrouterWorkspaceSid
  22. * @property string $taskrouterTargetWorkflowSid
  23. * @property string $taskrouterTargetTaskqueueSid
  24. * @property array[] $taskrouterTaskqueues
  25. * @property array[] $taskrouterSkills
  26. * @property array $taskrouterWorkerChannels
  27. * @property array $taskrouterWorkerAttributes
  28. * @property string $taskrouterOfflineActivitySid
  29. * @property string $runtimeDomain
  30. * @property string $messagingServiceInstanceSid
  31. * @property string $chatServiceInstanceSid
  32. * @property string $flexServiceInstanceSid
  33. * @property string $uiLanguage
  34. * @property array $uiAttributes
  35. * @property array $uiDependencies
  36. * @property string $uiVersion
  37. * @property string $serviceVersion
  38. * @property bool $callRecordingEnabled
  39. * @property string $callRecordingWebhookUrl
  40. * @property bool $crmEnabled
  41. * @property string $crmType
  42. * @property string $crmCallbackUrl
  43. * @property string $crmFallbackUrl
  44. * @property array $crmAttributes
  45. * @property array $publicAttributes
  46. * @property bool $pluginServiceEnabled
  47. * @property array $pluginServiceAttributes
  48. * @property array[] $integrations
  49. * @property array $outboundCallFlows
  50. * @property string[] $serverlessServiceSids
  51. * @property array $queueStatsConfiguration
  52. * @property array $notifications
  53. * @property array $markdown
  54. * @property string $url
  55. * @property array $flexInsightsHr
  56. */
  57. class ConfigurationInstance extends InstanceResource {
  58. /**
  59. * Initialize the ConfigurationInstance
  60. *
  61. * @param Version $version Version that contains the resource
  62. * @param mixed[] $payload The response payload
  63. */
  64. public function __construct(Version $version, array $payload) {
  65. parent::__construct($version);
  66. // Marshaled Properties
  67. $this->properties = [
  68. 'accountSid' => Values::array_get($payload, 'account_sid'),
  69. 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
  70. 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
  71. 'attributes' => Values::array_get($payload, 'attributes'),
  72. 'status' => Values::array_get($payload, 'status'),
  73. 'taskrouterWorkspaceSid' => Values::array_get($payload, 'taskrouter_workspace_sid'),
  74. 'taskrouterTargetWorkflowSid' => Values::array_get($payload, 'taskrouter_target_workflow_sid'),
  75. 'taskrouterTargetTaskqueueSid' => Values::array_get($payload, 'taskrouter_target_taskqueue_sid'),
  76. 'taskrouterTaskqueues' => Values::array_get($payload, 'taskrouter_taskqueues'),
  77. 'taskrouterSkills' => Values::array_get($payload, 'taskrouter_skills'),
  78. 'taskrouterWorkerChannels' => Values::array_get($payload, 'taskrouter_worker_channels'),
  79. 'taskrouterWorkerAttributes' => Values::array_get($payload, 'taskrouter_worker_attributes'),
  80. 'taskrouterOfflineActivitySid' => Values::array_get($payload, 'taskrouter_offline_activity_sid'),
  81. 'runtimeDomain' => Values::array_get($payload, 'runtime_domain'),
  82. 'messagingServiceInstanceSid' => Values::array_get($payload, 'messaging_service_instance_sid'),
  83. 'chatServiceInstanceSid' => Values::array_get($payload, 'chat_service_instance_sid'),
  84. 'flexServiceInstanceSid' => Values::array_get($payload, 'flex_service_instance_sid'),
  85. 'uiLanguage' => Values::array_get($payload, 'ui_language'),
  86. 'uiAttributes' => Values::array_get($payload, 'ui_attributes'),
  87. 'uiDependencies' => Values::array_get($payload, 'ui_dependencies'),
  88. 'uiVersion' => Values::array_get($payload, 'ui_version'),
  89. 'serviceVersion' => Values::array_get($payload, 'service_version'),
  90. 'callRecordingEnabled' => Values::array_get($payload, 'call_recording_enabled'),
  91. 'callRecordingWebhookUrl' => Values::array_get($payload, 'call_recording_webhook_url'),
  92. 'crmEnabled' => Values::array_get($payload, 'crm_enabled'),
  93. 'crmType' => Values::array_get($payload, 'crm_type'),
  94. 'crmCallbackUrl' => Values::array_get($payload, 'crm_callback_url'),
  95. 'crmFallbackUrl' => Values::array_get($payload, 'crm_fallback_url'),
  96. 'crmAttributes' => Values::array_get($payload, 'crm_attributes'),
  97. 'publicAttributes' => Values::array_get($payload, 'public_attributes'),
  98. 'pluginServiceEnabled' => Values::array_get($payload, 'plugin_service_enabled'),
  99. 'pluginServiceAttributes' => Values::array_get($payload, 'plugin_service_attributes'),
  100. 'integrations' => Values::array_get($payload, 'integrations'),
  101. 'outboundCallFlows' => Values::array_get($payload, 'outbound_call_flows'),
  102. 'serverlessServiceSids' => Values::array_get($payload, 'serverless_service_sids'),
  103. 'queueStatsConfiguration' => Values::array_get($payload, 'queue_stats_configuration'),
  104. 'notifications' => Values::array_get($payload, 'notifications'),
  105. 'markdown' => Values::array_get($payload, 'markdown'),
  106. 'url' => Values::array_get($payload, 'url'),
  107. 'flexInsightsHr' => Values::array_get($payload, 'flex_insights_hr'),
  108. ];
  109. $this->solution = [];
  110. }
  111. /**
  112. * Generate an instance context for the instance, the context is capable of
  113. * performing various actions. All instance actions are proxied to the context
  114. *
  115. * @return ConfigurationContext Context for this ConfigurationInstance
  116. */
  117. protected function proxy(): ConfigurationContext {
  118. if (!$this->context) {
  119. $this->context = new ConfigurationContext($this->version);
  120. }
  121. return $this->context;
  122. }
  123. /**
  124. * Fetch the ConfigurationInstance
  125. *
  126. * @param array|Options $options Optional Arguments
  127. * @return ConfigurationInstance Fetched ConfigurationInstance
  128. * @throws TwilioException When an HTTP error occurs.
  129. */
  130. public function fetch(array $options = []): ConfigurationInstance {
  131. return $this->proxy()->fetch($options);
  132. }
  133. /**
  134. * Create the ConfigurationInstance
  135. *
  136. * @return ConfigurationInstance Created ConfigurationInstance
  137. * @throws TwilioException When an HTTP error occurs.
  138. */
  139. public function create(): ConfigurationInstance {
  140. return $this->proxy()->create();
  141. }
  142. /**
  143. * Update the ConfigurationInstance
  144. *
  145. * @return ConfigurationInstance Updated ConfigurationInstance
  146. * @throws TwilioException When an HTTP error occurs.
  147. */
  148. public function update(): ConfigurationInstance {
  149. return $this->proxy()->update();
  150. }
  151. /**
  152. * Magic getter to access properties
  153. *
  154. * @param string $name Property to access
  155. * @return mixed The requested property
  156. * @throws TwilioException For unknown properties
  157. */
  158. public function __get(string $name) {
  159. if (\array_key_exists($name, $this->properties)) {
  160. return $this->properties[$name];
  161. }
  162. if (\property_exists($this, '_' . $name)) {
  163. $method = 'get' . \ucfirst($name);
  164. return $this->$method();
  165. }
  166. throw new TwilioException('Unknown property: ' . $name);
  167. }
  168. /**
  169. * Provide a friendly representation
  170. *
  171. * @return string Machine friendly representation
  172. */
  173. public function __toString(): string {
  174. $context = [];
  175. foreach ($this->solution as $key => $value) {
  176. $context[] = "$key=$value";
  177. }
  178. return '[Twilio.FlexApi.V1.ConfigurationInstance ' . \implode(' ', $context) . ']';
  179. }
  180. }