Overview

Namespaces

  • Angelfon
    • SDK
      • Exceptions
      • Http
      • Rest
        • Api
          • V099
            • User

Classes

  • Angelfon\SDK\Domain
  • Angelfon\SDK\Http\GuzzleClient
  • Angelfon\SDK\Http\Response
  • Angelfon\SDK\InstanceContext
  • Angelfon\SDK\InstanceResource
  • Angelfon\SDK\ListResource
  • Angelfon\SDK\Options
  • Angelfon\SDK\Page
  • Angelfon\SDK\Rest\Api
  • Angelfon\SDK\Rest\Api\V099
  • Angelfon\SDK\Rest\Api\V099\User\CallContext
  • Angelfon\SDK\Rest\Api\V099\User\CallInstance
  • Angelfon\SDK\Rest\Api\V099\User\CallList
  • Angelfon\SDK\Rest\Api\V099\User\CallOptions
  • Angelfon\SDK\Rest\Api\V099\User\CallPage
  • Angelfon\SDK\Rest\Api\V099\User\CreateCallOptions
  • Angelfon\SDK\Rest\Api\V099\User\CreateSmsOptions
  • Angelfon\SDK\Rest\Api\V099\User\ReadCallOptions
  • Angelfon\SDK\Rest\Api\V099\User\ReadSmsOptions
  • Angelfon\SDK\Rest\Api\V099\User\SmsContext
  • Angelfon\SDK\Rest\Api\V099\User\SmsInstance
  • Angelfon\SDK\Rest\Api\V099\User\SmsList
  • Angelfon\SDK\Rest\Api\V099\User\SmsOptions
  • Angelfon\SDK\Rest\Api\V099\User\SmsPage
  • Angelfon\SDK\Rest\Api\V099\UserContext
  • Angelfon\SDK\Rest\Api\V099\UserInstance
  • Angelfon\SDK\Rest\Client
  • Angelfon\SDK\Serialize
  • Angelfon\SDK\Values
  • Angelfon\SDK\Version
  • Angelfon\SDK\VersionInfo

Interfaces

  • Angelfon\SDK\Http\Client

Exceptions

  • Angelfon\SDK\Exceptions\AngelfonException
  • Angelfon\SDK\Exceptions\ConfigurationException
  • Angelfon\SDK\Exceptions\RestException
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 
<?php
namespace Angelfon\SDK\Rest\Api\V099;

use Angelfon\SDK\Values;
use Angelfon\SDK\Version;
use Angelfon\SDK\Exceptions\AngelfonException;
use Angelfon\SDK\InstanceResource;

class UserInstance extends InstanceResource
{
    protected $_calls;
    /**
     * @param \Angelfon\SDK\Version $version Version that contains the resource
     * @param mixed[] $payload The response payload
     */
    function __construct(Version $version, array $payload)
    {
        parent::__construct($version);

        $this->properties = array(
      'id' => Values::array_get($payload, 'id'),
      'email' => Values::array_get($payload, 'email'),
      'name' => Values::array_get($payload, 'name'),
      'maxRecipients' => Values::array_get($payload, 'maxrcp'),
      'callerId' => Values::array_get($payload, 'callerid'),
      'timezone' => Values::array_get($payload, 'timezone'),
    );
    }

    /**
   * Generate an instance context for the instance, the context is capable of
   * performing various actions.  All instance actions are proxied to the context
   * @return \Angelfon\SDK\Rest\Api\V099\UserContext Context for this UserInstance
   */
  protected function proxy() 
  {
    if (!$this->context) {
      $this->context = new AccountContext($this->version);
    }

    return $this->context;
  }

  /**
   * Fetch a UserInstance
   * 
   * @return \Angelfon\SDK\Rest\Api\V099\UserInstance Fetched UserInstance
   */
  public function fetch() {
    return $this->proxy()->fetch();
  }

  /**
   * Update the UserInstance
   * 
   * @param array|Options $options Optional Arguments
   * @return \Angelfon\SDK\Rest\Api\V099\UserInstance Updated UserInstance
   */
  public function update($options = array()) {
    return $this->proxy()->update($options);
  }

  /**
   * Magic getter to access properties
   * 
   * @param string $name Property to access
   * @return mixed The requested property
   * @throws \Angelfon\SDK\Exceptions\AngelfonException For unknown properties
   */
  public function __get($name) {
    if (array_key_exists($name, $this->properties)) {
      return $this->properties[$name];
    }

    if (property_exists($this, '_' . $name)) {
      $method = 'get' . ucfirst($name);
      return $this->$method();
    }

    throw new AngelfonException('Unknown property: ' . $name);
  }

  /**
   * Provide a friendly representation
   * 
   * @return string Machine friendly representation
   */
  public function __toString() {
    $context = array();
    foreach ($this->solution as $key => $value) {
      $context[] = "$key=$value";
    }
    return '[Angelfon.SDK.Api.V099.UserInstance ' . implode(' ', $context) . ']';
  }

}
API documentation generated by ApiGen