Example #1
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $apis = [['path' => $path, 'operations' => [['method' => 'DELETE', 'summary' => 'deleteAllCache() - Delete all cache.', 'nickname' => 'deleteAllCache', 'type' => 'Success', 'event_name' => $eventPath . '.delete', 'parameters' => [], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This clears all cached information in the system. Doing so may impact the performance of the system.']], 'description' => "Operations for global cache administration."], ['path' => $path . '/{service}', 'operations' => [['method' => 'DELETE', 'summary' => 'deleteServiceCache() - Delete cache for one service.', 'nickname' => 'deleteServiceCache', 'type' => 'Success', 'event_name' => $eventPath . '{service}.delete', 'parameters' => [['name' => 'service', 'description' => 'Identifier of the service whose cache we are to delete.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This clears all cached information related to a particular service. Doing so may impact the performance of the service.']], 'description' => "Operations for individual service-related cache administration."]];
     return ['apis' => $apis, 'models' => []];
 }
Example #2
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $apis = [['path' => $path, 'operations' => [['method' => 'POST', 'summary' => 'register() - Register a new user in the system.', 'nickname' => 'register', 'type' => 'Success', 'event_name' => [$eventPath . '.create'], 'parameters' => [['name' => 'login', 'description' => 'Login and create a session upon successful registration.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'body', 'description' => 'Data containing name-value pairs for new user registration.', 'allowMultiple' => false, 'type' => 'Register', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 500]), 'notes' => 'The new user is created and, if required, sent an email for confirmation. ' . 'This also handles the registration confirmation by posting email, ' . 'confirmation code and new password.']], 'description' => 'Operations to register a new user.']];
     $models = ['Register' => ['id' => 'Register', 'properties' => ['email' => ['type' => 'string', 'description' => 'Email address of the new user.', 'required' => true], 'first_name' => ['type' => 'string', 'description' => 'First name of the new user.'], 'last_name' => ['type' => 'string', 'description' => 'Last name of the new user.'], 'display_name' => ['type' => 'string', 'description' => 'Full display name of the new user.'], 'new_password' => ['type' => 'string', 'description' => 'Password for the new user.'], 'code' => ['type' => 'string', 'description' => 'Code required with new_password when using email confirmation.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $apis = [['path' => $path, 'operations' => [['method' => 'GET', 'summary' => 'getSession() - Retrieve the current user session information.', 'nickname' => 'getSession', 'event_name' => [$eventPath . '.read'], 'type' => 'Session', 'responseMessages' => ApiDocUtilities::getCommonResponses([401, 500]), 'notes' => 'Calling this refreshes the current session, or returns an error for timed-out or invalid sessions.'], ['method' => 'POST', 'summary' => 'login() - Login and create a new user session.', 'nickname' => 'login', 'type' => 'Session', 'event_name' => [$eventPath . '.create', 'user.login'], 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs used for logging into the system.', 'allowMultiple' => false, 'type' => 'Login', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 500]), 'notes' => 'Calling this creates a new session and logs in the user.'], ['method' => 'DELETE', 'summary' => 'logout() - Logout and destroy the current user session.', 'nickname' => 'logout', 'type' => 'Success', 'event_name' => [$eventPath . '.delete', 'user.logout'], 'responseMessages' => ApiDocUtilities::getCommonResponses([500]), 'notes' => 'Calling this deletes the current session and logs out the user.']], 'description' => 'Operations on a user\'s session.']];
     $models = ['Session' => ['id' => 'Session', 'properties' => ['id' => ['type' => 'string', 'description' => 'Identifier for the current user.'], 'email' => ['type' => 'string', 'description' => 'Email address of the current user.'], 'first_name' => ['type' => 'string', 'description' => 'First name of the current user.'], 'last_name' => ['type' => 'string', 'description' => 'Last name of the current user.'], 'display_name' => ['type' => 'string', 'description' => 'Full display name of the current user.'], 'is_sys_admin' => ['type' => 'boolean', 'description' => 'Is the current user a system administrator.'], 'role' => ['type' => 'string', 'description' => 'Name of the role to which the current user is assigned.'], 'last_login_date' => ['type' => 'string', 'description' => 'Date timestamp of the last login for the current user.'], 'app_groups' => ['type' => 'Array', 'description' => 'App groups and the containing apps.', 'items' => ['$ref' => 'SessionApp']], 'no_group_apps' => ['type' => 'Array', 'description' => 'Apps that are not in any app groups.', 'items' => ['$ref' => 'SessionApp']], 'session_id' => ['type' => 'string', 'description' => 'Id for the current session, used in X-DreamFactory-Session-Token header for API requests.'], 'ticket' => ['type' => 'string', 'description' => 'Timed ticket that can be used to start a separate session.'], 'ticket_expiry' => ['type' => 'string', 'description' => 'Expiration time for the given ticket.']]], 'Login' => ['id' => 'Login', 'properties' => ['email' => ['type' => 'string', 'required' => true], 'password' => ['type' => 'string', 'required' => true], 'duration' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Duration of the session, Defaults to 0, which means until browser is closed.']]], 'SessionApp' => ['id' => 'SessionApp', 'properties' => ['id' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Id of the application.'], 'name' => ['type' => 'string', 'description' => 'Displayed name of the application.'], 'description' => ['type' => 'string', 'description' => 'Description of the application.'], 'is_url_external' => ['type' => 'boolean', 'description' => 'Does this application exist on a separate server.'], 'launch_url' => ['type' => 'string', 'description' => 'URL at which this app can be accessed.'], 'requires_fullscreen' => ['type' => 'boolean', 'description' => 'True if the application requires fullscreen to run.'], 'allow_fullscreen_toggle' => ['type' => 'boolean', 'description' => 'True allows the fullscreen toggle widget to be displayed.'], 'toggle_location' => ['type' => 'string', 'description' => 'Where the fullscreen toggle widget is to be displayed, defaults to top.'], 'is_default' => ['type' => 'boolean', 'description' => 'True if this app is set to launch by default at sign in.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $apis = [['path' => $path, 'operations' => [['method' => 'POST', 'summary' => 'changePassword() - Change or reset the current user\'s password.', 'nickname' => 'changePassword', 'type' => 'PasswordResponse', 'event_name' => $eventPath . '.update', 'parameters' => [['name' => 'reset', 'description' => 'Set to true to perform password reset.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'login', 'description' => 'Login and create a session upon successful password reset.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'body', 'description' => 'Data containing name-value pairs for password change.', 'allowMultiple' => false, 'type' => 'PasswordRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'A valid current session along with old and new password are required to change ' . 'the password directly posting \'old_password\' and \'new_password\'. <br/>' . 'To request password reset, post \'email\' and set \'reset\' to true. <br/>' . 'To reset the password from an email confirmation, post \'email\', \'code\', and \'new_password\'. <br/>' . 'To reset the password from a security question, post \'email\', \'security_answer\', and \'new_password\'.']], 'description' => 'Operations on a user\'s password.']];
     $models = ['PasswordRequest' => ['id' => 'PasswordRequest', 'properties' => ['old_password' => ['type' => 'string', 'description' => 'Old password to validate change during a session.'], 'new_password' => ['type' => 'string', 'description' => 'New password to be set.'], 'email' => ['type' => 'string', 'description' => 'User\'s email to be used with code to validate email confirmation.'], 'code' => ['type' => 'string', 'description' => 'Code required with new_password when using email confirmation.']]], 'PasswordResponse' => ['id' => 'PasswordResponse', 'properties' => ['security_question' => ['type' => 'string', 'description' => 'User\'s security question, returned on reset request when no email confirmation required.'], 'success' => ['type' => 'boolean', 'description' => 'True if password updated or reset request granted via email confirmation.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
Example #5
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $apis = [['path' => $path, 'operations' => [['method' => 'GET', 'summary' => 'getProfile() - Retrieve the current user\'s profile information.', 'nickname' => 'getProfile', 'type' => 'ProfileResponse', 'event_name' => $eventPath . '.read', 'responseMessages' => ApiDocUtilities::getCommonResponses([401, 500]), 'notes' => 'A valid current session is required to use this API. ' . 'This profile, along with password, is the only things that the user can directly change.'], ['method' => 'POST', 'summary' => 'updateProfile() - Update the current user\'s profile information.', 'nickname' => 'updateProfile', 'type' => 'Success', 'event_name' => $eventPath . '.update', 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs for the user profile.', 'allowMultiple' => false, 'type' => 'ProfileRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Update the display name, phone, etc., as well as, security question and answer.']], 'description' => 'Operations on a user\'s profile.']];
     $commonProfile = ['email' => ['type' => 'string', 'description' => 'Email address of the current user.'], 'first_name' => ['type' => 'string', 'description' => 'First name of the current user.'], 'last_name' => ['type' => 'string', 'description' => 'Last name of the current user.'], 'display_name' => ['type' => 'string', 'description' => 'Full display name of the current user.'], 'phone' => ['type' => 'string', 'description' => 'Phone number.'], 'security_question' => ['type' => 'string', 'description' => 'Question to be answered to initiate password reset.'], 'default_app_id' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Id of the application to be launched at login.']];
     $models = ['ProfileRequest' => ['id' => 'ProfileRequest', 'properties' => array_merge($commonProfile, ['security_answer' => ['type' => 'string', 'description' => 'Answer to the security question.']])], 'ProfileResponse' => ['id' => 'ProfileResponse', 'properties' => $commonProfile]];
     return ['apis' => $apis, 'models' => $models];
 }
Example #6
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $config = [];
     $config['apis'] = [['path' => $path, 'operations' => [['method' => 'GET', 'summary' => 'getConfig() - Retrieve system configuration properties.', 'nickname' => 'getConfig', 'type' => 'ConfigResponse', 'event_name' => $eventPath . '.read', 'notes' => 'The retrieved properties control how the system behaves.', 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'setConfig() - Update one or more system configuration properties.', 'nickname' => 'setConfig', 'type' => 'ConfigResponse', 'event_name' => $eventPath . '.update', 'notes' => 'Post data should be an array of properties.', 'parameters' => [['name' => 'body', 'description' => 'Data containing name-value pairs of properties to set.', 'allowMultiple' => false, 'type' => 'ConfigRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]], 'description' => 'Operations for system configuration options.']];
     $commonProperties = ['editable_profile_fields' => ['type' => 'string', 'description' => 'Comma-delimited list of fields the user is allowed to edit.'], 'restricted_verbs' => ['type' => 'array', 'description' => 'An array of HTTP verbs that must be tunnelled on this server.', 'items' => ['type' => 'string']], 'timestamp_format' => ['type' => 'string', 'description' => 'The date/time format used for timestamps.']];
     $config['models'] = ['ConfigRequest' => ['id' => 'ConfigRequest', 'properties' => $commonProperties], 'ConfigResponse' => ['id' => 'ConfigResponse', 'properties' => $commonProperties]];
     return $config;
 }
Example #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::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];
 }
Example #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);
     $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];
 }
Example #9
0
 /**
  * @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];
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 public function getApiDocInfo()
 {
     $base = parent::getApiDocInfo();
     $apis = [['path' => '/{api_name}', 'description' => 'Operations available for push notification services.', 'operations' => [['method' => 'POST', 'summary' => 'simplePublish() - Send a simple message to a topic or endpoint.', 'nickname' => 'simplePublish', 'notes' => 'Post data should be an array of topic publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.publish'], 'parameters' => [['name' => 'body', 'description' => 'Array of topic publish parameters.', 'allowMultiple' => false, 'type' => 'SimplePublishRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'publish() - Send a message to a topic or endpoint.', 'nickname' => 'publish', 'notes' => 'Post data should be an array of topic publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.publish'], 'parameters' => [['name' => 'body', 'description' => 'Array of topic message parameters.', 'allowMultiple' => false, 'type' => 'PublishRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]], ['path' => '/{api_name}/topic', 'description' => 'Operations for push topics.', 'operations' => [['method' => 'GET', 'summary' => 'getTopics() - Retrieve all topics available for the push service.', 'nickname' => 'getTopics', 'notes' => 'This returns the topics as resources.', 'event_name' => ['{api_name}.topic.list'], 'type' => 'GetTopicsResponse', 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'listTopics() - List topics available for the push service.', 'nickname' => 'listTopics', 'notes' => 'Returns only the names of the topics in an array.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.topic.list'], 'parameters' => [['name' => 'names_only', 'description' => 'Return only the names of the topics in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'createTopic() - Create a topic.', 'nickname' => 'createTopic', 'notes' => 'Post data should be an array of topic attributes including \'Name\'.', 'type' => 'TopicIdentifier', 'event_name' => ['{api_name}.topic.create'], 'parameters' => [['name' => 'body', 'description' => 'Array of topic attributes.', 'allowMultiple' => false, 'type' => 'TopicRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]], ['path' => '/{api_name}/topic/{topic_name}', 'description' => 'Operations for a specific push topic.', 'operations' => [['method' => 'GET', 'summary' => 'getTopicAttributes() - Retrieve topic definition for the given topic.', 'nickname' => 'getTopicAttributes', 'notes' => 'This retrieves the topic, detailing its available properties.', 'event_name' => ['{api_name}.topic.{topic_name}.retrieve', '{api_name}.topic_retrieved'], 'type' => 'TopicAttributesResponse', 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'simplePublishTopic() - Send a message to the given topic.', 'nickname' => 'simplePublishTopic', 'notes' => 'Post data should be an array of topic publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.topic.{topic_name}.publish', '{api_name}.topic_published'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of topic publish parameters.', 'allowMultiple' => false, 'type' => 'SimplePublishTopicRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'publishTopic() - Send a message to the given topic.', 'nickname' => 'publishTopic', 'notes' => 'Post data should be an array of topic publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.topic.{topic_name}.publish', '{api_name}.topic_published'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of topic message parameters.', 'allowMultiple' => false, 'type' => 'PublishTopicRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'PUT', 'summary' => 'setTopicAttributes() - Update a given topic\'s attributes.', 'nickname' => 'setTopicAttributes', 'type' => 'Success', 'event_name' => ['{api_name}.topic.{topic_name}.update', '{api_name}.topic_updated'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of topic attributes.', 'allowMultiple' => false, 'type' => 'TopicAttributesRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of topic attributes including \'Name\'.'], ['method' => 'DELETE', 'summary' => 'deleteTopic() - Delete a given topic.', 'nickname' => 'deleteTopic', 'notes' => '', 'type' => 'Success', 'event_name' => ['{api_name}.topic.{topic_name}.delete', '{api_name}.topic_deleted'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]], ['path' => '/{api_name}/topic/{topic_name}/subscription', 'description' => 'Operations for push subscriptions.', 'operations' => [['method' => 'GET', 'summary' => 'getSubscriptionsByTopic() - Retrieve subscriptions for the given topic.', 'nickname' => 'getSubscriptionsByTopic', 'notes' => 'This return the subscriptions as resources.', 'event_name' => ['{api_name}.topic.{topic_name}.subscription.list'], 'type' => 'GetSubscriptionsResponse', 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'listSubscriptionsByTopic() - List subscriptions available for the given topic.', 'nickname' => 'listSubscriptionsByTopic', 'notes' => 'Return only the names of the subscriptions in an array.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.topic.{topic_name}.subscription.list'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'names_only', 'description' => 'Return only the names of the subscriptions in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'subscribeTopic() - Create a subscription for the given topic.', 'nickname' => 'subscribeTopic', 'type' => 'SubscriptionIdentifier', 'event_name' => ['{api_name}.topic.{topic_name}.subscription.create'], 'parameters' => [['name' => 'topic_name', 'description' => 'Full ARN or simplified name of the topic to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of subscription attributes.', 'allowMultiple' => false, 'type' => 'SubscriptionTopicRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of subscription attributes including \'Name\'.']]], ['path' => '/{api_name}/subscription', 'description' => 'Operations for push subscriptions.', 'operations' => [['method' => 'GET', 'summary' => 'getSubscriptions() - Retrieve all subscriptions as resources.', 'nickname' => 'getSubscriptions', 'notes' => 'This describes the topic, detailing its available properties.', 'event_name' => ['{api_name}.subscription.list'], 'type' => 'GetSubscriptionsResponse', 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'listSubscriptions() - List subscriptions available for the push service.', 'nickname' => 'listSubscriptions', 'notes' => 'See listed operations for each subscription available.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.subscription.list'], 'parameters' => [['name' => 'names_only', 'description' => 'Return only the names of the subscriptions in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'subscribe() - Create a subscription.', 'nickname' => 'subscribe', 'type' => 'SubscriptionIdentifier', 'event_name' => ['{api_name}.subscription.create'], 'parameters' => [['name' => 'body', 'description' => 'Array of subscription attributes.', 'allowMultiple' => false, 'type' => 'SubscriptionRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of subscription attributes including \'Name\'.']]], ['path' => '/{api_name}/subscription/{sub_name}', 'description' => 'Operations for a specific push subscription.', 'operations' => [['method' => 'GET', 'summary' => 'getSubscriptionAttributes() - Retrieve attributes for the given subscription.', 'nickname' => 'getSubscriptionAttributes', 'event_name' => ['{api_name}.subscription.{subscription_name}.retrieve', '{api_name}.subscription_retrieved'], 'type' => 'SubscriptionAttributesResponse', 'parameters' => [['name' => 'sub_name', 'description' => 'Full ARN or simplified name of the subscription to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This retrieves the subscription, detailing its available properties.'], ['method' => 'PUT', 'summary' => 'setSubscriptionAttributes() - Update a given subscription.', 'nickname' => 'setSubscriptionAttributes', 'type' => 'Success', 'event_name' => ['{api_name}.subscription.{subscription_name}.update', '{api_name}.subscription_updated'], 'parameters' => [['name' => 'sub_name', 'description' => 'Full ARN or simplified name of the subscription to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of subscription attributes.', 'allowMultiple' => false, 'type' => 'SubscriptionAttributesRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of subscription attributes including \'Name\'.'], ['method' => 'DELETE', 'summary' => 'unsubscribe() - Delete a given subscription.', 'nickname' => 'unsubscribe', 'notes' => '', 'type' => 'Success', 'event_name' => ['{api_name}.subscription.{subscription_name}.delete', '{api_name}.subscription_deleted'], 'parameters' => [['name' => 'sub_name', 'description' => 'Full ARN or simplified name of the subscription to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]], ['path' => '/{api_name}/app', 'description' => 'Operations for push platform applications.', 'operations' => [['method' => 'GET', 'summary' => 'getApps() - Retrieve app definition for the given app.', 'nickname' => 'getApps', 'event_name' => ['{api_name}.app.list'], 'type' => 'GetAppsResponse', 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This describes the app, detailing its available properties.'], ['method' => 'GET', 'summary' => 'listApps() - List apps available for the push service.', 'nickname' => 'listApps', 'notes' => 'See listed operations for each app available.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.app.list'], 'parameters' => [['name' => 'names_only', 'description' => 'Return only the names of the apps in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'createApp() - Create a given app.', 'nickname' => 'createApp', 'type' => 'AppIdentifier', 'event_name' => ['{api_name}.app.create'], 'parameters' => [['name' => 'body', 'description' => 'Array of app attributes.', 'allowMultiple' => false, 'type' => 'AppRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of app attributes including \'Name\'.']]], ['path' => '/{api_name}/app/{app_name}', 'description' => 'Operations for a specific push platform application.', 'operations' => [['method' => 'GET', 'summary' => 'getAppAttributes() - Retrieve app definition for the given app.', 'nickname' => 'getAppAttributes', 'event_name' => ['{api_name}.app.{app_name}.retrieve', '{api_name}.app_retrieved'], 'type' => 'AppAttributesResponse', 'parameters' => [['name' => 'app_name', 'description' => 'Full ARN or simplified name of the app to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This retrieves the app, detailing its available properties.'], ['method' => 'PUT', 'summary' => 'setAppAttributes() - Update a given app.', 'nickname' => 'setAppAttributes', 'type' => 'Success', 'event_name' => ['{api_name}.app.{app_name}.update', '{api_name}.app_updated'], 'parameters' => [['name' => 'app_name', 'description' => 'Full ARN or simplified name of the app to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of app attributes.', 'allowMultiple' => false, 'type' => 'AppAttributesRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of app attributes including \'Name\'.'], ['method' => 'DELETE', 'summary' => 'deleteApp() - Delete a given app.', 'nickname' => 'deleteApp', 'notes' => '', 'type' => 'Success', 'event_name' => ['{api_name}.app.{app_name}.delete', '{api_name}.app_deleted'], 'parameters' => [['name' => 'app_name', 'description' => 'Full ARN or simplified name of the app to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]], ['path' => '/{api_name}/app/{app_name}/endpoint', 'description' => 'Operations for push application endpoints.', 'operations' => [['method' => 'GET', 'summary' => 'getEndpointsByApp() - Retrieve endpoints for the given application.', 'nickname' => 'getEndpointsByApp', 'event_name' => ['{api_name}.endpoint.list'], 'type' => 'GetEndpointsResponse', 'parameters' => [['name' => 'app_name', 'description' => 'Name of the application to get endpoints on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This describes the endpoints, detailing its available properties.'], ['method' => 'GET', 'summary' => 'listEndpointsByApp() - List endpoints available for the push service.', 'nickname' => 'listEndpointsByApp', 'notes' => 'See listed operations for each endpoint available.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.endpoint.list'], 'parameters' => [['name' => 'app_name', 'description' => 'Name of the application to get endpoints on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'names_only', 'description' => 'Return only the names of the endpoints in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'createAppEndpoint() - Create a endpoint for a given application.', 'nickname' => 'createAppEndpoint', 'type' => 'EndpointIdentifier', 'event_name' => ['{api_name}.endpoint.create'], 'parameters' => [['name' => 'app_name', 'description' => 'Name of the application to create endpoints on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of endpoint attributes.', 'allowMultiple' => false, 'type' => 'AppEndpointRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of endpoint attributes including \'Name\'.']]], ['path' => '/{api_name}/endpoint', 'description' => 'Operations for push application endpoints.', 'operations' => [['method' => 'GET', 'summary' => 'getEndpoints() - Retrieve endpoint definition for the given endpoint.', 'nickname' => 'getEndpoints', 'notes' => 'This describes the endpoint, detailing its available properties.', 'event_name' => ['{api_name}.endpoint.list'], 'type' => 'GetEndpointsResponse', 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'GET', 'summary' => 'listEndpoints() - List endpoints available for the push service.', 'nickname' => 'listEndpoints', 'notes' => 'See listed operations for each endpoint available.', 'type' => 'ComponentList', 'event_name' => ['{api_name}.endpoint.list'], 'parameters' => [['name' => 'names_only', 'description' => 'Return only the names of the endpoints in an array.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => true, 'default' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'createEndpoint() - Create a given endpoint.', 'nickname' => 'createEndpoint', 'type' => 'EndpointIdentifier', 'event_name' => ['{api_name}.endpoint.create'], 'parameters' => [['name' => 'body', 'description' => 'Array of endpoint attributes.', 'allowMultiple' => false, 'type' => 'EndpointRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of endpoint attributes including \'Name\'.']]], ['path' => '/{api_name}/endpoint/{endpoint_name}', 'description' => 'Operations for a specific push application endpoint.', 'operations' => [['method' => 'GET', 'summary' => 'getEndpointAttributes() - Retrieve endpoint definition for the given endpoint.', 'nickname' => 'getEndpointAttributes', 'event_name' => ['{api_name}.endpoint.{endpoint_name}.retrieve', '{api_name}.endpoint_retrieved'], 'type' => 'EndpointAttributesResponse', 'parameters' => [['name' => 'endpoint_name', 'description' => 'Full ARN or simplified name of the endpoint to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This retrieves the endpoint, detailing its available properties.'], ['method' => 'POST', 'summary' => 'simplePublishEndpoint() - Send a message to the given endpoint.', 'nickname' => 'simplePublishEndpoint', 'notes' => 'Post data should be an array of endpoint publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.topic.{topic_name}.publish', '{api_name}.topic_published'], 'parameters' => [['name' => 'endpoint_name', 'description' => 'Full ARN or simplified name of the endpoint to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of topic publish parameters.', 'allowMultiple' => false, 'type' => 'SimplePublishEndpointRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'POST', 'summary' => 'publishEndpoint() - Send a message to the given endpoint.', 'nickname' => 'publishEndpoint', 'notes' => 'Post data should be an array of endpoint publish properties.', 'type' => 'PublishResponse', 'event_name' => ['{api_name}.topic.{endpoint_name}.publish', '{api_name}.endpoint_published'], 'parameters' => [['name' => 'endpoint_name', 'description' => 'Full ARN or simplified name of the endpoint to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of topic message parameters.', 'allowMultiple' => false, 'type' => 'PublishEndpointRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])], ['method' => 'PUT', 'summary' => 'setEndpointAttributes() - Update a given endpoint.', 'nickname' => 'setEndpointAttributes', 'type' => 'Success', 'event_name' => ['{api_name}.endpoint.{endpoint_name}.update', '{api_name}.endpoint_updated'], 'parameters' => [['name' => 'endpoint_name', 'description' => 'Full ARN or simplified name of the endpoint to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Array of endpoint attributes.', 'allowMultiple' => false, 'type' => 'EndpointAttributesRequest', 'paramType' => 'body', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'Post data should be an array of endpoint attributes including \'Name\'.'], ['method' => 'DELETE', 'summary' => 'deleteEndpoint() - Delete a given endpoint.', 'nickname' => 'deleteEndpoint', 'notes' => '', 'type' => 'Success', 'event_name' => ['{api_name}.endpoint.{endpoint_name}.delete', '{api_name}.endpoint_deleted'], 'parameters' => [['name' => 'endpoint_name', 'description' => 'Full ARN or simplified name of the endpoint to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500])]]]];
     $commonAppAttributes = ['PlatformCredential' => ['type' => 'string', 'description' => 'The credential received from the notification service.'], 'PlatformPrincipal' => ['type' => 'string', 'description' => 'The principal received from the notification service.'], 'EventEndpointCreated' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointCreated event notifications should be sent.'], 'EventEndpointUpdated' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointUpdated event notifications should be sent.'], 'EventEndpointDeleted' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointDeleted event notifications should be sent.'], 'EventDeliveryFailure' => ['type' => 'string', 'description' => 'Topic ARN to which DeliveryFailure event notifications should be sent upon Direct Publish delivery failure (permanent) to one of the application\'s endpoints.']];
     $commonEndpointAttributes = ['CustomUserData' => ['type' => 'string', 'description' => 'Arbitrary user data to associate with the endpoint.'], 'Enabled' => ['type' => 'boolean', 'description' => 'The flag that enables/disables delivery to the endpoint.'], 'Token' => ['type' => 'string', 'description' => 'The device token, also referred to as a registration id, for an app and mobile device.']];
     $models = ['GetTopicsResponse' => ['id' => 'GetTopicsResponse', 'properties' => ['resource' => ['type' => 'Array', 'description' => 'An array of identifying attributes for a topic, use either in requests.', 'items' => ['$ref' => 'TopicIdentifier']]]], 'TopicRequest' => ['id' => 'TopicRequest', 'properties' => ['Name' => ['type' => 'string', 'description' => 'The name of the topic you want to create.', 'required' => true]]], 'TopicIdentifier' => ['id' => 'TopicIdentifier', 'properties' => ['Topic' => ['type' => 'string', 'description' => 'The topic\'s simplified name.'], 'TopicArn' => ['type' => 'string', 'description' => 'The topic\'s Amazon Resource Name.']]], 'TopicAttributesResponse' => ['id' => 'TopicAttributesResponse', 'properties' => ['Topic' => ['type' => 'string', 'description' => 'The topic\'s simplified name.'], 'TopicArn' => ['type' => 'string', 'description' => 'The topic\'s Amazon Resource Name.'], 'Owner' => ['type' => 'string', 'description' => 'The AWS account ID of the topic\'s owner.'], 'Policy' => ['type' => 'string', 'description' => 'The JSON serialization of the topic\'s access control policy.'], 'DisplayName' => ['type' => 'string', 'description' => 'The human-readable name used in the "From" field for notifications to email and email-json endpoints.'], 'SubscriptionsPending' => ['type' => 'string', 'description' => 'The number of subscriptions pending confirmation on this topic.'], 'SubscriptionsConfirmed' => ['type' => 'string', 'description' => 'The number of confirmed subscriptions on this topic.'], 'SubscriptionsDeleted' => ['type' => 'string', 'description' => 'The number of deleted subscriptions on this topic.'], 'DeliveryPolicy' => ['type' => 'string', 'description' => 'The JSON serialization of the topic\'s delivery policy.'], 'EffectiveDeliveryPolicy' => ['type' => 'string', 'description' => 'The JSON serialization of the effective delivery policy that takes into account system defaults.']]], 'TopicAttributesRequest' => ['id' => 'TopicAttributesRequest', 'properties' => ['AttributeName' => ['type' => 'string', 'description' => 'The name of the attribute you want to set.', 'enum' => ['Policy', 'DisplayName', 'DeliveryPolicy'], 'default' => 'DisplayName', 'required' => true], 'AttributeValue' => ['type' => 'string', 'description' => 'The value of the attribute you want to set.']]], 'GetSubscriptionsResponse' => ['id' => 'GetSubscriptionsResponse', 'properties' => ['resource' => ['type' => 'Array', 'description' => 'An array of identifying attributes for a subscription, use either in requests.', 'items' => ['$ref' => 'SubscriptionIdentifier']]]], 'SubscriptionRequest' => ['id' => 'SubscriptionRequest', 'properties' => ['Topic' => ['type' => 'string', 'description' => 'The topic\'s simplified name or Amazon Resource Name.', 'required' => true], 'Protocol' => ['type' => 'string', 'description' => 'The protocol you want to use.', 'enum' => ['http', 'https', 'email', 'email-json', 'sms', 'sqs', 'application'], 'required' => true], 'Endpoint' => ['type' => 'string', 'description' => 'The endpoint that you want to receive notifications, formats vary by protocol.']]], 'SubscriptionTopicRequest' => ['id' => 'SubscriptionTopicRequest', 'properties' => ['Protocol' => ['type' => 'string', 'description' => 'The protocol you want to use.', 'enum' => ['http', 'https', 'email', 'email-json', 'sms', 'sqs', 'application'], 'required' => true], 'Endpoint' => ['type' => 'string', 'description' => 'The endpoint that you want to receive notifications, formats vary by protocol.']]], 'SubscriptionIdentifier' => ['id' => 'SubscriptionIdentifier', 'properties' => ['Subscription' => ['type' => 'string', 'description' => 'The subscription\'s simplified name.'], 'SubscriptionArn' => ['type' => 'string', 'description' => 'The subscription\'s Amazon Resource Name.']]], 'SubscriptionAttributesResponse' => ['id' => 'SubscriptionAttributesResponse', 'properties' => ['Subscription' => ['type' => 'string', 'description' => 'The subscription\'s simplified name.'], 'SubscriptionArn' => ['type' => 'string', 'description' => 'The subscription\'s Amazon Resource Name.'], 'TopicArn' => ['type' => 'string', 'description' => 'The topic\'s Amazon Resource Name.'], 'Owner' => ['type' => 'string', 'description' => 'The AWS account ID of the topic\'s owner.'], 'ConfirmationWasAuthenticated' => ['type' => 'boolean', 'description' => 'True if the subscription confirmation request was authenticated.'], 'DeliveryPolicy' => ['type' => 'string', 'description' => 'The JSON serialization of the topic\'s delivery policy.'], 'EffectiveDeliveryPolicy' => ['type' => 'string', 'description' => 'The JSON serialization of the effective delivery policy that takes into account system defaults.']]], 'SubscriptionAttributesRequest' => ['id' => 'SubscriptionAttributesRequest', 'properties' => ['AttributeName' => ['type' => 'string', 'description' => 'The name of the attribute you want to set.', 'enum' => ['DeliveryPolicy', 'RawMessageDelivery'], 'default' => 'DeliveryPolicy', 'required' => true], 'AttributeValue' => ['type' => 'string', 'description' => 'The value of the attribute you want to set.']]], 'GetAppResponse' => ['id' => 'GetAppResponse', 'properties' => ['resource' => ['type' => 'Array', 'description' => 'An array of identifying attributes for a app, use either in requests.', 'items' => ['$ref' => 'AppIdentifier']]]], 'AppAttributes' => ['id' => 'AppAttributes', 'properties' => $commonAppAttributes], 'AppRequest' => ['id' => 'AppRequest', 'properties' => ['Name' => ['type' => 'string', 'description' => 'Desired platform application name.', 'required' => true], 'Platform' => ['type' => 'string', 'description' => 'One of the following supported platforms.', 'enum' => ['ADM', 'APNS', 'APNS_SANDBOX', 'GCM'], 'required' => true], 'Attributes' => ['type' => 'AppAttributes', 'description' => 'An array of key-value pairs containing platform-specified application attributes.']]], 'AppIdentifier' => ['id' => 'AppIdentifier', 'properties' => ['Application' => ['type' => 'string', 'description' => 'The app\'s simplified name.'], 'PlatformApplicationArn' => ['type' => 'string', 'description' => 'The app\'s Amazon Resource Name.']]], 'AppAttributesResponse' => ['id' => 'AppAttributesResponse', 'properties' => ['Application' => ['type' => 'string', 'description' => 'The app\'s simplified name.'], 'PlatformApplicationArn' => ['type' => 'string', 'description' => 'The app\'s Amazon Resource Name.'], 'EventEndpointCreated' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointCreated event notifications should be sent.'], 'EventEndpointUpdated' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointUpdated event notifications should be sent.'], 'EventEndpointDeleted' => ['type' => 'string', 'description' => 'Topic ARN to which EndpointDeleted event notifications should be sent.'], 'EventDeliveryFailure' => ['type' => 'string', 'description' => 'Topic ARN to which DeliveryFailure event notifications should be sent upon Direct Publish delivery failure (permanent) to one of the application\'s endpoints.']]], 'AppAttributesRequest' => ['id' => 'AppAttributesRequest', 'properties' => ['Attributes' => ['type' => 'AppAttributes', 'description' => 'Mutable attributes on the endpoint.', 'required' => true]]], 'GetEndpointsResponse' => ['id' => 'GetEndpointsResponse', 'properties' => ['resource' => ['type' => 'Array', 'description' => 'An array of identifying attributes for a topic, use either in requests.', 'items' => ['$ref' => 'EndpointIdentifier']]]], 'AppEndpointRequest' => ['id' => 'AppEndpointRequest', 'properties' => ['Token' => ['type' => 'string', 'description' => 'Unique identifier created by the notification service for an app on a device.', 'required' => true], 'CustomUserData' => ['type' => 'string', 'description' => 'Arbitrary user data to associate with the endpoint.'], 'Attributes' => ['type' => 'Array', 'description' => 'An array of key-value pairs containing endpoint attributes.', 'items' => ['$ref' => 'MessageAttribute']]]], 'EndpointRequest' => ['id' => 'EndpointRequest', 'properties' => ['Application' => ['type' => 'string', 'description' => 'The application\'s simplified name or Amazon Resource Name.', "required" => true], 'Token' => ['type' => 'string', 'description' => 'Unique identifier created by the notification service for an app on a device.', 'required' => true], 'CustomUserData' => ['type' => 'string', 'description' => 'Arbitrary user data to associate with the endpoint.'], 'Attributes' => ['type' => 'Array', 'description' => 'An array of key-value pairs containing endpoint attributes.', 'items' => ['$ref' => 'MessageAttribute']]]], 'EndpointIdentifier' => ['id' => 'EndpointIdentifier', 'properties' => ['Endpoint' => ['type' => 'string', 'description' => 'The endpoint\'s simplified name.'], 'EndpointArn' => ['type' => 'string', 'description' => 'The endpoint\'s Amazon Resource Name.']]], 'EndpointAttributesResponse' => ['id' => 'EndpointAttributesResponse', 'properties' => ['Endpoint' => ['type' => 'string', 'description' => 'The endpoint\'s simplified name.'], 'EndpointArn' => ['type' => 'string', 'description' => 'The endpoint\'s Amazon Resource Name.'], 'CustomUserData' => ['type' => 'string', 'description' => 'Arbitrary user data to associate with the endpoint.'], 'Enabled' => ['type' => 'boolean', 'description' => 'The flag that enables/disables delivery to the endpoint.'], 'Token' => ['type' => 'string', 'description' => 'The device token, also referred to as a registration id, for an app and mobile device.']]], 'EndpointAttributes' => ['id' => 'EndpointAttributes', 'properties' => $commonEndpointAttributes], 'EndpointAttributesRequest' => ['id' => 'EndpointAttributesRequest', 'properties' => ['Attributes' => ['type' => 'EndpointAttributes', 'description' => 'Mutable attributes on the endpoint.', 'required' => true]]], 'TopicMessage' => ['id' => 'TopicMessage', 'properties' => ['default' => ['type' => 'string', 'description' => 'This is sent when the message type is not specified below.', 'required' => true], 'email' => ['type' => 'string', 'description' => 'Message sent to all email or email-json subscriptions.'], 'sqs' => ['type' => 'string', 'description' => 'Message sent to all AWS SQS subscriptions.'], 'http' => ['type' => 'string', 'description' => 'Message sent to all HTTP subscriptions.'], 'https' => ['type' => 'string', 'description' => 'Message sent to all HTTPS subscriptions.'], 'sms' => ['type' => 'string', 'description' => 'Message sent to all SMS subscriptions.'], 'APNS' => ['type' => 'string', 'description' => '{\\"aps\\":{\\"alert\\": \\"ENTER YOUR MESSAGE\\",\\"sound\\":\\"default\\"} }'], 'GCM' => ['type' => 'string', 'description' => '{ \\"data\\": { \\"message\\": \\"ENTER YOUR MESSAGE\\" } }'], 'ADM' => ['type' => 'string', 'description' => '{ \\"data\\": { \\"message\\": \\"ENTER YOUR MESSAGE\\" } }'], 'BAIDU' => ['type' => 'string', 'description' => '{\\"title\\":\\"ENTER YOUR TITLE\\",\\"description\\":\\"ENTER YOUR DESCRIPTION\\"}'], 'MPNS' => ['type' => 'string', 'description' => '<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?><wp:Notification xmlns:wp=\\"WPNotification\\"><wp:Tile><wp:Count>ENTER COUNT</wp:Count><wp:Title>ENTER YOUR MESSAGE</wp:Title></wp:Tile></wp:Notification>'], 'WNS' => ['type' => 'string', 'description' => '<badge version=\\"1\\" value=\\"23\\"/>']]], 'MessageAttributeData' => ['id' => 'MessageAttributeData', 'properties' => ['DataType' => ['type' => 'string', 'description' => 'Amazon SNS supports the following logical data types: String, Number, and Binary.', 'required' => true], 'StringValue' => ['type' => 'string', 'description' => 'Strings are Unicode with UTF8 binary encoding.'], 'BinaryValue' => ['type' => 'string', 'description' => 'Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images.']]], 'MessageAttribute' => ['id' => 'MessageAttribute', 'properties' => ['_user_defined_name_' => ['type' => 'MessageAttributeData', 'description' => 'The name of the message attribute as defined by the user or specified platform.']]], 'SimplePublishRequest' => ['id' => 'SimplePublishRequest', 'properties' => ['Topic' => ['type' => 'string', 'description' => 'The simple name or ARN of the topic you want to publish to. Required if endpoint not given.'], 'Endpoint' => ['type' => 'string', 'description' => 'The simple name or ARN of the endpoint you want to publish to. Required if topic not given.'], 'Message' => ['type' => 'string', 'description' => 'The message you want to send to the topic, sends the same message to all transport protocols. '], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'PublishRequest' => ['id' => 'PublishRequest', 'properties' => ['Topic' => ['type' => 'string', 'description' => 'The simple name or ARN of the topic you want to publish to. Required if endpoint not given.'], 'Endpoint' => ['type' => 'string', 'description' => 'The simple name or ARN of the endpoint you want to publish to. Required if topic not given.'], 'Message' => ['type' => 'TopicMessage', 'description' => 'The message you want to send to the topic. The \'default\' field is required.', 'required' => true], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageStructure' => ['type' => 'string', 'description' => 'Set MessageStructure to "json".', 'default' => 'json'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'SimplePublishTopicRequest' => ['id' => 'SimplePublishTopicRequest', 'properties' => ['Message' => ['type' => 'string', 'description' => 'The message you want to send to the topic, sends the same message to all transport protocols.'], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'PublishTopicRequest' => ['id' => 'PublishTopicRequest', 'properties' => ['Message' => ['type' => 'TopicMessage', 'description' => 'The message you want to send to the topic. The \'default\' field is required.', 'required' => true], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageStructure' => ['type' => 'string', 'description' => 'Set MessageStructure to "json".', 'default' => 'json'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'SimplePublishEndpointRequest' => ['id' => 'SimplePublishEndpointRequest', 'properties' => ['Message' => ['type' => 'string', 'description' => 'The message you want to send to the topic, sends the same message to all transport protocols.'], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'PublishEndpointRequest' => ['id' => 'PublishEndpointRequest', 'properties' => ['Message' => ['type' => 'TopicMessage', 'description' => 'The message you want to send to the topic. The \'default\' field is required.', 'required' => true], 'Subject' => ['type' => 'string', 'description' => 'Optional parameter to be used as the "Subject" line when the message is delivered to email endpoints.'], 'MessageStructure' => ['type' => 'string', 'description' => 'Set MessageStructure to "json".', 'default' => 'json'], 'MessageAttributes' => ['type' => 'MessageAttribute', 'description' => 'An associative array of string-data pairs containing user-specified message attributes.']]], 'PublishResponse' => ['id' => 'PublishResponse', 'properties' => ['MessageId' => ['type' => 'string', 'description' => 'Unique identifier assigned to the published message.']]]];
     $base['apis'] = array_merge($base['apis'], $apis);
     $base['models'] = array_merge($base['models'], $models);
     return $base;
 }
Example #11
0
 public function getApiDocInfo()
 {
     $base = parent::getApiDocInfo();
     $base['apis'] = [['path' => '/' . $this->name, 'operations' => [['method' => 'POST', 'summary' => 'sendEmail() - Send an email created from posted data and/or a template.', 'nickname' => 'sendEmail', 'type' => 'EmailResponse', 'event_name' => 'email.sent', 'parameters' => [['name' => 'template', 'description' => 'Optional template name to base email on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'template_id', 'description' => 'Optional template id to base email on.', 'allowMultiple' => false, 'type' => 'integer', 'format' => 'int32', 'paramType' => 'query', 'required' => false], ['name' => 'data', 'description' => 'Data containing name-value pairs used for provisioning emails.', 'allowMultiple' => false, 'type' => 'EmailRequest', 'paramType' => 'body', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses(), 'notes' => 'If a template is not used with all required fields, then they must be included in the request. ' . 'If the \'from\' address is not provisioned in the service, then it must be included in the request.']], 'description' => 'Operations on a email service.']];
     $models = ['EmailResponse' => ['id' => 'EmailResponse', 'properties' => ['count' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Number of emails successfully sent.']]], 'EmailRequest' => ['id' => 'EmailRequest', 'properties' => ['template' => ['type' => 'string', 'description' => 'Email Template name to base email on.'], 'template_id' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Email Template id to base email on.'], 'to' => ['type' => 'Array', 'description' => 'Required single or multiple receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'cc' => ['type' => 'Array', 'description' => 'Optional CC receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'bcc' => ['type' => 'Array', 'description' => 'Optional BCC receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'subject' => ['type' => 'string', 'description' => 'Text only subject line.'], 'body_text' => ['type' => 'string', 'description' => 'Text only version of the body.'], 'body_html' => ['type' => 'string', 'description' => 'Escaped HTML version of the body.'], 'from_name' => ['type' => 'string', 'description' => 'Required sender name.'], 'from_email' => ['type' => 'string', 'description' => 'Required sender email.'], 'reply_to_name' => ['type' => 'string', 'description' => 'Optional reply to name.'], 'reply_to_email' => ['type' => 'string', 'description' => 'Optional reply to email.']]], 'EmailAddress' => ['id' => 'EmailAddress', 'properties' => ['name' => ['type' => 'string', 'description' => 'Optional name displayed along with the email address.'], 'email' => ['type' => 'string', 'description' => 'Required email address.']]]];
     $base['models'] = array_merge($base['models'], $models);
     return $base;
 }
Example #12
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()];
 }
Example #13
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->name;
     $eventPath = $this->name;
     $apis = [['path' => $path, 'operations' => [['method' => 'GET', 'summary' => 'getApiDocs() - Retrieve the base Swagger document.', 'nickname' => 'getApiDocs', 'type' => 'ApiDocsResponse', 'event_name' => $eventPath . '.list', 'consumes' => ['application/json', 'application/xml', 'text/csv'], 'produces' => ['application/json', 'application/xml', 'text/csv'], 'parameters' => [['name' => 'file', 'description' => 'Download the results of the request as a file.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => 'This returns the base Swagger file containing all API services.']], 'description' => 'Operations for retrieving API documents.'], ['path' => $path . '/{id}', 'operations' => [['method' => 'GET', 'summary' => 'getApiDoc() - Retrieve one API document.', 'nickname' => 'getApiDoc', 'type' => 'ApiDocResponse', 'event_name' => $eventPath . '.read', 'parameters' => [['name' => 'id', 'description' => 'Identifier of the API document to retrieve.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => ApiDocUtilities::getCommonResponses([400, 401, 500]), 'notes' => '']], 'description' => 'Operations for individual API documents.']];
     $models = ['ApiDocsResponse' => ['id' => 'ApiDocsResponse', 'properties' => ['apiVersion' => ['type' => 'string', 'description' => 'Version of the API.'], 'swaggerVersion' => ['type' => 'string', 'description' => 'Version of the Swagger API.'], 'apis' => ['type' => 'array', 'description' => 'Array of APIs.', 'items' => ['$ref' => 'Api']]]], 'ApiDocResponse' => ['id' => 'ApiDocResponse', 'properties' => ['apiVersion' => ['type' => 'string', 'description' => 'Version of the API.'], 'swaggerVersion' => ['type' => 'string', 'description' => 'Version of the Swagger API.'], 'basePath' => ['type' => 'string', 'description' => 'Base path of the API.'], 'apis' => ['type' => 'array', 'description' => 'Array of APIs.', 'items' => ['$ref' => 'Api']], 'models' => ['type' => 'array', 'description' => 'Array of API models.', 'items' => ['$ref' => 'Model']]]], 'Api' => ['id' => 'Api', 'properties' => ['path' => ['type' => 'string', 'description' => 'Path to access the API.'], 'description' => ['type' => 'string', 'description' => 'Description of the API.']]], 'Model' => ['id' => 'Model', 'properties' => ['__name__' => ['type' => 'string', 'description' => 'Model Definition.']]]];
     return ['apis' => $apis, 'models' => $models];
 }
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $base = parent::getApiDocInfo();
     $tables = $this->listResources();
     $commonResponses = ApiDocUtilities::getCommonResponses();
     $apis = [['path' => $path, 'description' => 'Operations available for SQL DB Schemas.', 'operations' => [['method' => 'POST', 'summary' => 'createTables() - Create one or more tables.', 'nickname' => 'createTables', 'type' => 'Resources', 'event_name' => $eventPath . '.create', 'parameters' => [['name' => 'tables', 'description' => 'Array of table definitions.', 'allowMultiple' => false, 'type' => 'TableSchemas', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be a single table definition or an array of table definitions.'], ['method' => 'PUT', 'summary' => 'replaceTables() - Update (replace) one or more tables.', 'nickname' => 'replaceTables', 'event_name' => $eventPath . '.alter', 'type' => 'Resources', 'parameters' => [['name' => 'tables', 'description' => 'Array of table definitions.', 'allowMultiple' => false, 'type' => 'TableSchemas', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be a single table definition or an array of table definitions.'], ['method' => 'PATCH', 'summary' => 'updateTables() - Update (patch) one or more tables.', 'nickname' => 'updateTables', 'event_name' => $eventPath . '.alter', 'type' => 'Resources', 'parameters' => [['name' => 'tables', 'description' => 'Array of table definitions.', 'allowMultiple' => false, 'type' => 'TableSchemas', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be a single table definition or an array of table definitions.']]], ['path' => $path . '/{table_name}', 'description' => 'Operations for per table administration.', 'operations' => [['method' => 'GET', 'summary' => 'describeTable() - Retrieve table definition for the given table.', 'nickname' => 'describeTable', 'event_name' => [$eventPath . '.{table_name}.describe', $eventPath . '.table_described'], 'type' => 'TableSchema', 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'refresh', 'description' => 'Refresh any cached copy of the schema.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'This describes the table, its fields and relations to other tables.'], ['method' => 'POST', 'summary' => 'createTable() - Create a table with the given properties and fields.', 'nickname' => 'createTable', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.create', $eventPath . '.table_created'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'schema', 'description' => 'Array of table properties and fields definitions.', 'allowMultiple' => false, 'type' => 'TableSchema', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be an array of field properties for a single record or an array of fields.'], ['method' => 'PUT', 'summary' => 'replaceTable() - Update (replace) a table with the given properties.', 'nickname' => 'replaceTable', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.alter', $eventPath . '.table_altered'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'schema', 'description' => 'Array of field definitions.', 'allowMultiple' => false, 'type' => 'TableSchema', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be an array of field properties for a single record or an array of fields.'], ['method' => 'PATCH', 'summary' => 'updateTable() - Update (patch) a table with the given properties.', 'nickname' => 'updateTable', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.alter', $eventPath . '.table_altered'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'schema', 'description' => 'Array of field definitions.', 'allowMultiple' => false, 'type' => 'TableSchema', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be an array of field properties for a single record or an array of fields.'], ['method' => 'DELETE', 'summary' => 'deleteTable() - Delete (aka drop) the given table.', 'nickname' => 'deleteTable', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.drop', $eventPath . '.table_dropped'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables]], 'responseMessages' => $commonResponses, 'notes' => 'Careful, this drops the database table and all of its contents.']]], ['path' => $path . '/{table_name}/{field_name}', 'description' => 'Operations for single field administration.', 'operations' => [['method' => 'GET', 'summary' => 'describeField() - Retrieve the definition of the given field for the given table.', 'nickname' => 'describeField', 'type' => 'FieldSchema', 'event_name' => [$eventPath . '.{table_name}.{field_name}.describe', $eventPath . '.{table_name}.field_described'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'field_name', 'description' => 'Name of the field to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'refresh', 'description' => 'Refresh any cached copy of the schema.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]], 'responseMessages' => $commonResponses, 'notes' => 'This describes the field and its properties.'], ['method' => 'PUT', 'summary' => 'replaceField() - Update one record by identifier.', 'nickname' => 'replaceField', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.{field_name}.alter', $eventPath . '.{table_name}.field_altered'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'field_name', 'description' => 'Name of the field to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'properties', 'description' => 'Array of field properties.', 'allowMultiple' => false, 'type' => 'FieldSchema', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be an array of field properties for the given field.'], ['method' => 'PATCH', 'summary' => 'updateField() - Update one record by identifier.', 'nickname' => 'updateField', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.{field_name}.alter', $eventPath . '.{table_name}.field_altered'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'field_name', 'description' => 'Name of the field to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'properties', 'description' => 'Array of field properties.', 'allowMultiple' => false, 'type' => 'FieldSchema', 'paramType' => 'body', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Post data should be an array of field properties for the given field.'], ['method' => 'DELETE', 'summary' => 'deleteField() - Remove the given field from the given table.', 'nickname' => 'deleteField', 'type' => 'Success', 'event_name' => [$eventPath . '.{table_name}.{field_name}.drop', $eventPath . '.{table_name}.field_dropped'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true, 'enum' => $tables], ['name' => 'field_name', 'description' => 'Name of the field to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true]], 'responseMessages' => $commonResponses, 'notes' => 'Careful, this drops the database table field/column and all of its contents.']]]];
     $base['apis'] = array_merge($base['apis'], $apis);
     return $base;
 }
Example #15
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()];
 }
Example #16
0
 public function getApiDocInfo()
 {
     $path = '/' . $this->getServiceName() . '/' . $this->getFullPathName();
     $eventPath = $this->getServiceName() . '.' . $this->getFullPathName('.');
     $base = parent::getApiDocInfo();
     $apis = [['path' => $path . '/{procedure_name}', 'operations' => [['method' => 'GET', 'summary' => 'callStoredProc() - Call a stored procedure.', 'nickname' => 'callStoredProc', 'notes' => 'Call a stored procedure with no parameters. ' . 'Set an optional wrapper for the returned data set. ', 'type' => 'StoredProcResponse', 'event_name' => [$eventPath . '.{procedure_name}.call', $eventPath . '.procedure_called'], 'parameters' => [['name' => 'procedure_name', 'description' => 'Name of the stored procedure to call.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'wrapper', 'description' => 'Add this wrapper around the expected data set before returning.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'returns', 'description' => 'If returning a single value, use this to set the type of that value.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses()], ['method' => 'POST', 'summary' => 'callStoredProcWithParams() - Call a stored procedure.', 'nickname' => 'callStoredProcWithParams', 'notes' => 'Call a stored procedure with parameters. ' . 'Set an optional wrapper and schema for the returned data set. ', 'type' => 'StoredProcResponse', 'event_name' => [$eventPath . '.{procedure_name}.call', $eventPath . '.procedure_called'], 'parameters' => [['name' => 'procedure_name', 'description' => 'Name of the stored procedure to call.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing in and out parameters to pass to procedure.', 'allowMultiple' => false, 'type' => 'StoredProcRequest', 'paramType' => 'body', 'required' => true], ['name' => 'wrapper', 'description' => 'Add this wrapper around the expected data set before returning.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'returns', 'description' => 'If returning a single value, use this to set the type of that value.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false]], 'responseMessages' => ApiDocUtilities::getCommonResponses()]], 'description' => 'Operations for SQL database stored procedures.']];
     $models = ['StoredProcResponse' => ['id' => 'StoredProcResponse', 'properties' => ['_wrapper_if_supplied_' => ['type' => 'Array', 'description' => 'Array of returned data.', 'items' => ['type' => 'string']], '_out_param_name_' => ['type' => 'string', 'description' => 'Name and value of any given output parameter.']]], 'StoredProcRequest' => ['id' => 'StoredProcRequest', 'properties' => ['params' => ['type' => 'array', 'description' => 'Optional array of input and output parameters.', 'items' => ['$ref' => 'StoredProcParam']], 'schema' => ['type' => 'StoredProcResultSchema', 'description' => 'Optional name to type pairs to be applied to returned data.'], 'wrapper' => ['type' => 'string', 'description' => 'Add this wrapper around the expected data set before returning, same as URL parameter.'], 'returns' => ['type' => 'string', 'description' => 'If returning a single value, use this to set the type of that value, same as URL parameter.']]], 'StoredProcParam' => ['id' => 'StoredProcParam', 'properties' => ['name' => ['type' => 'string', 'description' => 'Name of the parameter, required for OUT and INOUT types, ' . 'must be the same as the stored procedure\'s parameter name.'], 'param_type' => ['type' => 'string', 'description' => 'Parameter type of IN, OUT, or INOUT, defaults to IN.'], 'value' => ['type' => 'string', 'description' => 'Value of the parameter, used for the IN and INOUT types, defaults to NULL.'], 'type' => ['type' => 'string', 'description' => 'For INOUT and OUT parameters, the requested type for the returned value, ' . 'i.e. integer, boolean, string, etc. Defaults to value type for INOUT and string for OUT.'], 'length' => ['type' => 'integer', 'format' => 'int32', 'description' => 'For INOUT and OUT parameters, the requested length for the returned value. ' . 'May be required by some database drivers.']]], 'StoredProcResultSchema' => ['id' => 'StoredProcResultSchema', 'properties' => ['_field_name_' => ['type' => 'string', 'description' => 'The name of the returned element where the value is set to the requested type ' . 'for the returned value, i.e. integer, boolean, string, etc.']]]];
     $base['apis'] = array_merge($base['apis'], $apis);
     $base['models'] = array_merge($base['models'], $models);
     return $base;
 }
 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;
 }
Example #18
0
 public function getApiDocInfo()
 {
     $commonResponses = ApiDocUtilities::getCommonResponses();
     $baseTableOps = [['method' => 'GET', 'summary' => 'getRecordsByView() - Retrieve one or more records by using a view.', 'nickname' => 'getRecordsByView', 'notes' => 'Use the <b>design</b> and <b>view</b> parameters to retrieve data according to a view.<br/> ' . 'Alternatively, to send the <b>design</b> and <b>view</b> with or without additional URL parameters as posted data ' . 'use the POST request with X-HTTP-METHOD = GET header.<br/> ' . 'Refer to http://docs.couchdb.org/en/latest/api/ddoc/views.html for additional allowed query parameters.<br/> ' . 'Use the <b>fields</b> parameter to limit properties returned for each resource. ' . 'By default, all fields are returned for all resources. ', 'type' => 'RecordsResponse', 'event_name' => ['{api_name}.{table_name}.select', '{api_name}.table_selected'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'design', 'description' => 'The design document name for the desired view.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => true], ['name' => 'view', 'description' => 'The view function name for the given design document.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => true], ['name' => 'limit', 'description' => 'Set to limit the view results.', 'allowMultiple' => false, 'type' => 'integer', 'format' => 'int32', 'paramType' => 'query', 'required' => false], ['name' => 'skip', 'description' => 'Set to offset the view results to a particular record count.', 'allowMultiple' => false, 'type' => 'integer', 'format' => 'int32', 'paramType' => 'query', 'required' => false], ['name' => 'reduce', 'description' => 'Use the reduce function. Default is true.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'include_docs', 'description' => 'Include the associated document with each row. Default is false. ' . 'If set to true, just the documents as a record array will be returned, like getRecordsByIds does.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'include_count', 'description' => 'Include the total number of view results as meta data.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses], ['method' => 'GET', 'summary' => 'getRecordsByIds() - Retrieve one or more records by identifiers.', 'nickname' => 'getRecordsByIds', 'notes' => 'Pass the identifying field values as a comma-separated list in the <b>ids</b> parameter.<br/> ' . 'Alternatively, to send the <b>ids</b> as posted data use the POST request with X-HTTP-METHOD = GET header and post array of ids.<br/> ' . 'Use the <b>fields</b> parameter to limit properties returned for each resource. ' . 'By default, all fields are returned for identified resources. ', 'type' => 'RecordsResponse', 'event_name' => ['{api_name}.{table_name}.select', '{api_name}.table_selected'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'ids', 'description' => 'Comma-delimited list of the identifiers of the resources to retrieve.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses], ['method' => 'POST', 'summary' => 'getRecordsByPost() - Retrieve one or more records by posting necessary data.', 'nickname' => 'getRecordsByPost', 'notes' => 'Post data should be an array of records wrapped in a <b>record</b> element - including the identifying fields at a minimum, ' . 'or a list of <b>ids</b> in a string list or an array.<br/> ' . 'Use the <b>fields</b> parameter to limit properties returned for each resource. ' . 'By default, all fields are returned for identified resources. ', 'type' => 'RecordsResponse', 'event_name' => ['{api_name}.{table_name}.select', '{api_name}.table_selected'], 'parameters' => [['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to retrieve.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'X-HTTP-METHOD', 'description' => 'Override request using POST to tunnel other http request, such as GET.', 'enum' => ['GET'], 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'header', 'required' => false]], 'responseMessages' => $commonResponses], ['method' => 'GET', 'summary' => 'getRecords() - Retrieve one or more records.', 'nickname' => 'getRecords', 'notes' => 'Use the <b>ids</b> parameter to limit resources that are returned.<br/> ' . 'Alternatively, to send the <b>ids</b> as posted data use the POST request with X-HTTP-METHOD = GET header.<br/> ' . 'Use the <b>fields</b> parameter to limit properties returned for each resource. ' . 'By default, all fields are returned for all resources. ', 'type' => 'RecordsResponse', 'event_name' => ['{api_name}.{table_name}.select', '{api_name}.table_selected'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'ids', 'description' => 'Comma-delimited list of the identifiers of the resources to retrieve.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'limit', 'description' => 'Set to limit the view results.', 'allowMultiple' => false, 'type' => 'integer', 'format' => 'int32', 'paramType' => 'query', 'required' => false], ['name' => 'offset', 'description' => 'Set to offset the view results to a particular record count.', 'allowMultiple' => false, 'type' => 'integer', 'format' => 'int32', 'paramType' => 'query', 'required' => false], ['name' => 'order', 'description' => 'SQL-like order containing field and direction for view results.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'include_count', 'description' => 'Include the total number of view results as meta data.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), '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' => ['{api_name}.{table_name}.insert', '{api_name}.table_inserted'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to create.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => 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], ['method' => 'PUT', 'summary' => 'replaceRecordsByIds() - Update (replace) one or more records.', 'nickname' => 'replaceRecordsByIds', 'notes' => '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/> ' . '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' => ['{api_name}.{table_name}.update', '{api_name}.table_updated'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'ids', 'description' => 'Comma-delimited list of the identifiers of the resources to modify.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', '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>record</b> tag.<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' => ['{api_name}.{table_name}.update', '{api_name}.table_updated'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses], ['method' => 'PATCH', 'summary' => 'updateRecordsByIds() - Update (patch) one or more records.', 'nickname' => 'updateRecordsByIds', 'notes' => '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/> ' . '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' => ['{api_name}.{table_name}.update', '{api_name}.table_updated'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'A single record containing name-value pairs of fields to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'ids', 'description' => 'Comma-delimited list of the identifiers of the resources to modify.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), '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/> ' . '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' => ['{api_name}.{table_name}.update', '{api_name}.table_updated'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses], ['method' => 'DELETE', 'summary' => 'deleteRecordsByIds() - Delete one or more records.', 'nickname' => 'deleteRecordsByIds', 'notes' => 'Use <b>ids</b> to delete specific records.<br/> ' . 'Alternatively, to delete by records, or a large list of ids, ' . 'use the POST request with X-HTTP-METHOD = DELETE header.<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' => ['{api_name}.{table_name}.delete', '{api_name}.table_deleted'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'ids', 'description' => 'Comma-delimited list of the identifiers of the resources to delete.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => true], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses], ['method' => 'DELETE', 'summary' => 'deleteRecords() - Delete one or more records.', 'nickname' => 'deleteRecords', 'notes' => 'Use <b>ids</b> to delete specific records, otherwise set <b>force</b> to true to clear the table.<br/> ' . 'Alternatively, to delete by records, or a large list of ids, ' . 'use the POST request with X-HTTP-METHOD = DELETE header.<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' => ['{api_name}.{table_name}.delete', '{api_name}.table_deleted'], 'parameters' => array_merge([['name' => 'table_name', 'description' => 'Name of the table to perform operations on.', 'allowMultiple' => false, 'type' => 'string', 'paramType' => 'path', 'required' => true], ['name' => 'body', 'description' => 'Data containing name-value pairs of records to update.', 'allowMultiple' => false, 'type' => 'RecordsRequest', 'paramType' => 'body', 'required' => true], ['name' => 'force', 'description' => 'Set force to true to delete all records in this table, otherwise <b>ids</b> parameter is required.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false, 'default' => false], ['name' => 'fields', 'description' => 'Comma-delimited list of field names to retrieve for each record, \'*\' to return all fields.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_field', 'description' => 'Single or comma-delimited list of the fields used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'id_type', 'description' => 'Single or comma-delimited list of the field types used as identifiers for the table, ' . 'used to override defaults or provide identifiers when none are provisioned.', 'allowMultiple' => true, 'type' => 'string', 'paramType' => 'query', 'required' => false], ['name' => 'continue', 'description' => 'In batch scenarios, where supported, continue processing even after one record fails. ' . 'Default behavior is to halt and return results up to the first point of failure.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false], ['name' => 'rollback', 'description' => 'In batch scenarios, where supported, rollback all changes if any record of the batch fails. ' . 'Default behavior is to halt and return results up to the first point of failure, leaving any changes.', 'allowMultiple' => false, 'type' => 'boolean', 'paramType' => 'query', 'required' => false]]), 'responseMessages' => $commonResponses]];
 }
Example #19
0
 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];
 }
Example #20
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;
 }