예제 #1
0
 /**
  * construct the domains as initiated
  * or new. Domains should have functions
  * to access their endpoints as well
  *
  * init forms
  * GET:
  * Domains('domain-id')
  * Domains()
  *
  * POST
  * Domains(array)
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     return parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "id", "init" => TRUE, "silent" => FALSE)), new SchemaResource(array("fields" => array('name', 'description'), "needs" => array('id', 'name'))), new SubFunctionResource());
 }
예제 #2
0
 /**
  * CTor for phone numbers 
  * use PhoneNumbers path primary,
  * availableNumbers secondary 
  *
  * Init Forms
  * GET 
  * PhoneNumbers('number-id')
  * PhoneNumbers
  *
  * POST
  * PhoneNumbers(array)
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "number", "init" => array(), "silent" => true)), new SchemaResource(array("fields" => array('id', 'application', 'number', 'nationalNumber', 'name', 'createdTime', 'city', 'state', 'price', 'numberState', 'fallbackNumber', 'patternMatch', 'lata', 'rateCenter'), "needs" => array("id", "number", "name"))));
 }
예제 #3
0
 /**
  * CTor for NumberInfo
  * Init Forms:
  *
  * GET
  * NumberInfo('cname-number') 
  *
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(array(array("term" => "phoneNumbers", "plural" => true))), new LoadsResource(array("primary" => "GET", "init" => array(), "id" => "number", "silent" => false)), new SchemaResource(array("needs" => array('name', 'number', 'created', 'updated'), "fields" => array('name', 'number'))));
 }
예제 #4
0
 /**
  * construct the endpoint as initiated
  * or a new one. endpoints take domains
  * as a dependancy so we need one on init
  *
  * init forms
  *
  * GET:
  * Endpoints('domain-id', 'endpoints-id')
  * Endpoints()
  *
  * POST: 
  * Endpoints('domain-id', array)
  * Endpoints(array)
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     return parent::_init($data, new DependsResource(array(array("term" => "domains", "plural" => TRUE))), new LoadsResource(array("parent" => false, "primary" => "create", "init" => array("domainId"), "id" => "id", "silent" => TRUE)), new SchemaResource(array("fields" => array('id', 'name', 'description', 'applicationId', 'domainId', 'sipUri', 'enabled', 'credentials'), "needs" => array('name', 'domainId', 'credentials'))));
 }
예제 #5
0
 /**
  * Bridge call CTor accept calls 
  * as main argument
  *
  * Init forms
  * GET
  * Bridge('bridge-id')
  * Bridge()
  *
  * POST
  * Bridge(array) 
  */
 public function __construct($data = null)
 {
     $data = Ensure::Input($data);
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "get", "id" => "id", "init" => "", "silent" => false)), new SchemaResource(array("fields" => array('audio', 'completedTime', 'createdTime', 'activatedTime', 'callIds'), "needs" => array("id"))), new SubFunctionResource(array(array("type" => "get", "term" => "calls"))));
 }
예제 #6
0
 /**
  * CTor for recordings
  *
  * Init Forms:
  * GET
  * Recording('recording-id')
  *
  * POST
  * Recording(array)
  */
 public function __construct($args = null)
 {
     $data = Ensure::Input($args);
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "id", "init" => "", "silent" => false)), new SchemaResource(array("fields" => array("id", "call", "endTime", "media", "startTime", "state", "page", "size"), "needs" => array("id"))), new SubFunctionResource(array(array("term" => "transcriptions", "type" => "get", "plural" => true))));
 }
예제 #7
0
 /**
  * Construct a media object
  * where data must be a blob
  * in binary. Store in memory until
  * store/1 is called
  * if data is passed use this as object
  * otherwise initialize from passed id.
  * In rare cases when media is called only to list or create
  * disregard both data and id
  *
  *
  * Init Forms:
  * GET
  * Media('media-id')
  *
  * PUT
  * Media(array)
  *
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "content", "init" => "", "silent" => true)), new SchemaResource(array("fields" => array("contentLength", "mediaName", "content"), "needs" => array("mediaName"))));
 }
예제 #8
0
 /**
  * Init forms
  * GET
  * UserError('user-error-id')
  * UserError()
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "get", "id" => "id", "init" => "", "silent" => false)), new SchemaResource(array("fields" => array('id', 'time', 'category', 'code', 'message', 'details', 'version', 'user'), "needs" => array("id"))));
 }
예제 #9
0
 /**
  * CTor for application
  *
  * Init forms:
  * GET
  * Application('application-id')
  *
  * POST
  * Application(array)
  * Application()
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "id", "silent" => false, "init" => array())), new SchemaResource(array("fields" => array('id', 'name', 'incomingCallUrl', 'incomingCallUrlCallbackTimeout', 'incomingCallFallbackUrl', 'incomingSmsUrl', 'incomingSmsUrlCallbackTimeout', 'incomingSmsFallbackUrl', 'callbackHttpMethod', 'autoAnswer'), "needs" => array("id", "name"))));
 }
예제 #10
0
 /**
  * CTor to message object
  * inherit base provide all implementation here.
  * 
  * Init form:
  * GET
  * Message('message-id')
  * Message()
  *
  * POST
  * Message(array)
  *
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "id", "init" => "", "silent" => false)), new SchemaResource(array("fields" => array('id', 'direction', 'callbackUrl', 'callbackTimeout', 'fallbackUrl', 'from', 'to', 'state', 'time', 'text', 'errorMessage', 'tag', 'media', 'receiptRequested'), "needs" => array("id", "from", "to", "state"))), new SubFunctionResource());
 }
예제 #11
0
 /**
  * 
  * CallEvents do not directly provide 
  * GET or POST functions they can be accessed
  * by calls only.
  *
  * Init Forms:
  *
  * GET:
  * CallEvents()
  * CallEvents('event-id')
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(array(array("term" => "calls", "plural" => false))), new LoadsResource(array("silent" => false, "primary" => "GET", "id" => "id", "init" => array("callId"))), new SchemaResource(array("fields" => array("id", "time", "name"), "needs" => "id")));
 }
예제 #12
0
 /**
  * CTor for gather resource. 
  * Init Forms
  *
  * GET
  * Gather('call-id')
  * Gather('call-id', 'gather-id')
  *
  * POST
  * Gather('call-id', array)
  * Gather(array) 
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(array(array("term" => "calls", "plural" => true))), new LoadsResource(array("parent" => false, "primary" => "create", "id" => "id", "init" => array("callId"), "silent" => true)), new SchemaResource(array("fields" => array("maxDigits", "interDigitTimeout", "terinatingDigits", "tag", "prompt.sentance", "prompt.gender", "prompt.fileUrl", "prompt.loopEnabled", "prompt.bargeable"), "needs" => array("id"))));
 }
예제 #13
0
 /**
  * transcriptions need a valid
  * recording. Without fail, this
  * while not checked for authenticity
  * should be in the from r-xxx
  * 
  * Init Forms:
  * 
  * GET
  * Transcription('recording-id', 'transcription-id')
  * Transcription('recording-id')
  * Transcription()
  * 
  * POST
  * Transcription('recording-id', array)
  * Transcription(array)
  */
 public function __construct()
 {
     $data = Ensure::Input(func_get_args());
     parent::_init($data, new DependsResource(array(array("term" => "recordings", "plural" => true))), new LoadsResource(array("primary" => "GET", "id" => "id", "init" => array("recordingId"), "silent" => true, "params")), new SchemaResource(array("fields" => array('transcriptionUri', 'textSize', 'text', 'status', 'textUrl', 'recordingId', 'state', 'eventType', 'transcriptionId'), "needs" => array("id"))));
 }
예제 #14
0
 /**
  *
  * Init forms:
  *
  * GET 
  * Account()
  *
  */
 public function __construct($data = null)
 {
     $data = Ensure::Input($data);
     parent::_init($data, new DependsResource(), new LoadsResource(array("primary" => "GET", "id" => "id", "init" => "", "silent" => false)), new SchemaResource(array("fields" => array("balance", "accountType"), "needs" => array("balance", "accountType")), new SubFunctionResource(array("term" => "transactions", "type" => "get"))));
 }