From 012578c667b2c7090c47cffd582568d2a1d51d4d Mon Sep 17 00:00:00 2001 From: patelhir Date: Tue, 30 Aug 2016 10:24:28 +0530 Subject: [PATCH 1/8] Add files via upload --- service.php | 952 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 952 insertions(+) create mode 100644 service.php diff --git a/service.php b/service.php new file mode 100644 index 0000000..7b66154 --- /dev/null +++ b/service.php @@ -0,0 +1,952 @@ + '37signals Basecamp API', + 'serviceAbbreviation' => 'Basecamp API', + 'operations' => array( + 'getArchivedProjects' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/archived.json', + 'summary' => 'Get archived Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + ), + 'getProjects' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects.json', + 'summary' => 'Get active Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + ), + 'getProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{id}.json', + 'summary' => 'Get a Project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + 'parameters' => array( + 'id' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + + 'getSubscriptions' => array( + 'httpMethod' => 'GET', + 'uri' => 'buckets/{projectId}/recordings/{todoId}/subscription.json', + 'summary' => 'Get Subscription for given Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bc3-api/tree/master/sections)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + + ) + ), + + + 'getDocumentsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/documents.json', + 'summary' => 'Get all Documents' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getDocument' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/documents/{documentId}.json', + 'summary' => 'Get a Document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'documentId' => array( + 'location' => 'uri', + 'description' => 'Document ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTopicsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/topics.json', + 'summary' => 'Get Topics' . PHP_EOL . '[Basecamp API: Topics](https://github.com/basecamp/bcx-api/blob/master/sections/topics.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTodolistsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists.json', + 'summary' => 'Get Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAssignedTodolistsByPerson' => array( + 'httpMethod' => 'GET', + 'uri' => 'people/{personId}/assigned_todos.json', + 'summary' => 'Get Todo Lists assigned to a Person' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'personId' => array( + 'location' => 'uri', + 'description' => 'Person id', + 'type' => 'integer', + 'required' => true, + ), + 'page' => array( + 'location' => 'query', + 'description' => 'The page to retrieve. API returns 50 todos per page.', + 'type' => 'integer', + 'required' => false, + ), + 'due_since' => array( + 'location' => 'query', + 'description' => 'Will return all the to-do lists with to-dos assigned to the specified person due after the date specified. (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ) + ) + ), + 'getCompletedTodolistsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists/completed.json', + 'summary' => 'Get completed Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getCompletedTodosByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todos/completed.json', + 'summary' => 'Get completed Todos' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createProject' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects.json', + 'summary' => 'Create a new project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + 'parameters' => array( + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'createDocument' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/documents.json', + 'summary' => 'Create a new document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true + ), + 'title' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'createTodolistByProject' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todolists.json', + 'summary' => 'Create Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'description' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ) + ) + ), + 'createTodoByTodolist' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todolists/{todolistId}/todos.json', + 'summary' => 'Create Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todolistId' => array( + 'location' => 'uri', + 'description' => 'Todo list id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'assignee' => array( + 'location' => 'json', + 'type' => array( 'array', 'object' ), + 'required' => false, + ), + ) + ), + 'createCommentByTodo' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todos/{todoId}/comments.json', + 'summary' => 'Create Comment on Todo' . PHP_EOL . '[Basecamp API: Comments](https://github.com/basecamp/bcx-api/blob/master/sections/comments.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'attachments' => array( + 'location' => 'json', + 'type' => 'array', + 'required' => false, + ), + ) + ), + 'getAttachmentsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/attachments.json', + 'summary' => 'Get Attachments' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createAttachment' => array( + 'httpMethod' => 'POST', + 'uri' => 'attachments.json', + 'summary' => 'Create Attachment' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', + 'parameters' => array( + 'mimeType' => array( + 'location' => 'header', + 'sentAs' => 'Content-Type', + 'description' => 'The content type of the data', + 'type' => 'string', + 'required' => true, + ), + 'data' => array( + 'location' => 'body', + 'description' => 'The attachment\'s binary data', + 'type' => 'any', + 'required' => true, + ), + ) + ), + 'getTodolist' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists/{todolistId}.json', + 'summary' => 'Get Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todolistId' => array( + 'location' => 'uri', + 'description' => 'Todolist id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTodo' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todos/{todoId}.json', + 'summary' => 'Get Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'updateTodo' => array( + 'httpMethod' => 'PUT', + 'uri' => 'projects/{projectId}/todos/{todoId}.json', + 'summary' => 'Update Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + 'due_at' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + 'assignee' => array( + 'location' => 'json', + 'type' => array( 'array', 'object' ), + 'required' => false, + ), + 'completed' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + ) + ), + 'getCurrentUser' => array( + 'httpMethod' => 'GET', + 'uri' => 'people/me.json', + 'summary' => 'Get current User' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)', + ), + 'getGlobalEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'events.json', + 'summary' => 'Get global Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', + 'parameters' => array( + 'since' => array( + 'location' => 'query', + 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ), + 'page' => array( + 'location' => 'query', + 'description' => 'The page to retrieve. API returns 50 events per page.', + 'type' => 'integer', + 'required' => false, + ) + ) + ), + 'getProjectEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/events.json', + 'summary' => 'Get Project Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'since' => array( + 'location' => 'query', + 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ) + ) + ), + 'getAccessesByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/accesses.json', + 'summary' => 'Get Accesses to Project' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAccessesByCalendar' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/accesses.json', + 'summary' => 'Get Accesses to Calendar' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getPeople' => array( + 'httpMethod' => 'GET', + 'uri' => 'people.json', + 'summary' => 'Get all People' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)' + ), + 'getGroups' => array( + 'httpMethod' => 'GET', + 'uri' => 'groups.json', + 'summary' => 'Get all Groups' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/groups.md)' + ), + 'grantAccess' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/accesses.json', + 'summary' => 'Grant access' . PHP_EOL . '[Basecamp API: Access](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true + ), + 'ids' => array( + 'location' => 'json', + 'description' => 'Existing user ids', + 'type' => 'array', + 'required' => true + ), + 'email_addresses' => array( + 'location' => 'json', + 'description' => 'Grant access to new users', + 'type' => 'string', + 'required' => false + ) + ) + ), + 'getCalendars' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars.json', + 'summary' => 'Get all Calendars' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)' + ), + 'getCalendar' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Get single Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createCalendar' => array( + 'httpMethod' => 'POST', + 'uri' => 'calendars.json', + 'summary' => 'Create new Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'updateCalendar' => array( + 'httpMethod' => 'PUT', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Update Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'deleteCalendar' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Delete Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAllCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendar_events.json', + 'summary' => 'Get all events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events.json', + 'summary' => 'Get upcoming calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getCalendarEventsPast' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events/past.json', + 'summary' => 'Get past calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getCalendarEvent' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Get single calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createCalendarEvent' => array( + 'httpMethod' => 'POST', + 'uri' => 'calendars/{calendarId}/calendar_events.json', + 'summary' => 'Create calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string', + 'required' => true + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'updateCalendarEvent' => array( + 'httpMethod' => 'PUT', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Update a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string' + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'deleteCalendarEvent' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Delete a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getProjectCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events.json', + 'summary' => 'Get upcoming project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getProjectCalendarEventsPast' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events/past.json', + 'summary' => 'Get past project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getProjectCalendarEvent' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Get single project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createProjectCalendarEvent' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/calendar_events.json', + 'summary' => 'Create project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string', + 'required' => true + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'updateProjectCalendarEvent' => array( + 'httpMethod' => 'PUT', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Update a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string' + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'deleteProjectCalendarEvent' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Delete a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ) + ) +); From 978958a9157b1de028bd4af2e1c15794adc4dd4f Mon Sep 17 00:00:00 2001 From: patelhir Date: Tue, 30 Aug 2016 10:25:03 +0530 Subject: [PATCH 2/8] Delete service.php --- service.php | 952 ---------------------------------------------------- 1 file changed, 952 deletions(-) delete mode 100644 service.php diff --git a/service.php b/service.php deleted file mode 100644 index 7b66154..0000000 --- a/service.php +++ /dev/null @@ -1,952 +0,0 @@ - '37signals Basecamp API', - 'serviceAbbreviation' => 'Basecamp API', - 'operations' => array( - 'getArchivedProjects' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/archived.json', - 'summary' => 'Get archived Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - ), - 'getProjects' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects.json', - 'summary' => 'Get active Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - ), - 'getProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{id}.json', - 'summary' => 'Get a Project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - 'parameters' => array( - 'id' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - - 'getSubscriptions' => array( - 'httpMethod' => 'GET', - 'uri' => 'buckets/{projectId}/recordings/{todoId}/subscription.json', - 'summary' => 'Get Subscription for given Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bc3-api/tree/master/sections)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - - ) - ), - - - 'getDocumentsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/documents.json', - 'summary' => 'Get all Documents' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getDocument' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/documents/{documentId}.json', - 'summary' => 'Get a Document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - 'documentId' => array( - 'location' => 'uri', - 'description' => 'Document ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTopicsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/topics.json', - 'summary' => 'Get Topics' . PHP_EOL . '[Basecamp API: Topics](https://github.com/basecamp/bcx-api/blob/master/sections/topics.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTodolistsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists.json', - 'summary' => 'Get Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAssignedTodolistsByPerson' => array( - 'httpMethod' => 'GET', - 'uri' => 'people/{personId}/assigned_todos.json', - 'summary' => 'Get Todo Lists assigned to a Person' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'personId' => array( - 'location' => 'uri', - 'description' => 'Person id', - 'type' => 'integer', - 'required' => true, - ), - 'page' => array( - 'location' => 'query', - 'description' => 'The page to retrieve. API returns 50 todos per page.', - 'type' => 'integer', - 'required' => false, - ), - 'due_since' => array( - 'location' => 'query', - 'description' => 'Will return all the to-do lists with to-dos assigned to the specified person due after the date specified. (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ) - ) - ), - 'getCompletedTodolistsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists/completed.json', - 'summary' => 'Get completed Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getCompletedTodosByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todos/completed.json', - 'summary' => 'Get completed Todos' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createProject' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects.json', - 'summary' => 'Create a new project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - 'parameters' => array( - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'createDocument' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/documents.json', - 'summary' => 'Create a new document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true - ), - 'title' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'createTodolistByProject' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todolists.json', - 'summary' => 'Create Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'description' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ) - ) - ), - 'createTodoByTodolist' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todolists/{todolistId}/todos.json', - 'summary' => 'Create Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todolistId' => array( - 'location' => 'uri', - 'description' => 'Todo list id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'assignee' => array( - 'location' => 'json', - 'type' => array( 'array', 'object' ), - 'required' => false, - ), - ) - ), - 'createCommentByTodo' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todos/{todoId}/comments.json', - 'summary' => 'Create Comment on Todo' . PHP_EOL . '[Basecamp API: Comments](https://github.com/basecamp/bcx-api/blob/master/sections/comments.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'attachments' => array( - 'location' => 'json', - 'type' => 'array', - 'required' => false, - ), - ) - ), - 'getAttachmentsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/attachments.json', - 'summary' => 'Get Attachments' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createAttachment' => array( - 'httpMethod' => 'POST', - 'uri' => 'attachments.json', - 'summary' => 'Create Attachment' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', - 'parameters' => array( - 'mimeType' => array( - 'location' => 'header', - 'sentAs' => 'Content-Type', - 'description' => 'The content type of the data', - 'type' => 'string', - 'required' => true, - ), - 'data' => array( - 'location' => 'body', - 'description' => 'The attachment\'s binary data', - 'type' => 'any', - 'required' => true, - ), - ) - ), - 'getTodolist' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists/{todolistId}.json', - 'summary' => 'Get Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todolistId' => array( - 'location' => 'uri', - 'description' => 'Todolist id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTodo' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todos/{todoId}.json', - 'summary' => 'Get Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'updateTodo' => array( - 'httpMethod' => 'PUT', - 'uri' => 'projects/{projectId}/todos/{todoId}.json', - 'summary' => 'Update Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - 'due_at' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - 'assignee' => array( - 'location' => 'json', - 'type' => array( 'array', 'object' ), - 'required' => false, - ), - 'completed' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - ) - ), - 'getCurrentUser' => array( - 'httpMethod' => 'GET', - 'uri' => 'people/me.json', - 'summary' => 'Get current User' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)', - ), - 'getGlobalEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'events.json', - 'summary' => 'Get global Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', - 'parameters' => array( - 'since' => array( - 'location' => 'query', - 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ), - 'page' => array( - 'location' => 'query', - 'description' => 'The page to retrieve. API returns 50 events per page.', - 'type' => 'integer', - 'required' => false, - ) - ) - ), - 'getProjectEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/events.json', - 'summary' => 'Get Project Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'since' => array( - 'location' => 'query', - 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ) - ) - ), - 'getAccessesByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/accesses.json', - 'summary' => 'Get Accesses to Project' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAccessesByCalendar' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/accesses.json', - 'summary' => 'Get Accesses to Calendar' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getPeople' => array( - 'httpMethod' => 'GET', - 'uri' => 'people.json', - 'summary' => 'Get all People' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)' - ), - 'getGroups' => array( - 'httpMethod' => 'GET', - 'uri' => 'groups.json', - 'summary' => 'Get all Groups' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/groups.md)' - ), - 'grantAccess' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/accesses.json', - 'summary' => 'Grant access' . PHP_EOL . '[Basecamp API: Access](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true - ), - 'ids' => array( - 'location' => 'json', - 'description' => 'Existing user ids', - 'type' => 'array', - 'required' => true - ), - 'email_addresses' => array( - 'location' => 'json', - 'description' => 'Grant access to new users', - 'type' => 'string', - 'required' => false - ) - ) - ), - 'getCalendars' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars.json', - 'summary' => 'Get all Calendars' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)' - ), - 'getCalendar' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Get single Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createCalendar' => array( - 'httpMethod' => 'POST', - 'uri' => 'calendars.json', - 'summary' => 'Create new Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'updateCalendar' => array( - 'httpMethod' => 'PUT', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Update Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'deleteCalendar' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Delete Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAllCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendar_events.json', - 'summary' => 'Get all events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events.json', - 'summary' => 'Get upcoming calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getCalendarEventsPast' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events/past.json', - 'summary' => 'Get past calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getCalendarEvent' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Get single calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createCalendarEvent' => array( - 'httpMethod' => 'POST', - 'uri' => 'calendars/{calendarId}/calendar_events.json', - 'summary' => 'Create calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string', - 'required' => true - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'updateCalendarEvent' => array( - 'httpMethod' => 'PUT', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Update a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string' - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'deleteCalendarEvent' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Delete a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getProjectCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events.json', - 'summary' => 'Get upcoming project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getProjectCalendarEventsPast' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events/past.json', - 'summary' => 'Get past project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getProjectCalendarEvent' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Get single project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createProjectCalendarEvent' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/calendar_events.json', - 'summary' => 'Create project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string', - 'required' => true - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'updateProjectCalendarEvent' => array( - 'httpMethod' => 'PUT', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Update a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string' - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'deleteProjectCalendarEvent' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Delete a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ) - ) -); From b98fa0b7850edd1f0a867b3943244c525b90b66c Mon Sep 17 00:00:00 2001 From: patelhir Date: Tue, 30 Aug 2016 10:25:30 +0530 Subject: [PATCH 3/8] Add files via upload --- src/Basecamp/Resources/service.php | 1881 ++++++++++++++-------------- 1 file changed, 952 insertions(+), 929 deletions(-) diff --git a/src/Basecamp/Resources/service.php b/src/Basecamp/Resources/service.php index 1b83168..7b66154 100644 --- a/src/Basecamp/Resources/service.php +++ b/src/Basecamp/Resources/service.php @@ -1,929 +1,952 @@ - '37signals Basecamp API', - 'serviceAbbreviation' => 'Basecamp API', - 'operations' => array( - 'getArchivedProjects' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/archived.json', - 'summary' => 'Get archived Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - ), - 'getProjects' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects.json', - 'summary' => 'Get active Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - ), - 'getProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{id}.json', - 'summary' => 'Get a Project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - 'parameters' => array( - 'id' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getDocumentsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/documents.json', - 'summary' => 'Get all Documents' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getDocument' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/documents/{documentId}.json', - 'summary' => 'Get a Document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - 'documentId' => array( - 'location' => 'uri', - 'description' => 'Document ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTopicsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/topics.json', - 'summary' => 'Get Topics' . PHP_EOL . '[Basecamp API: Topics](https://github.com/basecamp/bcx-api/blob/master/sections/topics.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTodolistsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists.json', - 'summary' => 'Get Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAssignedTodolistsByPerson' => array( - 'httpMethod' => 'GET', - 'uri' => 'people/{personId}/assigned_todos.json', - 'summary' => 'Get Todo Lists assigned to a Person' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'personId' => array( - 'location' => 'uri', - 'description' => 'Person id', - 'type' => 'integer', - 'required' => true, - ), - 'page' => array( - 'location' => 'query', - 'description' => 'The page to retrieve. API returns 50 todos per page.', - 'type' => 'integer', - 'required' => false, - ), - 'due_since' => array( - 'location' => 'query', - 'description' => 'Will return all the to-do lists with to-dos assigned to the specified person due after the date specified. (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ) - ) - ), - 'getCompletedTodolistsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists/completed.json', - 'summary' => 'Get completed Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getCompletedTodosByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todos/completed.json', - 'summary' => 'Get completed Todos' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createProject' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects.json', - 'summary' => 'Create a new project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', - 'parameters' => array( - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'createDocument' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/documents.json', - 'summary' => 'Create a new document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true - ), - 'title' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'createTodolistByProject' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todolists.json', - 'summary' => 'Create Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'description' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ) - ) - ), - 'createTodoByTodolist' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todolists/{todolistId}/todos.json', - 'summary' => 'Create Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todolistId' => array( - 'location' => 'uri', - 'description' => 'Todo list id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'assignee' => array( - 'location' => 'json', - 'type' => array( 'array', 'object' ), - 'required' => false, - ), - ) - ), - 'createCommentByTodo' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/todos/{todoId}/comments.json', - 'summary' => 'Create Comment on Todo' . PHP_EOL . '[Basecamp API: Comments](https://github.com/basecamp/bcx-api/blob/master/sections/comments.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true, - ), - 'attachments' => array( - 'location' => 'json', - 'type' => 'array', - 'required' => false, - ), - ) - ), - 'getAttachmentsByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/attachments.json', - 'summary' => 'Get Attachments' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createAttachment' => array( - 'httpMethod' => 'POST', - 'uri' => 'attachments.json', - 'summary' => 'Create Attachment' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', - 'parameters' => array( - 'mimeType' => array( - 'location' => 'header', - 'sentAs' => 'Content-Type', - 'description' => 'The content type of the data', - 'type' => 'string', - 'required' => true, - ), - 'data' => array( - 'location' => 'body', - 'description' => 'The attachment\'s binary data', - 'type' => 'any', - 'required' => true, - ), - ) - ), - 'getTodolist' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todolists/{todolistId}.json', - 'summary' => 'Get Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todolistId' => array( - 'location' => 'uri', - 'description' => 'Todolist id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getTodo' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/todos/{todoId}.json', - 'summary' => 'Get Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'updateTodo' => array( - 'httpMethod' => 'PUT', - 'uri' => 'projects/{projectId}/todos/{todoId}.json', - 'summary' => 'Update Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'todoId' => array( - 'location' => 'uri', - 'description' => 'Todo id', - 'type' => 'integer', - 'required' => true, - ), - 'content' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - 'due_at' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - 'assignee' => array( - 'location' => 'json', - 'type' => array( 'array', 'object' ), - 'required' => false, - ), - 'completed' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => false, - ), - ) - ), - 'getCurrentUser' => array( - 'httpMethod' => 'GET', - 'uri' => 'people/me.json', - 'summary' => 'Get current User' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)', - ), - 'getGlobalEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'events.json', - 'summary' => 'Get global Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', - 'parameters' => array( - 'since' => array( - 'location' => 'query', - 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ), - 'page' => array( - 'location' => 'query', - 'description' => 'The page to retrieve. API returns 50 events per page.', - 'type' => 'integer', - 'required' => false, - ) - ) - ), - 'getProjectEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/events.json', - 'summary' => 'Get Project Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'since' => array( - 'location' => 'query', - 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', - 'type' => 'string', - 'required' => false, - ) - ) - ), - 'getAccessesByProject' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/accesses.json', - 'summary' => 'Get Accesses to Project' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAccessesByCalendar' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/accesses.json', - 'summary' => 'Get Accesses to Calendar' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getPeople' => array( - 'httpMethod' => 'GET', - 'uri' => 'people.json', - 'summary' => 'Get all People' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)' - ), - 'getGroups' => array( - 'httpMethod' => 'GET', - 'uri' => 'groups.json', - 'summary' => 'Get all Groups' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/groups.md)' - ), - 'grantAccess' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/accesses.json', - 'summary' => 'Grant access' . PHP_EOL . '[Basecamp API: Access](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true - ), - 'ids' => array( - 'location' => 'json', - 'description' => 'Existing user ids', - 'type' => 'array', - 'required' => true - ), - 'email_addresses' => array( - 'location' => 'json', - 'description' => 'Grant access to new users', - 'type' => 'string', - 'required' => false - ) - ) - ), - 'getCalendars' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars.json', - 'summary' => 'Get all Calendars' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)' - ), - 'getCalendar' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Get single Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createCalendar' => array( - 'httpMethod' => 'POST', - 'uri' => 'calendars.json', - 'summary' => 'Create new Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'updateCalendar' => array( - 'httpMethod' => 'PUT', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Update Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'name' => array( - 'location' => 'json', - 'type' => 'string', - 'required' => true - ) - ) - ), - 'deleteCalendar' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'calendars/{calendarId}.json', - 'summary' => 'Delete Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getAllCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendar_events.json', - 'summary' => 'Get all events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events.json', - 'summary' => 'Get upcoming calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getCalendarEventsPast' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events/past.json', - 'summary' => 'Get past calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getCalendarEvent' => array( - 'httpMethod' => 'GET', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Get single calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createCalendarEvent' => array( - 'httpMethod' => 'POST', - 'uri' => 'calendars/{calendarId}/calendar_events.json', - 'summary' => 'Create calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string', - 'required' => true - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'updateCalendarEvent' => array( - 'httpMethod' => 'PUT', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Update a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string' - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'deleteCalendarEvent' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', - 'summary' => 'Delete a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'calendarId' => array( - 'location' => 'uri', - 'description' => 'Calendar id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getProjectCalendarEvents' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events.json', - 'summary' => 'Get upcoming project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ), - 'start_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ), - 'end_date' => array( - 'location' => 'query', - 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', - 'type' => 'string' - ) - ) - ), - 'getProjectCalendarEventsPast' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events/past.json', - 'summary' => 'Get past project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project ID', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'getProjectCalendarEvent' => array( - 'httpMethod' => 'GET', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Get single project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ), - 'createProjectCalendarEvent' => array( - 'httpMethod' => 'POST', - 'uri' => 'projects/{projectId}/calendar_events.json', - 'summary' => 'Create project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string', - 'required' => true - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string', - 'required' => true - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'updateProjectCalendarEvent' => array( - 'httpMethod' => 'PUT', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Update a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ), - 'summary' => array( - 'location' => 'json', - 'description' => 'Event Summary / title', - 'type' => 'string' - ), - 'description' => array( - 'location' => 'json', - 'description' => 'Event Description', - 'type' => 'string' - ), - 'starts_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'ends_at' => array( - 'location' => 'json', - 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'remind_at' => array( - 'location' => 'json', - 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', - 'type' => 'string' - ), - 'subscribers' => array( - 'location' => 'json', - 'description' => 'Array of user id\'s to subscribe to the event.', - 'type' => 'array' - ), - 'recurring' => array( - 'location' => 'json', - 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', - 'type' => 'array' - ), - 'all_day' => array( - 'location' => 'json', - 'description' => 'Is the event a full day event?', - 'type' => 'boolean' - ) - ) - ), - 'deleteProjectCalendarEvent' => array( - 'httpMethod' => 'DELETE', - 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', - 'summary' => 'Delete a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', - 'parameters' => array( - 'projectId' => array( - 'location' => 'uri', - 'description' => 'Project id', - 'type' => 'integer', - 'required' => true, - ), - 'eventId' => array( - 'location' => 'uri', - 'description' => 'Event id', - 'type' => 'integer', - 'required' => true, - ) - ) - ) - ) -); + '37signals Basecamp API', + 'serviceAbbreviation' => 'Basecamp API', + 'operations' => array( + 'getArchivedProjects' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/archived.json', + 'summary' => 'Get archived Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + ), + 'getProjects' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects.json', + 'summary' => 'Get active Projects' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + ), + 'getProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{id}.json', + 'summary' => 'Get a Project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + 'parameters' => array( + 'id' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + + 'getSubscriptions' => array( + 'httpMethod' => 'GET', + 'uri' => 'buckets/{projectId}/recordings/{todoId}/subscription.json', + 'summary' => 'Get Subscription for given Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bc3-api/tree/master/sections)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + + ) + ), + + + 'getDocumentsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/documents.json', + 'summary' => 'Get all Documents' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getDocument' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/documents/{documentId}.json', + 'summary' => 'Get a Document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'documentId' => array( + 'location' => 'uri', + 'description' => 'Document ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTopicsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/topics.json', + 'summary' => 'Get Topics' . PHP_EOL . '[Basecamp API: Topics](https://github.com/basecamp/bcx-api/blob/master/sections/topics.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTodolistsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists.json', + 'summary' => 'Get Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAssignedTodolistsByPerson' => array( + 'httpMethod' => 'GET', + 'uri' => 'people/{personId}/assigned_todos.json', + 'summary' => 'Get Todo Lists assigned to a Person' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'personId' => array( + 'location' => 'uri', + 'description' => 'Person id', + 'type' => 'integer', + 'required' => true, + ), + 'page' => array( + 'location' => 'query', + 'description' => 'The page to retrieve. API returns 50 todos per page.', + 'type' => 'integer', + 'required' => false, + ), + 'due_since' => array( + 'location' => 'query', + 'description' => 'Will return all the to-do lists with to-dos assigned to the specified person due after the date specified. (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ) + ) + ), + 'getCompletedTodolistsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists/completed.json', + 'summary' => 'Get completed Todo Lists' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getCompletedTodosByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todos/completed.json', + 'summary' => 'Get completed Todos' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createProject' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects.json', + 'summary' => 'Create a new project' . PHP_EOL . '[Basecamp API: Projects](https://github.com/basecamp/bcx-api/blob/master/sections/projects.md)', + 'parameters' => array( + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'createDocument' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/documents.json', + 'summary' => 'Create a new document' . PHP_EOL . '[Basecamp API: Documents](https://github.com/basecamp/bcx-api/blob/master/sections/documents.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true + ), + 'title' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'createTodolistByProject' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todolists.json', + 'summary' => 'Create Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'description' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ) + ) + ), + 'createTodoByTodolist' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todolists/{todolistId}/todos.json', + 'summary' => 'Create Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todolistId' => array( + 'location' => 'uri', + 'description' => 'Todo list id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'assignee' => array( + 'location' => 'json', + 'type' => array( 'array', 'object' ), + 'required' => false, + ), + ) + ), + 'createCommentByTodo' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/todos/{todoId}/comments.json', + 'summary' => 'Create Comment on Todo' . PHP_EOL . '[Basecamp API: Comments](https://github.com/basecamp/bcx-api/blob/master/sections/comments.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true, + ), + 'attachments' => array( + 'location' => 'json', + 'type' => 'array', + 'required' => false, + ), + ) + ), + 'getAttachmentsByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/attachments.json', + 'summary' => 'Get Attachments' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createAttachment' => array( + 'httpMethod' => 'POST', + 'uri' => 'attachments.json', + 'summary' => 'Create Attachment' . PHP_EOL . '[Basecamp API: Attachments](https://github.com/basecamp/bcx-api/blob/master/sections/attachments.md)', + 'parameters' => array( + 'mimeType' => array( + 'location' => 'header', + 'sentAs' => 'Content-Type', + 'description' => 'The content type of the data', + 'type' => 'string', + 'required' => true, + ), + 'data' => array( + 'location' => 'body', + 'description' => 'The attachment\'s binary data', + 'type' => 'any', + 'required' => true, + ), + ) + ), + 'getTodolist' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todolists/{todolistId}.json', + 'summary' => 'Get Todo List' . PHP_EOL . '[Basecamp API: Todo lists](https://github.com/basecamp/bcx-api/blob/master/sections/todolists.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todolistId' => array( + 'location' => 'uri', + 'description' => 'Todolist id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getTodo' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/todos/{todoId}.json', + 'summary' => 'Get Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'updateTodo' => array( + 'httpMethod' => 'PUT', + 'uri' => 'projects/{projectId}/todos/{todoId}.json', + 'summary' => 'Update Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bcx-api/blob/master/sections/todos.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'todoId' => array( + 'location' => 'uri', + 'description' => 'Todo id', + 'type' => 'integer', + 'required' => true, + ), + 'content' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + 'due_at' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + 'assignee' => array( + 'location' => 'json', + 'type' => array( 'array', 'object' ), + 'required' => false, + ), + 'completed' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => false, + ), + ) + ), + 'getCurrentUser' => array( + 'httpMethod' => 'GET', + 'uri' => 'people/me.json', + 'summary' => 'Get current User' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)', + ), + 'getGlobalEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'events.json', + 'summary' => 'Get global Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', + 'parameters' => array( + 'since' => array( + 'location' => 'query', + 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ), + 'page' => array( + 'location' => 'query', + 'description' => 'The page to retrieve. API returns 50 events per page.', + 'type' => 'integer', + 'required' => false, + ) + ) + ), + 'getProjectEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/events.json', + 'summary' => 'Get Project Events' . PHP_EOL . '[Basecamp API: Events](https://github.com/basecamp/bcx-api/blob/master/sections/events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'since' => array( + 'location' => 'query', + 'description' => 'All events since given datetime (format: 2012-03-24T11:00:00-06:00)', + 'type' => 'string', + 'required' => false, + ) + ) + ), + 'getAccessesByProject' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/accesses.json', + 'summary' => 'Get Accesses to Project' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAccessesByCalendar' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/accesses.json', + 'summary' => 'Get Accesses to Calendar' . PHP_EOL . '[Basecamp API: Accesses](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getPeople' => array( + 'httpMethod' => 'GET', + 'uri' => 'people.json', + 'summary' => 'Get all People' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/people.md)' + ), + 'getGroups' => array( + 'httpMethod' => 'GET', + 'uri' => 'groups.json', + 'summary' => 'Get all Groups' . PHP_EOL . '[Basecamp API: People](https://github.com/basecamp/bcx-api/blob/master/sections/groups.md)' + ), + 'grantAccess' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/accesses.json', + 'summary' => 'Grant access' . PHP_EOL . '[Basecamp API: Access](https://github.com/basecamp/bcx-api/blob/master/sections/accesses.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true + ), + 'ids' => array( + 'location' => 'json', + 'description' => 'Existing user ids', + 'type' => 'array', + 'required' => true + ), + 'email_addresses' => array( + 'location' => 'json', + 'description' => 'Grant access to new users', + 'type' => 'string', + 'required' => false + ) + ) + ), + 'getCalendars' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars.json', + 'summary' => 'Get all Calendars' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)' + ), + 'getCalendar' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Get single Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createCalendar' => array( + 'httpMethod' => 'POST', + 'uri' => 'calendars.json', + 'summary' => 'Create new Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'updateCalendar' => array( + 'httpMethod' => 'PUT', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Update Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'name' => array( + 'location' => 'json', + 'type' => 'string', + 'required' => true + ) + ) + ), + 'deleteCalendar' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'calendars/{calendarId}.json', + 'summary' => 'Delete Calendar' . PHP_EOL . '[Basecamp API: Calendars](https://github.com/basecamp/bcx-api/blob/master/sections/calendars.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getAllCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendar_events.json', + 'summary' => 'Get all events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events.json', + 'summary' => 'Get upcoming calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getCalendarEventsPast' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events/past.json', + 'summary' => 'Get past calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getCalendarEvent' => array( + 'httpMethod' => 'GET', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Get single calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createCalendarEvent' => array( + 'httpMethod' => 'POST', + 'uri' => 'calendars/{calendarId}/calendar_events.json', + 'summary' => 'Create calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string', + 'required' => true + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'updateCalendarEvent' => array( + 'httpMethod' => 'PUT', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Update a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string' + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'deleteCalendarEvent' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'calendars/{calendarId}/calendar_events/{eventId}.json', + 'summary' => 'Delete a calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'uri', + 'description' => 'Calendar id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getProjectCalendarEvents' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events.json', + 'summary' => 'Get upcoming project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ), + 'start_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ), + 'end_date' => array( + 'location' => 'query', + 'description' => 'Will return 6 weeks worth of events after the start date if the end date is not supplied (format: 2015-09-15)', + 'type' => 'string' + ) + ) + ), + 'getProjectCalendarEventsPast' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events/past.json', + 'summary' => 'Get past project calendar events' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project ID', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'getProjectCalendarEvent' => array( + 'httpMethod' => 'GET', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Get single project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ), + 'createProjectCalendarEvent' => array( + 'httpMethod' => 'POST', + 'uri' => 'projects/{projectId}/calendar_events.json', + 'summary' => 'Create project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string', + 'required' => true + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string', + 'required' => true + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'updateProjectCalendarEvent' => array( + 'httpMethod' => 'PUT', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Update a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ), + 'summary' => array( + 'location' => 'json', + 'description' => 'Event Summary / title', + 'type' => 'string' + ), + 'description' => array( + 'location' => 'json', + 'description' => 'Event Description', + 'type' => 'string' + ), + 'starts_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event starts at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'ends_at' => array( + 'location' => 'json', + 'description' => 'Date (and time if not an all day event) that the event ends at (format: 2015-09-15 or 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'remind_at' => array( + 'location' => 'json', + 'description' => 'Datetime to remind subscribers about the event via email (format: 2015-09-15T11:50:00-05:00)', + 'type' => 'string' + ), + 'subscribers' => array( + 'location' => 'json', + 'description' => 'Array of user id\'s to subscribe to the event.', + 'type' => 'array' + ), + 'recurring' => array( + 'location' => 'json', + 'description' => 'Array of recurring parrameters - starts_at, frequency, count, until, excluding', + 'type' => 'array' + ), + 'all_day' => array( + 'location' => 'json', + 'description' => 'Is the event a full day event?', + 'type' => 'boolean' + ) + ) + ), + 'deleteProjectCalendarEvent' => array( + 'httpMethod' => 'DELETE', + 'uri' => 'projects/{projectId}/calendar_events/{eventId}.json', + 'summary' => 'Delete a project calendar event' . PHP_EOL . '[Basecamp API: Calendar Events](https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md)', + 'parameters' => array( + 'projectId' => array( + 'location' => 'uri', + 'description' => 'Project id', + 'type' => 'integer', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'uri', + 'description' => 'Event id', + 'type' => 'integer', + 'required' => true, + ) + ) + ) + ) +); From 4cb92909082a91b86093053fe3a03375677767dc Mon Sep 17 00:00:00 2001 From: patelhir Date: Tue, 30 Aug 2016 22:09:41 +0530 Subject: [PATCH 4/8] Add files via upload --- tests/mock/get_subscriptions | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/mock/get_subscriptions diff --git a/tests/mock/get_subscriptions b/tests/mock/get_subscriptions new file mode 100644 index 0000000..866068f --- /dev/null +++ b/tests/mock/get_subscriptions @@ -0,0 +1,19 @@ +HTTP/1.1 200 OK +Server: nginx +Date: Fri, 12 Apr 2013 12:09:01 GMT +Content-Type: application/json; charset=utf-8 +Transfer-Encoding: chunked +Connection: keep-alive +Status: 200 OK +X-Frame-Options: SAMEORIGIN +X-XSS-Protection: 1; mode=block +X-Content-Type-Options: nosniff +X-UA-Compatible: chrome=1 +X-XHR-Current-Location: /99999/api/v1/projects.json +X-Asset-Paths: {"application.js":"application-d265257400a78c84714eef6d6f34f2ad.js","application.css":"application-f0a5ae63903c0c1d32c6f03cf7bb8c8a.css"} +ETag: "24d3f12354466094e942e6731fb89b68" +Cache-Control: max-age=0, private, must-revalidate +X-Request-Id: 18723020-c8f2-4ddc-b427-9d633ed94fcc +X-Runtime: 0.339996 + +{"subscribed":true,"count":1,"url":"https://3.basecampapi.com/99999/buckets/99999/recordings/99999/subscription.json","subscribers":[{"id":99999,"attachable_sgid":"BAh7CEkiCGdpZAY6BkVUSSIoZ2lkOi8vYmMzL1BlcnNvbi81MzcyMzA5P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--68aa7049b577e6e03a8db3e06c4eb181e0918bf9","name":"XYZ","email_address":"XYZ@gmail.com","personable_type":"User","title":"Founder","created_at":"2016-07-26T06:07:07.121Z","updated_at":"2016-07-26T06:07:35.622Z","admin":true,"owner":true,"avatar_url":"https://3.basecamp-static.com/99999/people/BAhpA5X5UQ==--ad72cd08deac12b7b0d07ec3d121b98e926e81f8/avatar-64-x4","company":{"id":999999,"name":"XYZ"}}]} \ No newline at end of file From fd09119dfa1e88f04054b56edbec388c04abf6dc Mon Sep 17 00:00:00 2001 From: patelhir Date: Tue, 30 Aug 2016 22:12:52 +0530 Subject: [PATCH 5/8] Test for getSubscription --- tests/Basecamp/Test/BasecampClientTest.php | 1505 ++++++++++---------- 1 file changed, 760 insertions(+), 745 deletions(-) diff --git a/tests/Basecamp/Test/BasecampClientTest.php b/tests/Basecamp/Test/BasecampClientTest.php index 4328b5e..2ab2493 100755 --- a/tests/Basecamp/Test/BasecampClientTest.php +++ b/tests/Basecamp/Test/BasecampClientTest.php @@ -1,745 +1,760 @@ - -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ - -namespace Basecamp\Test; - -use Basecamp\BasecampClient; - -class BasecampClientTest extends \Guzzle\Tests\GuzzleTestCase -{ - public function testFactoryInitializesClient() - { - $client = BasecampClient::factory(array( - 'auth' => 'http', - 'username' => 'foo', - 'password' => 'bar', - 'user_id' => '999999999', - 'version' => 'v2', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com' - )); - $this->assertEquals('https://basecamp.com/999999999/api/v2/', $client->getBaseUrl()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFactoryInitializesClientWithInvalidAuth() - { - $client = BasecampClient::factory(array( - 'username' => 'foo', - 'password' => 'bar', - 'user_id' => '999999999', - 'version' => 'v2', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com', - 'auth' => 'invalid_auth_type' - )); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFactoryInitializesClientWithoutUserId() - { - $client = BasecampClient::factory(array( - 'auth' => 'http', - 'username' => 'foo', - 'password' => 'bar', - 'version' => 'v2', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com' - )); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFactoryInitializesClientWithoutToken() - { - $client = BasecampClient::factory(array( - 'auth' => 'oauth', - 'username' => 'foo', - 'password' => 'bar', - 'version' => 'v2', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com' - )); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFactoryInitializesClientWithoutIdentification() - { - $client = BasecampClient::factory(array( - 'auth' => 'oauth', - 'username' => 'foo', - 'password' => 'bar', - 'version' => 'v2' - )); - } - - public function testFactoryInitializesClientWithIdentification() - { - $client = BasecampClient::factory(array( - 'auth' => 'http', - 'username' => 'foo', - 'password' => 'bar', - 'version' => 'v2', - 'user_id' => '999999999', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com' - )); - - $request = $client->get(); - $this->assertEquals('Fake (test@fake.com)', (string)$request->getHeader('User-Agent')); - } - - public function testFactoryInitializesClientWithToken() - { - $client = BasecampClient::factory(array( - 'auth' => 'oauth', - 'token' => 'foo', - 'version' => 'v2', - 'user_id' => '999999999', - 'app_name' => 'Fake', - 'app_contact' => 'test@fake.com' - )); - $this->assertEquals('https://basecamp.com/999999999/api/v2/', $client->getBaseUrl()); - } - - public function testGetProjects() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_projects' - )); - $response = $client->getProjects(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(99999, $response[0]['id']); - } - - public function testGetProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_project' - )); - $response = $client->getProject(array( - 'id' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - $this->assertArrayHasKey('topics', $response); - } - - public function testGetDocumentsByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_documents_by_project' - )); - $response = $client->getDocumentsByProject(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertSame(12343, $response[0]['id']); - } - - public function testGetDocument() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_document' - )); - $response = $client->getDocument(array( - 'projectId' => 123, - 'documentId' => 456 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(123, $response['id']); - } - - public function testGetTopicsByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_topics_by_project' - )); - $response = $client->getTopicsByProject(array( - 'projectId' => 1 - )); - - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(3, $response[0]['id']); - } - - public function testGetTodolistsByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_todolists_by_project' - )); - $response = $client->getTodolistsByProject(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(3, $response[0]['id']); - } - - public function testgetAssignedTodolistsByPerson() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_assigned_todos' - )); - $response = $client->getAssignedTodolistsByPerson(array( - 'personId' => 1 - )); - - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(968316918, $response[0]['id']); - $this->assertArrayHasKey('assigned_todos', $response[0]); - $this->assertInternalType('array', $response[0]['assigned_todos']); - $this->assertArrayHasKey('id', $response[0]['assigned_todos'][0]); - $this->assertSame(223304243, $response[0]['assigned_todos'][0]['id']); - } - - public function testGetCompletedTodolistsByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_completed_todolists_by_project' - )); - $response = $client->getCompletedTodolistsByProject(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(7091994, $response[0]['id']); - $this->assertSame("Support (inbound)", $response[0]['name']); - $this->assertSame("Lorem ipsum", $response[0]['description']); - } - - public function testGetCompletedTodosByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_completed_todos_by_project' - )); - $response = $client->getCompletedTodosByProject(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - $this->assertSame(true, $response[0]['completed']); - } - - public function testCreateProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_project' - )); - $projectName = 'Support (inbound)'; - $projectDescription = 'Lorem ipsum'; - $response = $client->createProject(array( - 'name' => $projectName, - 'description' => $projectDescription - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('name', $response); - $this->assertArrayHasKey('description', $response); - $this->assertSame($projectName, $response['name']); - $this->assertSame($projectDescription, $response['description']); - } - - public function testCreateDocument() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_document' - )); - $documentTitle = "Support (inbound)"; - $documentContent = "Lorem ipsum"; - $response = $client->createDocument(array( - 'projectId' => 1, - 'title' => $documentTitle, - 'content' => $documentContent - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('title', $response); - $this->assertArrayHasKey('content', $response); - $this->assertSame($documentTitle, $response['title']); - $this->assertSame($documentContent, $response['content']); - } - - public function testCreateTodolistByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_todolist_by_project' - )); - $todolist = "Support (inbound)"; - $todolistDesc = "Lorem ipsum"; - $response = $client->createTodolistByProject(array( - 'projectId' => 1, - 'name' => $todolist, - 'description' => $todolistDesc - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('name', $response); - $this->assertArrayHasKey('description', $response); - $this->assertSame(7091994, $response['id']); - $this->assertSame($todolist, $response['name']); - $this->assertSame($todolistDesc, $response['description']); - } - - public function testCreateTodoByTodolist() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_todo_by_todolist' - )); - $todo = "Subject"; - $response = $client->createTodoByTodolist(array( - 'projectId' => 1, - 'todolistId' => 7091994, - 'content' => $todo - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('content', $response); - $this->assertSame(41361256, $response['id']); - $this->assertSame($todo, $response['content']); - } - - public function testCreateCommentByTodo() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_comment_by_todo' - )); - $comment = "Text message."; - - $response = $client->createCommentByTodo(array( - 'projectId' => 1, - 'todoId' => 41367037, - 'content' => $comment - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('content', $response); - $this->assertSame(61775464, $response['id']); - $this->assertSame($comment, $response['content']); - } - - public function testGetAttachmentsByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_attachments_by_project' - )); - $response = $client->getAttachmentsByProject(array( - 'projectId' => 1 - )); - - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('key', $response[0]); - $this->assertSame('93e10dacd3aa64ab2edde55642c751f1e7b2557e', $response[0]['key']); - } - - public function testCreateAttachment() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_attachment' - )); - $response = $client->createAttachment(array( - 'mimeType' => 'image/jpeg', - 'data' => "data-here" - )); - - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('token', $response); - $this->assertSame('51800634-9aecec5cfd6acf939b08cd1957a3c12796ae05fa', $response['token']); - } - - public function testGetTodolist() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_todolist' - )); - $response = $client->getTodolist(array( - 'projectId' => 1, - 'todolistId' => 2 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - $this->assertArrayHasKey('todos', $response); - $this->assertArrayHasKey('remaining', $response['todos']); - $this->assertArrayHasKey(0, $response['todos']['remaining']); - $this->assertArrayHasKey('id', $response['todos']['remaining'][0]); - } - - public function testGetCurrentUser() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_current_user' - )); - $response = $client->getCurrentUser(); - - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - $this->assertSame('Richard van den Brand', $response['name']); - } - - public function testGetGlobalEvents() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_global_events' - )); - $response = $client->getGlobalEvents(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(99999999, $response[0]['id']); - } - - public function testGetAccessesByProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_accesses_by_project' - )); - $response = $client->getAccessesByProject(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGrantAccessToProject() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'grant_access' - )); - $response = $client->grantAccess(array( - 'projectId' => 1, - 'ids' => array(1, 2, 3) - )); - $firstAccess = $response[0]; - $this->assertInternalType('array', $firstAccess); - $this->assertArrayHasKey('id', $firstAccess); - $this->assertSame(1, $firstAccess['identity_id']); - } - - public function testGetAccessesByCalendar() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_accesses_by_calendar' - )); - $response = $client->getAccessesByCalendar(array( - 'calendarId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(3, $response[0]['id']); - } - - public function testGetPeople() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_people' - )); - $response = $client->getPeople(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(149087659, $response[0]['id']); - } - - public function testGetTodo() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_todo' - )); - $response = $client->getTodo(array( - 'projectId' => 1, - 'todoId' => 2, - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - $this->assertSame(1000, $response[0]['todolist_id']); - } - - public function testGetProjectEvents() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_project_events' - )); - $response = $client->getProjectEvents(array( - 'projectId' => 1, - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1054456336, $response[0]['id']); - $this->assertSame('re-assigned a to-do to Funky ones: Design it', $response[0]['summary']); - } - - public function testGetArchivedProjects() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_archived_projects' - )); - $response = $client->getArchivedProjects(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(605816632, $response[0]['id']); - } - - public function testGetGroups() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_groups' - )); - $response = $client->getGroups(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertArrayHasKey('name', $response[0]); - $this->assertSame(12345, $response[0]['id']); - $this->assertSame("Foo Limited", $response[0]['name']); - $this->assertArrayHasKey(1, $response); - $this->assertArrayHasKey('id', $response[1]); - $this->assertArrayHasKey('name', $response[1]); - $this->assertSame(67890, $response[1]['id']); - $this->assertSame("Bar Associates", $response[1]['name']); - } - - public function testGetCalendars() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_calendars' - )); - $response = $client->getCalendars(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetCalendar() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_calendar' - )); - $response = $client->getCalendar(array( - 'calendarId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - } - - public function testCreateCalendar() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_calendar' - )); - $calendarName = 'Mock Calendar'; - $response = $client->createCalendar(array( - 'name' => $calendarName, - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('name', $response); - $this->assertSame($calendarName, $response['name']); - } - - public function testGetAllCalendarEvents() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_all_calendar_events' - )); - $response = $client->getAllCalendarEvents(); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetCalendarEvents() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_calendar_events' - )); - $response = $client->getCalendarEvents(array( - 'calendarId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetCalendarEventsPast() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_calendar_events_past' - )); - $response = $client->getCalendarEvents(array( - 'calendarId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetCalendarEvent() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_calendar_event' - )); - $response = $client->getCalendarEvent(array( - 'calendarId' => 1, - 'eventId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - } - - public function testCreateCalendarEvent() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_calendar_event' - )); - $eventSummary = 'Mock Event'; - $eventStartsAt = '2015-09-17'; - $response = $client->createCalendarEvent(array( - 'calendarId' => 1, - 'summary' => $eventSummary, - 'starts_at' => $eventStartsAt, - 'all_day' => true - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('summary', $response); - $this->assertSame($eventSummary, $response['summary']); - } - - public function testGetProjectCalendarEvents() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_project_calendar_events' - )); - $response = $client->getProjectCalendarEvents(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetProjectCalendarEventsPast() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_project_calendar_events_past' - )); - $response = $client->getProjectCalendarEvents(array( - 'projectId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey(0, $response); - $this->assertArrayHasKey('id', $response[0]); - $this->assertSame(1, $response[0]['id']); - } - - public function testGetProjectCalendarEvent() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'get_project_calendar_event' - )); - $response = $client->getProjectCalendarEvent(array( - 'projectId' => 1, - 'eventId' => 1 - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertSame(1, $response['id']); - } - - public function testCreateProjectCalendarEvent() - { - $client = $this->getServiceBuilder()->get('basecamp'); - $this->setMockResponse($client, array( - 'create_project_calendar_event' - )); - $eventSummary = 'Mock Event'; - $eventStartsAt = '2015-09-17'; - $response = $client->createProjectCalendarEvent(array( - 'projectId' => 1, - 'summary' => $eventSummary, - 'starts_at' => $eventStartsAt, - 'all_day' => true - )); - $this->assertInternalType('array', $response); - $this->assertArrayHasKey('id', $response); - $this->assertArrayHasKey('summary', $response); - $this->assertSame($eventSummary, $response['summary']); - } - -} + +* +* For the full copyright and license information, please view the LICENSE +* file that was distributed with this source code. +*/ + +namespace Basecamp\Test; + +use Basecamp\BasecampClient; + +class BasecampClientTest extends \Guzzle\Tests\GuzzleTestCase +{ + public function testFactoryInitializesClient() + { + $client = BasecampClient::factory(array( + 'auth' => 'http', + 'username' => 'foo', + 'password' => 'bar', + 'user_id' => '999999999', + 'version' => 'v2', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com' + )); + $this->assertEquals('https://basecamp.com/999999999/api/v2/', $client->getBaseUrl()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testFactoryInitializesClientWithInvalidAuth() + { + $client = BasecampClient::factory(array( + 'username' => 'foo', + 'password' => 'bar', + 'user_id' => '999999999', + 'version' => 'v2', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com', + 'auth' => 'invalid_auth_type' + )); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testFactoryInitializesClientWithoutUserId() + { + $client = BasecampClient::factory(array( + 'auth' => 'http', + 'username' => 'foo', + 'password' => 'bar', + 'version' => 'v2', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com' + )); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testFactoryInitializesClientWithoutToken() + { + $client = BasecampClient::factory(array( + 'auth' => 'oauth', + 'username' => 'foo', + 'password' => 'bar', + 'version' => 'v2', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com' + )); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testFactoryInitializesClientWithoutIdentification() + { + $client = BasecampClient::factory(array( + 'auth' => 'oauth', + 'username' => 'foo', + 'password' => 'bar', + 'version' => 'v2' + )); + } + + public function testFactoryInitializesClientWithIdentification() + { + $client = BasecampClient::factory(array( + 'auth' => 'http', + 'username' => 'foo', + 'password' => 'bar', + 'version' => 'v2', + 'user_id' => '999999999', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com' + )); + + $request = $client->get(); + $this->assertEquals('Fake (test@fake.com)', (string)$request->getHeader('User-Agent')); + } + + public function testFactoryInitializesClientWithToken() + { + $client = BasecampClient::factory(array( + 'auth' => 'oauth', + 'token' => 'foo', + 'version' => 'v2', + 'user_id' => '999999999', + 'app_name' => 'Fake', + 'app_contact' => 'test@fake.com' + )); + $this->assertEquals('https://basecamp.com/999999999/api/v2/', $client->getBaseUrl()); + } + + public function testGetProjects() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_projects' + )); + $response = $client->getProjects(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(99999, $response[0]['id']); + } + + public function testGetProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_project' + )); + $response = $client->getProject(array( + 'id' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + $this->assertArrayHasKey('topics', $response); + } + + public function testGetDocumentsByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_documents_by_project' + )); + $response = $client->getDocumentsByProject(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertSame(12343, $response[0]['id']); + } + + public function testGetDocument() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_document' + )); + $response = $client->getDocument(array( + 'projectId' => 123, + 'documentId' => 456 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(123, $response['id']); + } + + public function testGetTopicsByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_topics_by_project' + )); + $response = $client->getTopicsByProject(array( + 'projectId' => 1 + )); + + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(3, $response[0]['id']); + } + + public function testGetTodolistsByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_todolists_by_project' + )); + $response = $client->getTodolistsByProject(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(3, $response[0]['id']); + } + + public function testGetSubscriptionsByTodo() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_subscription' + )); + $response = $client->getSubscription(array( + 'projectId' => 1, + 'todoId'=>1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(3, $response[0]['id']); + } + + public function testgetAssignedTodolistsByPerson() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_assigned_todos' + )); + $response = $client->getAssignedTodolistsByPerson(array( + 'personId' => 1 + )); + + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(968316918, $response[0]['id']); + $this->assertArrayHasKey('assigned_todos', $response[0]); + $this->assertInternalType('array', $response[0]['assigned_todos']); + $this->assertArrayHasKey('id', $response[0]['assigned_todos'][0]); + $this->assertSame(223304243, $response[0]['assigned_todos'][0]['id']); + } + + public function testGetCompletedTodolistsByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_completed_todolists_by_project' + )); + $response = $client->getCompletedTodolistsByProject(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(7091994, $response[0]['id']); + $this->assertSame("Support (inbound)", $response[0]['name']); + $this->assertSame("Lorem ipsum", $response[0]['description']); + } + + public function testGetCompletedTodosByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_completed_todos_by_project' + )); + $response = $client->getCompletedTodosByProject(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + $this->assertSame(true, $response[0]['completed']); + } + + public function testCreateProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_project' + )); + $projectName = 'Support (inbound)'; + $projectDescription = 'Lorem ipsum'; + $response = $client->createProject(array( + 'name' => $projectName, + 'description' => $projectDescription + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('name', $response); + $this->assertArrayHasKey('description', $response); + $this->assertSame($projectName, $response['name']); + $this->assertSame($projectDescription, $response['description']); + } + + public function testCreateDocument() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_document' + )); + $documentTitle = "Support (inbound)"; + $documentContent = "Lorem ipsum"; + $response = $client->createDocument(array( + 'projectId' => 1, + 'title' => $documentTitle, + 'content' => $documentContent + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('title', $response); + $this->assertArrayHasKey('content', $response); + $this->assertSame($documentTitle, $response['title']); + $this->assertSame($documentContent, $response['content']); + } + + public function testCreateTodolistByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_todolist_by_project' + )); + $todolist = "Support (inbound)"; + $todolistDesc = "Lorem ipsum"; + $response = $client->createTodolistByProject(array( + 'projectId' => 1, + 'name' => $todolist, + 'description' => $todolistDesc + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('name', $response); + $this->assertArrayHasKey('description', $response); + $this->assertSame(7091994, $response['id']); + $this->assertSame($todolist, $response['name']); + $this->assertSame($todolistDesc, $response['description']); + } + + public function testCreateTodoByTodolist() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_todo_by_todolist' + )); + $todo = "Subject"; + $response = $client->createTodoByTodolist(array( + 'projectId' => 1, + 'todolistId' => 7091994, + 'content' => $todo + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('content', $response); + $this->assertSame(41361256, $response['id']); + $this->assertSame($todo, $response['content']); + } + + public function testCreateCommentByTodo() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_comment_by_todo' + )); + $comment = "Text message."; + + $response = $client->createCommentByTodo(array( + 'projectId' => 1, + 'todoId' => 41367037, + 'content' => $comment + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('content', $response); + $this->assertSame(61775464, $response['id']); + $this->assertSame($comment, $response['content']); + } + + public function testGetAttachmentsByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_attachments_by_project' + )); + $response = $client->getAttachmentsByProject(array( + 'projectId' => 1 + )); + + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('key', $response[0]); + $this->assertSame('93e10dacd3aa64ab2edde55642c751f1e7b2557e', $response[0]['key']); + } + + public function testCreateAttachment() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_attachment' + )); + $response = $client->createAttachment(array( + 'mimeType' => 'image/jpeg', + 'data' => "data-here" + )); + + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('token', $response); + $this->assertSame('51800634-9aecec5cfd6acf939b08cd1957a3c12796ae05fa', $response['token']); + } + + public function testGetTodolist() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_todolist' + )); + $response = $client->getTodolist(array( + 'projectId' => 1, + 'todolistId' => 2 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + $this->assertArrayHasKey('todos', $response); + $this->assertArrayHasKey('remaining', $response['todos']); + $this->assertArrayHasKey(0, $response['todos']['remaining']); + $this->assertArrayHasKey('id', $response['todos']['remaining'][0]); + } + + public function testGetCurrentUser() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_current_user' + )); + $response = $client->getCurrentUser(); + + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + $this->assertSame('Richard van den Brand', $response['name']); + } + + public function testGetGlobalEvents() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_global_events' + )); + $response = $client->getGlobalEvents(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(99999999, $response[0]['id']); + } + + public function testGetAccessesByProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_accesses_by_project' + )); + $response = $client->getAccessesByProject(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGrantAccessToProject() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'grant_access' + )); + $response = $client->grantAccess(array( + 'projectId' => 1, + 'ids' => array(1, 2, 3) + )); + $firstAccess = $response[0]; + $this->assertInternalType('array', $firstAccess); + $this->assertArrayHasKey('id', $firstAccess); + $this->assertSame(1, $firstAccess['identity_id']); + } + + public function testGetAccessesByCalendar() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_accesses_by_calendar' + )); + $response = $client->getAccessesByCalendar(array( + 'calendarId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(3, $response[0]['id']); + } + + public function testGetPeople() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_people' + )); + $response = $client->getPeople(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(149087659, $response[0]['id']); + } + + public function testGetTodo() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_todo' + )); + $response = $client->getTodo(array( + 'projectId' => 1, + 'todoId' => 2, + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + $this->assertSame(1000, $response[0]['todolist_id']); + } + + public function testGetProjectEvents() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_project_events' + )); + $response = $client->getProjectEvents(array( + 'projectId' => 1, + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1054456336, $response[0]['id']); + $this->assertSame('re-assigned a to-do to Funky ones: Design it', $response[0]['summary']); + } + + public function testGetArchivedProjects() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_archived_projects' + )); + $response = $client->getArchivedProjects(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(605816632, $response[0]['id']); + } + + public function testGetGroups() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_groups' + )); + $response = $client->getGroups(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertArrayHasKey('name', $response[0]); + $this->assertSame(12345, $response[0]['id']); + $this->assertSame("Foo Limited", $response[0]['name']); + $this->assertArrayHasKey(1, $response); + $this->assertArrayHasKey('id', $response[1]); + $this->assertArrayHasKey('name', $response[1]); + $this->assertSame(67890, $response[1]['id']); + $this->assertSame("Bar Associates", $response[1]['name']); + } + + public function testGetCalendars() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_calendars' + )); + $response = $client->getCalendars(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetCalendar() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_calendar' + )); + $response = $client->getCalendar(array( + 'calendarId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + } + + public function testCreateCalendar() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_calendar' + )); + $calendarName = 'Mock Calendar'; + $response = $client->createCalendar(array( + 'name' => $calendarName, + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('name', $response); + $this->assertSame($calendarName, $response['name']); + } + + public function testGetAllCalendarEvents() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_all_calendar_events' + )); + $response = $client->getAllCalendarEvents(); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetCalendarEvents() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_calendar_events' + )); + $response = $client->getCalendarEvents(array( + 'calendarId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetCalendarEventsPast() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_calendar_events_past' + )); + $response = $client->getCalendarEvents(array( + 'calendarId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetCalendarEvent() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_calendar_event' + )); + $response = $client->getCalendarEvent(array( + 'calendarId' => 1, + 'eventId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + } + + public function testCreateCalendarEvent() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_calendar_event' + )); + $eventSummary = 'Mock Event'; + $eventStartsAt = '2015-09-17'; + $response = $client->createCalendarEvent(array( + 'calendarId' => 1, + 'summary' => $eventSummary, + 'starts_at' => $eventStartsAt, + 'all_day' => true + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('summary', $response); + $this->assertSame($eventSummary, $response['summary']); + } + + public function testGetProjectCalendarEvents() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_project_calendar_events' + )); + $response = $client->getProjectCalendarEvents(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetProjectCalendarEventsPast() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_project_calendar_events_past' + )); + $response = $client->getProjectCalendarEvents(array( + 'projectId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey(0, $response); + $this->assertArrayHasKey('id', $response[0]); + $this->assertSame(1, $response[0]['id']); + } + + public function testGetProjectCalendarEvent() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'get_project_calendar_event' + )); + $response = $client->getProjectCalendarEvent(array( + 'projectId' => 1, + 'eventId' => 1 + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertSame(1, $response['id']); + } + + public function testCreateProjectCalendarEvent() + { + $client = $this->getServiceBuilder()->get('basecamp'); + $this->setMockResponse($client, array( + 'create_project_calendar_event' + )); + $eventSummary = 'Mock Event'; + $eventStartsAt = '2015-09-17'; + $response = $client->createProjectCalendarEvent(array( + 'projectId' => 1, + 'summary' => $eventSummary, + 'starts_at' => $eventStartsAt, + 'all_day' => true + )); + $this->assertInternalType('array', $response); + $this->assertArrayHasKey('id', $response); + $this->assertArrayHasKey('summary', $response); + $this->assertSame($eventSummary, $response['summary']); + } + +} From 38c4d29c994e7e174b9985bd1ce284e2d8dd583c Mon Sep 17 00:00:00 2001 From: patelhir Date: Thu, 15 Sep 2016 16:41:54 +0530 Subject: [PATCH 6/8] Rename get_subscriptions to get_subscription_by_todo --- tests/mock/{get_subscriptions => get_subscription_by_todo} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/mock/{get_subscriptions => get_subscription_by_todo} (98%) diff --git a/tests/mock/get_subscriptions b/tests/mock/get_subscription_by_todo similarity index 98% rename from tests/mock/get_subscriptions rename to tests/mock/get_subscription_by_todo index 866068f..e0f883b 100644 --- a/tests/mock/get_subscriptions +++ b/tests/mock/get_subscription_by_todo @@ -16,4 +16,4 @@ Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 18723020-c8f2-4ddc-b427-9d633ed94fcc X-Runtime: 0.339996 -{"subscribed":true,"count":1,"url":"https://3.basecampapi.com/99999/buckets/99999/recordings/99999/subscription.json","subscribers":[{"id":99999,"attachable_sgid":"BAh7CEkiCGdpZAY6BkVUSSIoZ2lkOi8vYmMzL1BlcnNvbi81MzcyMzA5P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--68aa7049b577e6e03a8db3e06c4eb181e0918bf9","name":"XYZ","email_address":"XYZ@gmail.com","personable_type":"User","title":"Founder","created_at":"2016-07-26T06:07:07.121Z","updated_at":"2016-07-26T06:07:35.622Z","admin":true,"owner":true,"avatar_url":"https://3.basecamp-static.com/99999/people/BAhpA5X5UQ==--ad72cd08deac12b7b0d07ec3d121b98e926e81f8/avatar-64-x4","company":{"id":999999,"name":"XYZ"}}]} \ No newline at end of file +{"subscribed":true,"count":1,"url":"https://3.basecampapi.com/99999/buckets/99999/recordings/99999/subscription.json","subscribers":[{"id":99999,"attachable_sgid":"BAh7CEkiCGdpZAY6BkVUSSIoZ2lkOi8vYmMzL1BlcnNvbi81MzcyMzA5P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--68aa7049b577e6e03a8db3e06c4eb181e0918bf9","name":"XYZ","email_address":"XYZ@gmail.com","personable_type":"User","title":"Founder","created_at":"2016-07-26T06:07:07.121Z","updated_at":"2016-07-26T06:07:35.622Z","admin":true,"owner":true,"avatar_url":"https://3.basecamp-static.com/99999/people/BAhpA5X5UQ==--ad72cd08deac12b7b0d07ec3d121b98e926e81f8/avatar-64-x4","company":{"id":999999,"name":"XYZ"}}]} From 1b7745cd34f64b4dd31d76bd2214c49307978106 Mon Sep 17 00:00:00 2001 From: patelhir Date: Thu, 15 Sep 2016 16:43:05 +0530 Subject: [PATCH 7/8] Update BasecampClientTest.php --- tests/Basecamp/Test/BasecampClientTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Basecamp/Test/BasecampClientTest.php b/tests/Basecamp/Test/BasecampClientTest.php index 2ab2493..be86250 100755 --- a/tests/Basecamp/Test/BasecampClientTest.php +++ b/tests/Basecamp/Test/BasecampClientTest.php @@ -143,7 +143,7 @@ public function testGetProject() $this->assertSame(1, $response['id']); $this->assertArrayHasKey('topics', $response); } - + public function testGetDocumentsByProject() { $client = $this->getServiceBuilder()->get('basecamp'); @@ -206,9 +206,9 @@ public function testGetSubscriptionsByTodo() { $client = $this->getServiceBuilder()->get('basecamp'); $this->setMockResponse($client, array( - 'get_subscription' + 'get_subscription_by_todo' )); - $response = $client->getSubscription(array( + $response = $client->getSubscriptionsByTodo(array( 'projectId' => 1, 'todoId'=>1 )); From b418a42f882b508df33baa348dd2fcdbb0b63018 Mon Sep 17 00:00:00 2001 From: patelhir Date: Thu, 15 Sep 2016 16:43:57 +0530 Subject: [PATCH 8/8] Update service.php --- src/Basecamp/Resources/service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Basecamp/Resources/service.php b/src/Basecamp/Resources/service.php index 7b66154..ae7587d 100644 --- a/src/Basecamp/Resources/service.php +++ b/src/Basecamp/Resources/service.php @@ -28,7 +28,7 @@ ) ), - 'getSubscriptions' => array( + 'getSubscriptionsByTodo' => array( 'httpMethod' => 'GET', 'uri' => 'buckets/{projectId}/recordings/{todoId}/subscription.json', 'summary' => 'Get Subscription for given Todo' . PHP_EOL . '[Basecamp API: Todos](https://github.com/basecamp/bc3-api/tree/master/sections)',