solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .'/TestUsers'; } /** * Fetch the FlowTestUserInstance * * @return FlowTestUserInstance Fetched FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowTestUserInstance { $payload = $this->version->fetch('GET', $this->uri); return new FlowTestUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the FlowTestUserInstance * * @param string[] $testUsers List of test user identities that can test draft versions of the flow. * @return FlowTestUserInstance Updated FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $testUsers): FlowTestUserInstance { $data = Values::of([ 'TestUsers' => Serialize::map($testUsers,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowTestUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * 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.Studio.V2.FlowTestUserContext ' . \implode(' ', $context) . ']'; } }