solution = array('fleetSid' => $fleetSid, 'sid' => $sid, ); $this->uri = '/Fleets/' . rawurlencode($fleetSid) . '/Devices/' . rawurlencode($sid) . ''; } /** * Fetch a DeviceInstance * * @return DeviceInstance Fetched DeviceInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Deletes the DeviceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceContext ' . implode(' ', $context) . ']'; } }