From 80a8ca0336c711dd2bbf9c980b3e9c50638eddf0 Mon Sep 17 00:00:00 2001 From: BDav24 Date: Thu, 28 May 2015 09:45:03 +0200 Subject: [PATCH 1/5] Add support for create_many group_memberships --- src/Zendesk/API/GroupMemberships.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Zendesk/API/GroupMemberships.php b/src/Zendesk/API/GroupMemberships.php index f954709b..9effd379 100755 --- a/src/Zendesk/API/GroupMemberships.php +++ b/src/Zendesk/API/GroupMemberships.php @@ -107,6 +107,27 @@ public function create(array $params) { return $response; } + /** + * Create multiple new group memberships + * + * @param array $params + * + * @throws MissingParametersException + * @throws ResponseException + * @throws \Exception + * + * @return mixed + */ + public function createMany(array $params) { + $endPoint = Http::prepare('group_memberships/create_many.json'); + $response = Http::send($this->client, $endPoint, array (self::OBJ_NAME_PLURAL => $params), 'POST'); + if ((!is_object($response)) || ($this->client->getDebug()->lastResponseCode != 200)) { + throw new ResponseException(__METHOD__); + } + $this->client->setSideload(null); + return $response; + } + /** * Delete a group membership * From 7b91b4ff738611523f3a699bd39e24d355fff7de Mon Sep 17 00:00:00 2001 From: BDav24 Date: Thu, 28 May 2015 09:56:10 +0200 Subject: [PATCH 2/5] Add support for create_many imports/tickets --- src/Zendesk/API/TicketImport.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Zendesk/API/TicketImport.php b/src/Zendesk/API/TicketImport.php index a187295f..632f93a1 100755 --- a/src/Zendesk/API/TicketImport.php +++ b/src/Zendesk/API/TicketImport.php @@ -31,4 +31,24 @@ public function import(array $params) { return $response; } + /** + * Create multiple new tickets + * + * @param array $params + * + * @throws ResponseException + * @throws \Exception + * + * @return mixed + */ + public function importMany(array $params) { + $endPoint = Http::prepare('imports/tickets/create_many.json'); + $response = Http::send($this->client, $endPoint, array (self::OBJ_NAME_PLURAL => $params), 'POST'); + if ((!is_object($response)) || ($this->client->getDebug()->lastResponseCode != 200)) { + throw new ResponseException(__METHOD__); + } + $this->client->setSideload(null); + return $response; + } + } From d2e9ebb8306ec48cc66d9b50bbe7c81f04b35f5c Mon Sep 17 00:00:00 2001 From: BDav24 Date: Thu, 28 May 2015 09:57:51 +0200 Subject: [PATCH 3/5] Add access from Ticket to TicketImport createMany --- src/Zendesk/API/Tickets.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Zendesk/API/Tickets.php b/src/Zendesk/API/Tickets.php index 02037888..d7468e97 100755 --- a/src/Zendesk/API/Tickets.php +++ b/src/Zendesk/API/Tickets.php @@ -527,6 +527,15 @@ public function tag($id) { return $this->client->tags()->setLastId($id); } */ public function import(array $params) { return $this->import->import($params); } + /** + * @param array $params + * + * @throws ResponseException + * + * @return mixed + */ + public function importMany(array $params) { return $this->import->importMany($params); } + /** * @param array $params * From 24ef4a424bb8e1096ded4fb5c40db91928410b9b Mon Sep 17 00:00:00 2001 From: James Harvey Date: Sat, 20 Jun 2015 15:45:22 +1000 Subject: [PATCH 4/5] Added support for creating many tickets --- src/Zendesk/API/Tickets.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Zendesk/API/Tickets.php b/src/Zendesk/API/Tickets.php index 8dc76891..67396390 100755 --- a/src/Zendesk/API/Tickets.php +++ b/src/Zendesk/API/Tickets.php @@ -185,6 +185,28 @@ public function create(array $params) return $response; } + /** + * Create many tickets + * + * @param array $params + * + * @throws ResponseException + * @throws \Exception + * + * @return mixed + */ + public function createMany(array $params) + { + $endPoint = Http::prepare('tickets/create_many.json'); + $response = Http::send($this->client, $endPoint, array(self::OBJ_NAME_PLURAL => $params), 'POST'); + if ((!is_object($response)) || ($this->client->getDebug()->lastResponseCode != 200)) { + throw new ResponseException(__METHOD__); + } + $this->client->setSideload(null); + + return $response; + } + /** * Create a ticket from a tweet * From 8735fa152e6e668b43311b6fbba9bf773e6e26c6 Mon Sep 17 00:00:00 2001 From: Mio Miguel Galang Date: Fri, 31 Jul 2015 14:42:10 +0800 Subject: [PATCH 5/5] Add version to composer.son file --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index d75f678f..1c4c0eef 100755 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "zendesk/zendesk_api_client_php", "description": "PHP Client for Zendesk REST API. See http://developer.zendesk.com/api-docs", "license": "Apache License Version 2.0", + "version": "2.0.0-beta", "homepage": "https://github.com/zendesk/zendesk_api_client_php", "require": { "php": ">=5.3.1",