Tribe__Events__REST__V1__Endpoints__Single_Event::get_documentation()
Returns an array in the format used by Swagger 2.0.
While the structure must conform to that used by v2.0 of Swagger the structure can be that of a full document or that of a document part. The intelligence lies in the "gatherer" of information rather than in the single "providers" implementing this interface.
Return
(array) An array description of a Swagger supported component.
Source
File: src/Tribe/REST/V1/Endpoints/Single_Event.php
public function get_documentation() {
$GET_defaults = $DELETE_defaults = array( 'in' => 'query', 'default' => '', 'type' => 'string' );
$POST_defaults = array( 'in' => 'formData', 'default' => '', 'type' => 'string' );
$post_args = array_merge( $this->READ_args(), $this->CREATE_args() );
return array(
'get' => array(
'parameters' => $this->swaggerize_args( $this->READ_args(), $GET_defaults ),
'responses' => array(
'200' => array(
'description' => __( 'Returns the data of the event with the specified post ID', 'the-event-calendar' ),
'schema' => array(
'$ref' => '#/definitions/Event',
),
),
'400' => array(
'description' => __( 'The event post ID is missing.', 'the-events-calendar' ),
),
'403' => array(
'description' => __( 'The event with the specified ID is not accessible.', 'the-events-calendar' ),
),
'404' => array(
'description' => __( 'An event with the specified ID does not exist.', 'the-events-calendar' ),
),
),
),
'post' => array(
'consumes' => array( 'application/x-www-form-urlencoded' ),
'parameters' => $this->swaggerize_args( $post_args, $POST_defaults ),
'responses' => array(
'200' => array(
'description' => __( 'Returns the data of the updated event', 'the-event-calendar' ),
'schema' => array(
'$ref' => '#/definitions/Event',
),
),
'201' => array(
'description' => __( 'Returns the data of the created event', 'the-event-calendar' ),
'schema' => array(
'$ref' => '#/definitions/Event',
),
),
'400' => array(
'description' => __( 'A required parameter is missing or an input parameter is in the wrong format', 'the-events-calendar' ),
),
'403' => array(
'description' => __( 'The user is not authorized to create events', 'the-events-calendar' ),
),
),
),
'delete' => array(
'parameters' => $this->swaggerize_args( $this->DELETE_args(), $DELETE_defaults ),
'responses' => array(
'200' => array(
'description' => __( 'Deletes an event and returns its data', 'the-event-calendar' ),
'schema' => array(
'$ref' => '#/definitions/Event',
),
),
'400' => array(
'description' => __( 'The event post ID is missing or does not exist.', 'the-events-calendar' ),
),
'403' => array(
'description' => __( 'The current user cannot delete the event with the specified ID.', 'the-events-calendar' ),
),
'410' => array(
'description' => __( 'The event with the specified ID has been deleted already.', 'the-events-calendar' ),
),
'500' => array(
'description' => __( 'The event with the specified ID could not be deleted.', 'the-events-calendar' ),
),
),
),
);
}