solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Update the SyncMapPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * 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.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } }