solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Defaults'; } /** * Fetch the DefaultsInstance * * @return DefaultsInstance Fetched DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DefaultsInstance { $payload = $this->version->fetch('GET', $this->uri); return new DefaultsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Update the DefaultsInstance * * @param array|Options $options Optional Arguments * @return DefaultsInstance Updated DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DefaultsInstance { $options = new Values($options); $data = Values::of([ 'Defaults' => Serialize::jsonObject($options['defaults']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DefaultsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DefaultsContext ' . \implode(' ', $context) . ']'; } }