예제 #1
0
 /**
  * Builds the selection criteria from request and returns it.
  *
  * @return array
  */
 protected function getSelectionCriteria()
 {
     /** @type TableSchema $schema */
     $schema = $this->getModel()->getTableSchema();
     $criteria = ['params' => []];
     if (null !== ($value = $this->request->getParameter(ApiOptions::FIELDS))) {
         $criteria['select'] = explode(',', $value);
     } else {
         $criteria['select'] = ['*'];
     }
     if (null !== ($value = $this->request->getPayloadData(ApiOptions::PARAMS))) {
         $criteria['params'] = $value;
     }
     if (null !== ($value = $this->request->getParameter(ApiOptions::FILTER))) {
         $native = $this->convertFilterToNative($value, $criteria['params'], [], $schema->columns);
         $criteria['condition'] = $native['where'];
         if (is_array($native['params'])) {
             if (is_array($criteria['params'])) {
                 $criteria['params'] = array_merge($criteria['params'], $native['params']);
             } else {
                 $criteria['params'] = $native['params'];
             }
         }
         //	Add current user ID into parameter array if in condition, but not specified.
         if (false !== stripos($value, ':user_id')) {
             if (!isset($criteria['params'][':user_id'])) {
                 $criteria['params'][':user_id'] = SessionUtility::getCurrentUserId();
             }
         }
     }
     $value = intval($this->request->getParameter(ApiOptions::LIMIT));
     $maxAllowed = $this->getMaxRecordsReturnedLimit();
     if ($value < 1 || $value > $maxAllowed) {
         // impose a limit to protect server
         $value = $maxAllowed;
     }
     $criteria['limit'] = $value;
     // merge in possible payload options
     $optionNames = [ApiOptions::OFFSET, ApiOptions::ORDER, ApiOptions::GROUP];
     foreach ($optionNames as $option) {
         if (null !== ($value = $this->request->getParameter($option))) {
             $criteria[$option] = $value;
         } elseif (!empty($otherNames = ApiOptions::getAliases($option))) {
             foreach ($otherNames as $other) {
                 if (null !== ($value = $this->request->getParameter($other))) {
                     $criteria[$option] = $value;
                 } elseif (null !== ($value = $this->request->getPayloadData($other))) {
                     $criteria[$option] = $value;
                 }
             }
         }
         if (!isset($criteria[$option]) && null !== ($value = $this->request->getPayloadData($option))) {
             $criteria[$option] = $value;
         }
     }
     return $criteria;
 }
예제 #2
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $name = Inflector::camelize($this->name);
     $plural = Inflector::pluralize($name);
     $words = str_replace('_', ' ', $this->name);
     $pluralWords = Inflector::pluralize($words);
     $wrapper = ResourcesWrapper::getWrapper();
     $apis = [['path' => $path, 'description' => "Operations for {$words} administration.", 'operations' => [['method' => 'GET', 'summary' => 'get' . $plural . '() - Retrieve one or more ' . $pluralWords . '.', 'nickname' => 'get' . $plural, 'type' => $plural . 'Response', 'event_name' => [$eventPath . '.list'], 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [ApiOptions::documentOption(ApiOptions::FIELDS)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'List Active Directory ' . strtolower($pluralWords)]]], ['path' => $path . '/{' . strtolower($name) . '_name}', 'operations' => [['method' => 'GET', 'summary' => 'get' . $name . '() - Retrieve one ' . $words . '.', 'nickname' => 'get' . $name, 'type' => $name . 'Response', 'event_name' => $eventPath . '.read', 'parameters' => [['name' => strtolower($name) . '_name', 'description' => 'Identifier of the record to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Use the \'fields\' parameter to limit properties that are returned. By default, all fields are returned.']], 'description' => "Operations for individual {$words} administration."]];
     $models = [$plural . 'Response' => ['id' => $plural . 'Response', 'properties' => [$wrapper => ['type' => 'array', 'description' => 'Array of records.', 'items' => ['$ref' => $name . 'Response']]]], $name . 'Response' => ['id' => $name . 'Response', 'properties' => ['objectclass' => ['type' => 'array', 'description' => 'This property identifies the class of which the object is an instance, as well as all structural or abstract superclasses from which that class is derived.'], 'cn' => ['type' => 'string', 'description' => 'Common name of the object'], 'dn' => ['type' => 'string', 'description' => 'Distinguished name of the object'], 'distinguishedname' => ['type' => 'string', 'description' => 'Distinguished name of the object'], 'whencreated' => ['type' => 'string', 'description' => 'Date/Time when object was created'], 'whenchanged' => ['type' => 'string', 'description' => 'Date/Time when object was changed'], 'objectcategory' => ['type' => 'string', 'description' => 'Shows objectCagetory attribute.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
예제 #3
0
파일: Event.php 프로젝트: pkdevboxy/df-core
 public function getApiDocInfo()
 {
     //        $alwaysWrap = \Config::get('df.always_wrap_resources', false);
     $wrapper = ResourcesWrapper::getWrapper();
     $apis = [['path' => '/' . $this->name, 'operations' => [['method' => 'GET', 'summary' => 'getEventSubscribers() - Retrieve one or more subscribers.', 'nickname' => 'getEventSubscribers', 'type' => 'SubscribersResponse', 'event_name' => $this->name . '.subscriber.list', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::LIMIT), ApiOptions::documentOption(ApiOptions::ORDER), ApiOptions::documentOption(ApiOptions::GROUP), ApiOptions::documentOption(ApiOptions::OFFSET), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ApiOptions::documentOption(ApiOptions::INCLUDE_COUNT), ApiOptions::documentOption(ApiOptions::INCLUDE_SCHEMA), ApiOptions::documentOption(ApiOptions::FILE)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Use the \'ids\' or \'filter\' parameter to limit records that are returned. ' . 'By default, all records up to the maximum are returned. <br>' . 'Use the \'fields\' and \'related\' parameters to limit properties returned for each record. ' . 'By default, all fields and no relations are returned for each record. <br>' . 'Alternatively, to retrieve by record, a large list of ids, or a complicated filter, ' . 'use the POST request with X-HTTP-METHOD = GET header and post records or ids.'], ['method' => 'POST', 'summary' => 'createEventSubscribers() - Create one or more subscribers.', 'nickname' => 'createEventSubscribers', 'type' => 'SubscribersResponse', 'event_name' => $this->name . '.subscriber.create', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs of records to create.', 'allowMultiple' => false, 'type' => 'UsersRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ['name' => 'X-HTTP-METHOD', 'description' => 'Override request using POST to tunnel other http request, such as DELETE.', 'enum' => ['GET', 'PUT', 'PATCH', 'DELETE'], 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'header', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be a single record or an array of records (shown). ' . 'By default, only the id property of the record affected is returned on success, ' . 'use \'fields\' and \'related\' to return more info.'], ['method' => 'PATCH', 'summary' => 'updateEventSubscribers() - Update one or more subscribers.', 'nickname' => 'updateEventSubscribers', 'type' => 'SubscribersResponse', 'event_name' => $this->name . '.subscriber.update', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'UsersRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be a single record or an array of records (shown). ' . 'By default, only the id property of the record is returned on success, ' . 'use \'fields\' and \'related\' to return more info.'], ['method' => 'DELETE', 'summary' => 'deleteEventSubscribers() - Delete one or more subscribers.', 'nickname' => 'deleteEventSubscribers', 'type' => 'SubscribersResponse', 'event_name' => $this->name . '.subscriber.delete', 'parameters' => [ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::FORCE), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'By default, only the id property of the record deleted is returned on success. ' . 'Use \'fields\' and \'related\' to return more properties of the deleted records. <br>' . 'Alternatively, to delete by record or a large list of ids, ' . 'use the POST request with X-HTTP-METHOD = DELETE header and post records or ids.']], 'description' => 'Operations for user administration.'], ['path' => '/' . $this->name . '/{id}', 'operations' => [['method' => 'GET', 'summary' => 'getEventSubscriber() - Retrieve one subscriber.', 'nickname' => 'getEventSubscriber', 'type' => 'Subscriber', 'event_name' => $this->name . '.subscriber.read', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Use the \'fields\' and/or \'related\' parameter to limit properties that are returned. By default, all fields and no relations are returned.'], ['method' => 'PATCH', 'summary' => 'updateEventSubscriber() - Update one subscriber.', 'nickname' => 'updateEventSubscriber', 'type' => 'Subscriber', 'event_name' => $this->name . '.subscriber.update', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of fields to update.', 'allowMultiple' => false, 'type' => 'UserRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of fields to update for a single record. <br>' . 'By default, only the id is returned. Use the \'fields\' and/or \'related\' parameter to return more properties.'], ['method' => 'DELETE', 'summary' => 'deleteEventSubscriber() - Delete one subscriber.', 'nickname' => 'deleteEventSubscriber', 'type' => 'Subscriber', 'event_name' => $this->name . '.subscriber.delete', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to delete.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'By default, only the id is returned. Use the \'fields\' and/or \'related\' parameter to return deleted properties.']], 'description' => 'Operations for individual user administration.']];
     $models = ['SubscribersRequest' => ['id' => 'SubscribersRequest', 'properties' => [$wrapper => ['type' => 'array', 'description' => 'Array of system records.', 'items' => ['$ref' => 'Subscriber']], ApiOptions::IDS => ['type' => 'array', 'description' => 'Array of system record identifiers, used for batch GET, PUT, PATCH, and DELETE.', 'items' => ['type' => 'integer', 'format' => 'int32']]]], 'SubscribersResponse' => ['id' => 'SubscribersResponse', 'properties' => [$wrapper => ['type' => 'array', 'description' => 'Array of system records.', 'items' => ['$ref' => 'Subscriber']], 'meta' => ['type' => 'Metadata', 'description' => 'Array of metadata returned for GET requests.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
예제 #4
0
파일: Event.php 프로젝트: pkdevboxy/df-core
 /**
  * @return array
  */
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $name = Inflector::camelize($this->name);
     // use the cached copy, don't try to create it here, infinite loop!
     $results = \Cache::get(static::EVENT_CACHE_KEY, []);
     $allEvents = [];
     foreach ($results as $services) {
         foreach ($services as $apis) {
             foreach ($apis as $operations) {
                 foreach ($operations['verb'] as $events) {
                     foreach ($events as $event) {
                         $allEvents[] = $event;
                     }
                 }
             }
         }
     }
     $apis = [['path' => $path, 'operations' => [['method' => 'GET', 'summary' => 'getEventList() - Retrieve list of events.', 'nickname' => 'getEventList', 'notes' => 'A list of event names are returned.<br>' . 'The list can be limited by service and/or by type.', 'type' => 'ResourceList', 'event_name' => $eventPath . '.list', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [ApiOptions::documentOption(ApiOptions::AS_LIST, true, true), ['name' => 'service', 'description' => 'Get the events for only this service.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'type', 'description' => 'Get the events for only this type - process or broadcast.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false, 'enum' => ['process', 'broadcast']], ['name' => 'only_scripted', 'description' => 'Get only the events that have associated scripts.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'default' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'getEventMap() - Retrieve full map of events.', 'nickname' => 'getEventMap', 'notes' => 'This returns a service to verb to event mapping.<br>' . 'The list can be limited by service and/or by type.', 'type' => 'EventMap', 'event_name' => $eventPath . '.list', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'service', 'description' => 'Get the events for only this service.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'type', 'description' => 'Get the events for only this type - process or broadcast.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false, 'enum' => ['process', 'broadcast']], ['name' => 'only_scripted', 'description' => 'Get only the events that have associated scripts.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'default' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]], 'description' => 'Operations for retrieving events.'], ['path' => $path . '/{event_name}', 'operations' => [['method' => 'GET', 'summary' => 'getEventScript() - Retrieve the script for an event.', 'nickname' => 'getEventScript', 'notes' => 'Use the \'fields\' and \'related\' parameters to limit properties returned for each record. ' . 'By default, all fields and no relations are returned for each record.', 'type' => 'EventScriptResponse', 'event_name' => $eventPath . '.{event_name}.read', 'parameters' => [['name' => 'event_name', 'description' => 'Identifier of the event to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $allEvents], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ApiOptions::documentOption(ApiOptions::INCLUDE_SCHEMA), ApiOptions::documentOption(ApiOptions::FILE)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'createEventScript() - Create a script for an event.', 'nickname' => 'createEventScript', 'notes' => 'Post data should be a single record containing required fields for a script. ' . 'By default, only the event name of the record affected is returned on success, ' . 'use \'fields\' and \'related\' to return more info.', 'type' => 'EventScriptResponse', 'event_name' => $eventPath . '.{event_name}.create', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'event_name', 'description' => 'Identifier of the event to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $allEvents], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to create.', 'allowMultiple' => false, 'type' => 'EventScriptRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'DELETE', 'summary' => 'delete' . $name . 'EventScript() - Delete an event scripts.', 'nickname' => 'delete' . $name . 'EventScript', 'notes' => 'By default, only the event name of the record deleted is returned on success. ' . 'Use \'fields\' and \'related\' to return more properties of the deleted record.', 'type' => 'EventScriptResponse', 'event_name' => $eventPath . '.{event_name}.delete', 'parameters' => [['name' => 'event_name', 'description' => 'Identifier of the event to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $allEvents], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]], 'description' => 'Operations for scripts on individual events.']];
     $models = [];
     $model = new EventScript();
     $temp = $model->toApiDocsModel('EventScript');
     if ($temp) {
         $models = array_merge($models, $temp);
     }
     return ['apis' => $apis, 'models' => $models];
 }
예제 #5
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->name;
     $eventPath = $this->name;
     $name = Inflector::camelize($this->name);
     $plural = Inflector::pluralize($name);
     return ['resourcePath' => $path, 'produces' => ['application/json', 'application/xml'], 'consumes' => ['application/json', 'application/xml'], 'apis' => [['path' => $path, 'description' => "Operations available for the {$this->label} service.", 'operations' => [['method' => 'GET', 'summary' => 'getResourceList() - List all resource names.', 'nickname' => 'getResourceList', 'notes' => 'Return only a list of the resource identifiers.', 'type' => 'ResourceList', 'event_name' => [$eventPath . '.list'], 'parameters' => [ApiOptions::documentOption(ApiOptions::AS_LIST, true, true), ApiOptions::documentOption(ApiOptions::AS_ACCESS_LIST), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::REFRESH)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'getResources() - List all resources.', 'nickname' => 'getResources', 'notes' => 'List the resources available on this service. ', 'type' => $plural . 'Response', 'event_name' => [$eventPath . '.list'], 'parameters' => [ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::REFRESH)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]]], 'models' => $this->getApiDocModels()];
 }
예제 #6
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->name;
     $eventPath = $this->name;
     $commonResponses = ApiDocUtilities::getCommonResponses();
     $base = parent::getApiDocInfo();
     $base['apis'] = [['path' => $path, 'description' => 'Operations available for File Storage Service.', 'operations' => [['method' => 'GET', 'summary' => 'getResourceList() - List all resource names.', 'nickname' => 'getResourceList', 'notes' => 'Return only a list of the resource identifiers.', 'type' => 'ResourceList', 'event_name' => [$this->name . '.list'], 'parameters' => [ApiOptions::documentOption(ApiOptions::AS_LIST, true, true), ApiOptions::documentOption(ApiOptions::AS_ACCESS_LIST), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::REFRESH)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'getResources() - List all resources.', 'nickname' => 'getResources', 'type' => 'ResourceList', 'event_name' => [$eventPath . '.list'], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'List the resources (folders and files) available in this storage. ', 'parameters' => [['name' => 'include_folders', 'description' => 'Include folders in the returned listing.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => true], ['name' => 'include_files', 'description' => 'Include files in the returned listing.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => true], ['name' => 'full_tree', 'description' => 'List the contents of all sub-folders as well.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'zip', 'description' => 'Return the content of the path as a zip file.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false]]]]], ['path' => $path . '/{folder_path}/', 'operations' => [['method' => 'GET', 'summary' => 'getFolder() - List the folder\'s content, including properties.', 'nickname' => 'getFolder', 'type' => 'FolderResponse', 'event_name' => [$eventPath . '.{folder_path}.describe'], 'parameters' => [['name' => 'folder_path', 'description' => 'The path of the folder you want to retrieve. This can be a sub-folder, with each level separated by a \'/\'', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'include_properties', 'description' => 'Return any properties of the folder in the response.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'include_folders', 'description' => 'Include folders in the returned listing.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => true], ['name' => 'include_files', 'description' => 'Include files in the returned listing.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => true], ['name' => 'full_tree', 'description' => 'List the contents of all sub-folders as well.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'zip', 'description' => 'Return the content of the folder as a zip file.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Use \'include_properties\' to get properties of the folder. ' . 'Use the \'include_folders\' and/or \'include_files\' to modify the listing.'], ['method' => 'GET', 'summary' => 'getFolderProperties() - List the folder\'s properties.', 'nickname' => 'getFolderProperties', 'type' => 'Folder', 'event_name' => [$eventPath . '.{folder_path}.describe'], 'parameters' => [['name' => 'folder_path', 'description' => 'The path of the folder you want to retrieve. This can be a sub-folder, with each level separated by a \'/\'', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'include_properties', 'description' => 'Return any properties of the folder in the response.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'defaultValue' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Use \'include_properties\' to get properties of the folder.'], ['method' => 'POST', 'summary' => 'createFolder() - Create a folder and/or add content.', 'nickname' => 'createFolder', 'type' => 'FolderResponse', 'event_name' => [$eventPath . '.{folder_path}.create', $eventPath . '.folder_created'], 'parameters' => [['name' => 'folder_path', 'description' => 'The path of the folder where you want to put the contents. This can be a sub-folder, with each level separated by a \'/\'', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of folders and/or files.', 'allowMultiple' => false, 'type' => 'FolderRequest', 'paramType' => 'body', 'required' => false], ['name' => 'url', 'description' => 'The full URL of the file to upload.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'extract', 'description' => 'Extract an uploaded zip file into the folder.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'clean', 'description' => 'Option when \'extract\' is true, clean the current folder before extracting files and folders.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'check_exist', 'description' => 'If true, the request fails when the file or folder to create already exists.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'X-HTTP-METHOD', 'description' => 'Override request using POST to tunnel other http request, such as DELETE.', 'enum' => ['GET', 'PUT', 'PATCH', 'DELETE'], 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'header', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Post data as an array of folders and/or files. Folders are created if they do not exist'], ['method' => 'PATCH', 'summary' => 'updateFolderProperties() - Update folder properties.', 'nickname' => 'updateFolderProperties', 'type' => 'Folder', 'event_name' => [$eventPath . '.{folder_path}.update', $eventPath . '.folder_updated'], 'parameters' => [['name' => 'folder_path', 'description' => 'The path of the folder you want to update. This can be a sub-folder, with each level separated by a \'/\'', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of folder properties.', 'allowMultiple' => false, 'type' => 'Folder', 'paramType' => 'body', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Post body as an array of folder properties.'], ['method' => 'DELETE', 'summary' => 'deleteFolder() - Delete one folder and/or its contents.', 'nickname' => 'deleteFolder', 'type' => 'FolderResponse', 'event_name' => [$eventPath . '.{folder_path}.delete', $eventPath . '.folder_deleted'], 'parameters' => [['name' => 'folder_path', 'description' => 'The path of the folder where you want to delete contents. This can be a sub-folder, with each level separated by a \'/\'', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'force', 'description' => 'Set to true to force delete on a non-empty folder.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'content_only', 'description' => 'Set to true to only delete the content of the folder.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Set \'content_only\' to true to delete the sub-folders and files contained, but not the folder. ' . 'Set \'force\' to true to delete a non-empty folder. ' . 'Alternatively, to delete by a listing of sub-folders and files, ' . 'use the POST request with X-HTTP-METHOD = DELETE header and post listing.']], 'description' => 'Operations on folders.'], ['path' => $path . '/{file_path}', 'operations' => [['method' => 'GET', 'summary' => 'getFile() - Download the file contents and/or its properties.', 'nickname' => 'getFile', 'type' => 'FileResponse', 'event_name' => [$eventPath . '.{file_path}.download', $eventPath . '.file_downloaded'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'download', 'description' => 'Prompt the user to download the file from the browser.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false]], 'responseMessages' => $commonResponses, 'notes' => 'By default, the file is streamed to the browser. ' . 'Use the \'download\' parameter to prompt for download.'], ['method' => 'GET', 'summary' => 'getFileProperties() - Download the file properties.', 'nickname' => 'getFileProperties', 'type' => 'File', 'event_name' => [$eventPath . '.{file_path}.describe', $eventPath . '.file_described'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'include_properties', 'description' => 'Return properties of the file.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false], ['name' => 'content', 'description' => 'Return the content as base64 of the file, only applies when \'include_properties\' is true.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'defaultValue' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Use the \'include_properties\' parameter (optionally add \'content\' to include base64 content) to list properties of the file.'], ['method' => 'POST', 'summary' => 'createFile() - Create a new file.', 'nickname' => 'createFile', 'type' => 'FileResponse', 'event_name' => [$eventPath . '.{file_path}.create', $eventPath . '.file_created'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to create.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'check_exist', 'description' => 'If true, the request fails when the file to create already exists.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'body', 'description' => 'Content and/or properties of the file.', 'allowMultiple' => false, 'type' => 'FileRequest', 'paramType' => 'body', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Post body should be the contents of the file or an object with file properties.'], ['method' => 'PUT', 'summary' => 'replaceFile() - Update content of the file.', 'nickname' => 'replaceFile', 'type' => 'FileResponse', 'event_name' => [$eventPath . '.{file_path}.update', $eventPath . '.file_updated'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'The content of the file.', 'allowMultiple' => false, 'type' => 'FileRequest', 'paramType' => 'body', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Post body should be the contents of the file.'], ['method' => 'PATCH', 'summary' => 'updateFileProperties() - Update properties of the file.', 'nickname' => 'updateFileProperties', 'type' => 'File', 'event_name' => [$eventPath . '.{file_path}.update', $eventPath . '.file_updated'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Properties of the file.', 'allowMultiple' => false, 'type' => 'File', 'paramType' => 'body', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'Post body should be an array of file properties.'], ['method' => 'DELETE', 'summary' => 'deleteFile() - Delete one file.', 'nickname' => 'deleteFile', 'type' => 'FileResponse', 'event_name' => [$eventPath . '.{file_path}.delete', $eventPath . '.file_deleted'], 'parameters' => [['name' => 'file_path', 'description' => 'Path and name of the file to delete.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Careful, this removes the given file from the storage.']], 'description' => 'Operations on individual files.']];
     $commonFolder = ['name' => ['type' => 'string', 'description' => 'Identifier/Name for the folder, localized to requested resource.'], 'path' => ['type' => 'string', 'description' => 'Full path of the folder, from the service root.'], 'metadata' => ['type' => 'array', 'description' => 'An array of name-value pairs.', 'items' => ['type' => 'string']]];
     $commonFile = ['name' => ['type' => 'string', 'description' => 'Identifier/Name for the file, localized to requested resource.'], 'path' => ['type' => 'string', 'description' => 'Full path of the file, from the service root.'], 'content_type' => ['type' => 'string', 'description' => 'The media type of the content of the file.'], 'metadata' => ['type' => 'array', 'description' => 'An array of name-value pairs.', 'items' => ['type' => 'string']]];
     $models = ['FileRequest' => ['id' => 'FileRequest', 'properties' => $commonFile], 'FileResponse' => ['id' => 'FileResponse', 'properties' => array_merge($commonFile, ['content_length' => ['type' => 'string', 'description' => 'Size of the file in bytes.'], 'last_modified' => ['type' => 'string', 'description' => 'A GMT date timestamp of when the file was last modified.']])], 'FolderRequest' => ['id' => 'FolderRequest', 'properties' => array_merge($commonFolder, ['resource' => ['type' => 'array', 'description' => 'An array of resources to operate on.', 'items' => ['$ref' => 'ResourceRequest']]])], 'FolderResponse' => ['id' => 'FolderResponse', 'properties' => array_merge($commonFolder, ['last_modified' => ['type' => 'string', 'description' => 'A GMT date timestamp of when the file was last modified.'], 'resources' => ['type' => 'array', 'description' => 'An array of contained resources.', 'items' => ['$ref' => 'FolderResponse']]])], 'File' => ['id' => 'File', 'properties' => $commonFile], 'Folder' => ['id' => 'Folder', 'properties' => $commonFolder]];
     $base['models'] = array_merge($base['models'], $models);
     return $base;
 }
예제 #7
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $name = Inflector::camelize($this->name);
     $plural = Inflector::pluralize($name);
     $words = str_replace('_', ' ', $this->name);
     $pluralWords = Inflector::pluralize($words);
     $wrapper = ResourcesWrapper::getWrapper();
     $apis = [['path' => $path, 'description' => "Operations for {$words} administration.", 'operations' => [['method' => 'GET', 'summary' => 'get' . $plural . '() - Retrieve one or more ' . $pluralWords . '.', 'nickname' => 'get' . $plural, 'type' => $plural . 'Response', 'event_name' => [$eventPath . '.list'], 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::LIMIT), ApiOptions::documentOption(ApiOptions::ORDER), ApiOptions::documentOption(ApiOptions::GROUP), ApiOptions::documentOption(ApiOptions::OFFSET), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ApiOptions::documentOption(ApiOptions::INCLUDE_COUNT), ApiOptions::documentOption(ApiOptions::INCLUDE_SCHEMA), ApiOptions::documentOption(ApiOptions::FILE)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Use the \'ids\' or \'filter\' parameter to limit records that are returned. ' . 'By default, all records up to the maximum are returned. <br>' . 'Use the \'fields\' and \'related\' parameters to limit properties returned for each record. ' . 'By default, all fields and no relations are returned for each record. <br>' . 'Alternatively, to retrieve by record, a large list of ids, or a complicated filter, ' . 'use the POST request with X-HTTP-METHOD = GET header and post records or ids.'], ['method' => 'POST', 'summary' => 'create' . $plural . '() - Create one or more ' . $pluralWords . '.', 'nickname' => 'create' . $plural, 'type' => $plural . 'Response', 'event_name' => $eventPath . '.create', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs of records to create.', 'allowMultiple' => false, 'type' => $plural . 'Request', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ['name' => 'X-HTTP-METHOD', 'description' => 'Override request using POST to tunnel other http request, such as DELETE.', 'enum' => ['GET', 'PUT', 'PATCH', 'DELETE'], 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'header', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be a single record or an array of records (shown). ' . 'By default, only the id property of the record affected is returned on success, ' . 'use \'fields\' and \'related\' to return more info.'], ['method' => 'PATCH', 'summary' => 'update' . $plural . '() - Update one or more ' . $pluralWords . '.', 'nickname' => 'update' . $plural, 'type' => $plural . 'Response', 'event_name' => $eventPath . '.update', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => $plural . 'Request', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be a single record or an array of records (shown). ' . 'By default, only the id property of the record is returned on success, ' . 'use \'fields\' and \'related\' to return more info.'], ['method' => 'DELETE', 'summary' => 'delete' . $plural . '() - Delete one or more ' . $pluralWords . '.', 'nickname' => 'delete' . $plural, 'type' => $plural . 'Response', 'event_name' => $eventPath . '.delete', 'parameters' => [['name' => 'force', 'description' => 'Set force to true to delete all records in this table, otherwise \'ids\' parameter is required.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'default' => false], ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'By default, only the id property of the record deleted is returned on success. ' . 'Use \'fields\' and \'related\' to return more properties of the deleted records. <br>' . 'Alternatively, to delete by record or a large list of ids, ' . 'use the POST request with X-HTTP-METHOD = DELETE header and post records or ids.']]], ['path' => $path . '/{id}', 'operations' => [['method' => 'GET', 'summary' => 'get' . $name . '() - Retrieve one ' . $words . '.', 'nickname' => 'get' . $name, 'type' => $name . 'Response', 'event_name' => $eventPath . '.read', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Use the \'fields\' and/or \'related\' parameter to limit properties that are returned. By default, all fields and no relations are returned.'], ['method' => 'PATCH', 'summary' => 'update' . $name . '() - Update one ' . $words . '.', 'nickname' => 'update' . $name, 'type' => $name . 'Response', 'event_name' => $eventPath . '.update', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of fields to update.', 'allowMultiple' => false, 'type' => $name . 'Request', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of fields to update for a single record. <br>' . 'By default, only the id is returned. Use the \'fields\' and/or \'related\' parameter to return more properties.'], ['method' => 'DELETE', 'summary' => 'delete' . $name . '() - Delete one ' . $words . '.', 'nickname' => 'delete' . $name, 'type' => $name . 'Response', 'event_name' => $eventPath . '.delete', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the record to delete.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'By default, only the id is returned. Use the \'fields\' and/or \'related\' parameter to return deleted properties.']], 'description' => "Operations for individual {$words} administration."]];
     $models = [$plural . 'Request' => ['id' => $plural . 'Request', 'properties' => [$wrapper => ['type' => 'array', 'description' => 'Array of system records.', 'items' => ['$ref' => $name . 'Request']], ApiOptions::IDS => ['type' => 'array', 'description' => 'Array of system record identifiers, used for batch GET, PUT, PATCH, and DELETE.', 'items' => ['type' => 'integer', 'format' => 'int32']]]], $plural . 'Response' => ['id' => $plural . 'Response', 'properties' => [$wrapper => ['type' => 'array', 'description' => 'Array of system records.', 'items' => ['$ref' => $name . 'Response']], 'meta' => ['type' => 'Metadata', 'description' => 'Array of metadata returned for GET requests.']]], 'Metadata' => ['id' => 'Metadata', 'properties' => ['schema' => ['type' => 'array', 'description' => 'Array of table schema.', 'items' => ['type' => 'string']], 'count' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Record count returned for GET requests.']]]];
     $model = $this->getModel();
     if ($model) {
         $temp = $model->toApiDocsModel($name);
         if ($temp) {
             $models = array_merge($models, $temp);
         }
     }
     return ['apis' => $apis, 'models' => $models];
 }
예제 #8
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $name = Inflector::camelize($this->name);
     $plural = Inflector::pluralize($name);
     $words = str_replace('_', ' ', $this->name);
     $pluralWords = Inflector::pluralize($words);
     return ['apis' => [['path' => $path, 'description' => "Operations for {$words} administration.", 'operations' => [['method' => 'GET', 'summary' => 'get' . $plural . 'List() - List all ' . $pluralWords . ' identifiers.', 'nickname' => 'get' . $plural . 'List', 'notes' => 'Return only a list of the resource identifiers.', 'type' => $plural . 'List', 'event_name' => [$eventPath . '.list'], 'parameters' => [ApiOptions::documentOption(ApiOptions::AS_LIST, true, true), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::REFRESH)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'get' . $plural . '() - List all ' . $pluralWords . '.', 'nickname' => 'get' . $plural, 'notes' => 'List the resources available on this service. ', 'type' => $plural . 'Response', 'event_name' => [$eventPath . '.list'], 'parameters' => [ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::REFRESH)], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]]], 'models' => $this->getApiDocModels()];
 }
예제 #9
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $base = parent::getApiDocInfo();
     $tables = $this->listResources();
     $commonResponses = ApiDocUtilities::getCommonResponses();
     $wrapper = ResourcesWrapper::getWrapper();
     $apis = [['path' => $path . '/{table_name}', 'description' => 'Operations for table records administration.', 'operations' => [['method' => 'GET', 'summary' => 'getRecords() - Retrieve one or more records.', 'nickname' => 'getRecords', 'notes' => 'Set the <b>filter</b> parameter to a SQL WHERE clause (optional native filter accepted in some scenarios) ' . 'to limit records returned or leave it blank to return all records up to the maximum limit.<br/> ' . 'Set the <b>limit</b> parameter with or without a filter to return a specific amount of records.<br/> ' . 'Use the <b>offset</b> parameter along with the <b>limit</b> parameter to page through sets of records.<br/> ' . 'Set the <b>order</b> parameter to SQL ORDER_BY clause containing field and optional direction (<field_name> [ASC|DESC]) to order the returned records.<br/> ' . 'Alternatively, to send the <b>filter</b> with or without <b>params</b> as posted data, ' . 'use the getRecordsByPost() POST request and post a filter with or without params.<br/>' . 'Pass the identifying field values as a comma-separated list in the <b>ids</b> parameter.<br/> ' . 'Use the <b>id_field</b> and <b>id_type</b> parameters to override or specify detail for identifying fields where applicable.<br/> ' . 'Alternatively, to send the <b>ids</b> as posted data, use the getRecordsByPost() POST request.<br/> ' . 'Use the <b>fields</b> parameter to limit properties returned for each record. ' . 'By default, all fields are returned for all records. ', 'type' => 'RecordsResponse', 'event_name' => [$eventPath . '.{table_name}.select', $eventPath . '.table_selected'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::LIMIT), ApiOptions::documentOption(ApiOptions::ORDER), ApiOptions::documentOption(ApiOptions::GROUP), ApiOptions::documentOption(ApiOptions::OFFSET), ApiOptions::documentOption(ApiOptions::INCLUDE_COUNT), ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::CONTINUES), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ApiOptions::documentOption(ApiOptions::INCLUDE_SCHEMA), ApiOptions::documentOption(ApiOptions::FILE)], 'responseMessages' => $commonResponses], ['method' => 'POST', 'summary' => 'createRecords() - Create one or more records.', 'nickname' => 'createRecords', 'notes' => 'Posted data should be an array of records wrapped in a <b>record</b> element.<br/> ' . 'By default, only the id property of the record is returned on success. ' . 'Use <b>fields</b> parameter to return more info.', 'type' => 'RecordsResponse', 'event_name' => [$eventPath . '.{table_name}.insert', $eventPath . '.table_inserted'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to create.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::CONTINUES), ApiOptions::documentOption(ApiOptions::ROLLBACK), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED), ['name' => 'X-HTTP-METHOD', 'description' => 'Override request using POST to tunnel other http request, such as DELETE or GET passing a payload.', 'enum' => ['GET'], 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'header', 'required' => false]], 'responseMessages' => $commonResponses], ['method' => 'PUT', 'summary' => 'replaceRecords() - Update (replace) one or more records.', 'nickname' => 'replaceRecords', 'notes' => 'Post data should be an array of records wrapped in a <b>' . $wrapper . '</b> tag.<br/> ' . 'If ids or filter is used, posted body should be a single record with name-value pairs ' . 'to update, wrapped in a <b>' . $wrapper . '</b> tag.<br/> ' . 'Ids can be included via URL parameter or included in the posted body.<br/> ' . 'Filter can be included via URL parameter or included in the posted body.<br/> ' . 'By default, only the id property of the record is returned on success. ' . 'Use <b>fields</b> parameter to return more info.', 'type' => 'RecordsResponse', 'event_name' => [$eventPath . '.{table_name}.update', $eventPath . '.table_updated'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::CONTINUES), ApiOptions::documentOption(ApiOptions::ROLLBACK), ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => $commonResponses], ['method' => 'PATCH', 'summary' => 'updateRecords() - Update (patch) one or more records.', 'nickname' => 'updateRecords', 'notes' => 'Post data should be an array of records containing at least the identifying fields for each record.<br/> ' . 'Posted body should be a single record with name-value pairs to update wrapped in a <b>record</b> tag.<br/> ' . 'Ids can be included via URL parameter or included in the posted body.<br/> ' . 'Filter can be included via URL parameter or included in the posted body.<br/> ' . 'By default, only the id property of the record is returned on success. ' . 'Use <b>fields</b> parameter to return more info.', 'type' => 'RecordsResponse', 'event_name' => [$eventPath . '.{table_name}.update', $eventPath . '.table_updated'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'body', 'description' => 'A single record containing name-value pairs of fields to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::CONTINUES), ApiOptions::documentOption(ApiOptions::ROLLBACK), ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => $commonResponses], ['method' => 'DELETE', 'summary' => 'deleteRecords() - Delete one or more records.', 'nickname' => 'deleteRecords', 'notes' => 'Set the <b>ids</b> parameter to a list of record identifying (primary key) values to delete specific records.<br/> ' . 'Alternatively, to delete records by a large list of ids, pass the ids in the <b>body</b>.<br/> ' . 'By default, only the id property of the record is returned on success, use <b>fields</b> to return more info. ' . 'Set the <b>filter</b> parameter to a SQL WHERE clause to delete specific records, ' . 'otherwise set <b>force</b> to true to clear the table.<br/> ' . 'Alternatively, to delete by a complicated filter or to use parameter replacement, pass the filter with or without params as the <b>body</b>.<br/> ' . 'By default, only the id property of the record is returned on success, use <b>fields</b> to return more info. ' . 'Set the <b>body</b> to an array of records, minimally including the identifying fields, to delete specific records.<br/> ' . 'By default, only the id property of the record is returned on success, use <b>fields</b> to return more info. ', 'type' => 'RecordsResponse', 'event_name' => [$eventPath . '.{table_name}.delete', $eventPath . '.table_deleted'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'body', 'description' => 'Data containing ids of records to delete.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => false], ApiOptions::documentOption(ApiOptions::IDS), ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::CONTINUES), ApiOptions::documentOption(ApiOptions::ROLLBACK), ApiOptions::documentOption(ApiOptions::FILTER), ApiOptions::documentOption(ApiOptions::FORCE), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => $commonResponses]]], ['path' => $path . '/{table_name}/{id}', 'description' => 'Operations for single record administration.', 'operations' => [['method' => 'GET', 'summary' => 'getRecord() - Retrieve one record by identifier.', 'nickname' => 'getRecord', 'notes' => 'Use the <b>fields</b> parameter to limit properties that are returned. ' . 'By default, all fields are returned.', 'type' => 'RecordResponse', 'event_name' => [$eventPath . '.{table_name}.{id}.select', $eventPath . '.record_selected'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'id', 'description' => 'Identifier of the record to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => $commonResponses], ['method' => 'PUT', 'summary' => 'replaceRecord() - Replace the content of one record by identifier.', 'nickname' => 'replaceRecord', 'notes' => 'Post data should be an array of fields for a single record.<br/> ' . 'Use the <b>fields</b> parameter to return more properties. By default, the id is returned.', 'type' => 'RecordResponse', 'event_name' => [$eventPath . '.{table_name}.{id}.update', $eventPath . '.record_updated'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'id', 'description' => 'Identifier of the record to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of the replacement record.', 'allowMultiple' => false, 'type' => 'RecordRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::FIELDS), ApiOptions::documentOption(ApiOptions::RELATED)], 'responseMessages' => $commonResponses], ['method' => 'PATCH', 'summary' => 'updateRecord() - Update (patch) one record by identifier.', 'nickname' => 'updateRecord', 'notes' => 'Post data should be an array of fields for a single record.<br/> ' . 'Use the <b>fields</b> parameter to return more properties. By default, the id is returned.', 'type' => 'RecordResponse', 'event_name' => [$eventPath . '.{table_name}.{id}.update', $eventPath . '.record_updated'], 'parameters' => [['name' => 'table_name', 'description' => 'The name of the table you want to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'id', 'description' => 'Identifier of the record to update.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of the fields to update.', 'allowMultiple' => false, 'type' => 'RecordRequest', 'paramType' => 'body', 'required' => true], ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::FIELDS)], 'responseMessages' => $commonResponses], ['method' => 'DELETE', 'summary' => 'deleteRecord() - Delete one record by identifier.', 'nickname' => 'deleteRecord', 'notes' => 'Use the <b>fields</b> parameter to return more deleted properties. By default, the id is returned.', 'type' => 'RecordResponse', 'event_name' => [$eventPath . '.{table_name}.{id}.delete', $eventPath . '.record_deleted'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'id', 'description' => 'Identifier of the record to delete.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ApiOptions::documentOption(ApiOptions::ID_FIELD), ApiOptions::documentOption(ApiOptions::ID_TYPE), ApiOptions::documentOption(ApiOptions::FIELDS)], 'responseMessages' => $commonResponses]]]];
     $base['apis'] = array_merge($base['apis'], $apis);
     return $base;
 }