You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by ro...@apache.org on 2014/11/12 02:15:06 UTC

[01/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/master 7131c5a89 -> a89c57b89


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php b/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php
new file mode 100644
index 0000000..09fa040
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Native\Facades;
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/**
+ * Class Usergrid
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Usergrid
+{
+    /**
+     * The Usergrid API instance.
+     *
+     * @var \Apache\Usergrid\Api\Usergrid
+     */
+    protected $usergrid;
+
+    /**
+     * The Native Bootstrap instance.
+     *
+     * @var \Apache\Usergrid\Native\UsergridBootstrapper
+     */
+    protected static $instance;
+
+    /**
+     * Constructor.
+     *
+     * @param  \Apache\Usergrid\Native\UsergridBootstrapper $bootstraper
+     * @return \Apache\Usergrid\Native\Facades\Usergrid
+     */
+    public function __construct(UsergridBootstrapper $bootstraper = null)
+    {
+        if (!$bootstraper) {
+            $bootstraper = new UsergridBootstrapper;
+        }
+
+        $this->usergrid = $bootstraper->createUsergrid();
+    }
+
+    /**
+     * Creates a new Native Bootstraper instance.
+     *
+     * @param  \Apache\Usergrid\Native\UsergridBootstrapper $bootstrapper
+     * @return void
+     */
+    public static function instance(UsergridBootstrapper $bootstrapper = null)
+    {
+        if (static::$instance === null) {
+            static::$instance = new static($bootstrapper);
+        }
+
+        return static::$instance;
+    }
+
+    /**
+     * Returns the Usergrid API instance.
+     *
+     * @return \Apache\Usergrid\Api\Usergrid
+     */
+    public function getUsergrid()
+    {
+        return $this->usergrid;
+    }
+
+    /**
+     * Handle dynamic, static calls to the object.
+     *
+     * @param  string $method
+     * @param  array $args
+     * @return mixed
+     */
+    public static function __callStatic($method, $args)
+    {
+        $instance = static::instance()->getUsergrid();
+
+        switch (count($args)) {
+            case 0:
+                return $instance->{$method}();
+
+            case 1:
+                return $instance->{$method}($args[0]);
+
+            case 2:
+                return $instance->{$method}($args[0], $args[1]);
+
+            case 3:
+                return $instance->{$method}($args[0], $args[1], $args[2]);
+
+            case 4:
+                return $instance->{$method}($args[0], $args[1], $args[2], $args[3]);
+
+            default:
+                return call_user_func_array([$instance, $method], $args);
+        }
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
new file mode 100644
index 0000000..a8d32ab
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Native;
+
+
+use Apache\Usergrid\Api\Models\User;
+use Apache\Usergrid\Api\Usergrid;
+use Guzzle\Http\Client;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\PasswordCredentials;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\RefreshToken;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\Oauth2Plugin;
+
+/**
+ * Class UsergridBootstrapper
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UsergridBootstrapper
+{
+    /**
+     * The Usergrid configuration.
+     *
+     * @var array
+     */
+    protected $config;
+
+    /**
+     * The Oauth2 Plugin.
+     *
+     * @var \Apache\Usergrid\Guzzle\Plugin\Oauth2\Oauth2Plugin
+     */
+    protected $oauth2Plugin =  null;
+    /**
+     * Constructor.
+     *
+     * @param  mixed $config
+     * @return \Apache\Usergrid\Native\UsergridBootstrapper
+     */
+    public function __construct($config = null)
+    {
+        $this->config = $config ?: new ConfigRepository($config);
+    }
+
+    /**
+     * Creates the Usergrid instance.
+     *
+     * @return \Apache\Usergrid\Api\Usergrid
+     */
+    public function createUsergrid()
+    {
+        $baseUrl = array_get($this->config, 'usergrid.url');
+
+        $orgName = array_get($this->config, 'usergrid.orgName');
+
+        $appName = array_get($this->config, 'usergrid.appName');
+
+        $manifestPath = array_get($this->config, 'usergrid.manifestPath');
+
+        $version = array_get($this->config, 'usergrid.version');
+
+        $enable_oauth2_plugin = array_get($this->config, 'usergrid.enable_oauth2_plugin');
+
+        //check if user wants to manage there own Oauth 2 auth flow
+        if($enable_oauth2_plugin) {
+
+            $this->createOauth2Plugin();
+
+            return new Usergrid($orgName, $appName, $manifestPath, $version, $baseUrl, $this->oauth2Plugin);
+        } else {
+            return new Usergrid($orgName, $appName, $manifestPath, $version, $baseUrl);
+        }
+
+    }
+
+    private function createOauth2Plugin()
+    {
+        $base_url = array_get($this->config, 'usergrid.url');
+
+        $client_id = array_get($this->config, 'usergrid.clientId');
+
+        $client_secret = array_get($this->config, 'usergrid.clientSecret');
+
+        $grant_type = array_get($this->config, 'usergrid.grant_type');
+
+        $auth_type = array_get($this->config, 'usergrid.auth_type');
+
+        $username = array_get($this->config, 'usergrid.username');
+
+        $password = array_get($this->config, 'usergrid.password');
+
+
+        $org_name = array_get($this->config, 'usergrid.orgName');
+
+        $app_name = array_get($this->config, 'usergrid.appName');
+
+        if($auth_type == 'organization') {
+
+            $url = $base_url.'/management/token';
+
+        } elseif($auth_type == 'application')
+        {
+            $url = $base_url.'/'.$org_name.'/'.$app_name.'/token';
+        }
+
+        $oauth2Client = new Client($url);
+
+
+        if($grant_type  == 'client_credentials') {
+            $config = [
+                'client_id' => $client_id,
+                'client_secret' => $client_secret,
+
+            ];
+            $grantType = new ClientCredentials($oauth2Client, $config);
+            $refreshTokenGrantType = new RefreshToken($oauth2Client,$config);
+            $this->oauth2Plugin = new Oauth2Plugin($grantType, $refreshTokenGrantType);
+
+        } elseif($grant_type == 'password') {
+            $config = [
+                'username' => $username,
+                'password' => $password,
+                'client_id' => $client_id,
+                'client_secret' => $client_secret
+            ];
+            $grantType = new PasswordCredentials($oauth2Client, $config);
+            $refreshTokenGrantType = new RefreshToken($oauth2Client, $config);
+            $this->oauth2Plugin =  new Oauth2Plugin($grantType,$refreshTokenGrantType);
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/config/config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/config/config.php b/sdks/php5/apache-usergrid/src/config/config.php
new file mode 100644
index 0000000..c9aff6a
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/config/config.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'usergrid' => [
+
+        'url' => 'https://api.usergrid.com',
+
+        'version' => '1.0.0',
+
+        'orgName' => null,
+
+        'appName' => null,
+
+        'manifestPath' => null,
+
+        //its better not to set the real values here if using laravel set them in a .env file or
+        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
+        // so that way you can be sure not to commit privates ID to a public repo
+        'clientId' => null,
+
+        'clientSecret' => null,
+
+        'username' => null,
+
+        'password' => null,
+
+
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
new file mode 100644
index 0000000..fa80e0c
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api;
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use PHPUnit_Framework_TestCase;
+
+/**
+ * Class UsergridTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ApplicationTest extends PHPUnit_Framework_TestCase
+{
+
+    /**
+     * Usergrid client
+     *
+     * @var Usergrid $usergrid
+     */
+    protected $usergrid;
+
+    protected $config = [
+        'usergrid' => [
+            'url' => 'https://api.usergrid.com',
+            'version' => '1.0.0',
+            'orgName' => null,
+            'appName' => null,
+            'manifestPath' => './src/Manifests/1.0.1',
+            'clientId' => null,
+            'clientSecret' => null,
+            'username' => null,
+            'password' => null,
+            /**
+             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+             * Token from.  You have two options here one is 'application' the other is 'organization'
+             *
+             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+             */
+            'auth_type' => 'organization',
+            /** The Grant Type to use
+             *
+             * This has to be set to one of the 2 grant types that Apache Usergrid
+             * supports which at the moment is client_credentials or password but at
+             * 2 level organization or application
+             */
+            'grant_type' => 'client_credentials'
+        ]
+    ];
+
+    /**
+     *
+     */
+    public function setUp()
+    {
+        $boostrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $boostrap->createUsergrid();
+    }
+
+    /** @test */
+    public function it_can_get_oauth2_token()
+    {
+
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
new file mode 100644
index 0000000..8aa585e
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+
+use PHPUnit_Framework_TestCase;
+use Apache\Usergrid\Api\Usergrid;
+
+/**
+ * Class ExceptionsTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ExceptionsTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Usergrid client
+     */
+    protected $usergrid;
+
+    /**
+     *
+     */
+    public function setup()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_400_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_401_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_403_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_404_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_500_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_501_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_502_exception()
+    {
+
+    }
+
+    /** @test */
+    public function it_can_throw_503_exception()
+    {
+
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/Filters/BooleanTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Filters/BooleanTest.php b/sdks/php5/apache-usergrid/tests/Api/Filters/BooleanTest.php
new file mode 100644
index 0000000..702cb71
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Filters/BooleanTest.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Filters;
+
+
+use PHPUnit_Framework_TestCase;
+use Apache\Usergrid\Api\Filters\Boolean;
+
+/**
+ * Class BooleanTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class BooleanTest extends PHPUnit_Framework_TestCase
+{
+
+    /** @test */
+    public function it_can_convert_booleans()
+    {
+        $this->assertEquals('true', Boolean::convert(1));
+        $this->assertEquals('true', Boolean::convert(true));
+
+        $this->assertEquals('false', Boolean::convert(0));
+        $this->assertEquals('false', Boolean::convert(false));
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/Filters/DateTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Filters/DateTest.php b/sdks/php5/apache-usergrid/tests/Api/Filters/DateTest.php
new file mode 100644
index 0000000..bebbf89
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Filters/DateTest.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Filters;
+
+
+use PHPUnit_Framework_TestCase;
+use Apache\Usergrid\Api\Filters\Date;
+
+/**
+ * Class DateTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class DateTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_convert_dates()
+    {
+
+        $this->assertEquals('Tue, Oct 14, 2014 3:55 AM', Date::convert(1413258923819));
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
new file mode 100644
index 0000000..3df4824
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api;
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use PHPUnit_Framework_TestCase;
+
+/**
+ * Class UsergridTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ManagementTest extends PHPUnit_Framework_TestCase
+{
+    protected $usergrid;
+    protected $config = [
+        'usergrid' => [
+            'url' => 'https://api.usergrid.com',
+            'version' => '1.0.0',
+            'orgName' => null,
+            'appName' => null,
+            'manifestPath' => './src/Manifests/1.0.1',
+            'clientId' => null,
+            'clientSecret' => null,
+            'username' => null,
+            'password' => null,
+            /**
+             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+             * Token from.  You have two options here one is 'application' the other is 'organization'
+             *
+             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+             */
+            'auth_type' => 'organization',
+            /** The Grant Type to use
+             *
+             * This has to be set to one of the 2 grant types that Apache Usergrid
+             * supports which at the moment is client_credentials or password but at
+             * 2 level organization or application
+             */
+            'grant_type' => 'client_credentials'
+
+        ]
+    ];
+
+    public function setUp()
+    {
+        $boostrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $boostrap->createUsergrid();
+    }
+
+    /** @test */
+    public function it_can_retrive_token()
+    {
+
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/QueryAggregatorTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/QueryAggregatorTest.php b/sdks/php5/apache-usergrid/tests/Api/QueryAggregatorTest.php
new file mode 100644
index 0000000..5cf5881
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/QueryAggregatorTest.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api;
+
+
+use Guzzle\Http\QueryString;
+use PHPUnit_Framework_TestCase;
+use Apache\Usergrid\Api\QueryAggregator;
+
+/**
+ * Class QueryAggregatorTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class QueryAggregatorTest extends PHPUnit_Framework_TestCase
+{
+
+    /** @test */
+    public function it_can_test_the_aggregate_method()
+    {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
new file mode 100644
index 0000000..80b919a
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
@@ -0,0 +1,180 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api;
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use PHPUnit_Framework_TestCase;
+
+/**
+ * Class UsergridTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UsergridTest extends PHPUnit_Framework_TestCase
+{
+
+    /** @var  Usergrid Api Client */
+    protected $usergrid;
+
+    protected $config = [
+        'usergrid' => [
+            'url' => 'https://api.usergrid.com',
+            'version' => '1.0.0',
+            'orgName' => null,
+            'appName' => null,
+            'manifestPath' => './src/Manifests/1.0.1',
+            'clientId' => null,
+            'clientSecret' => null,
+            'username' => null,
+            'password' => null,
+            /**
+             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+             * Token from.  You have two options here one is 'application' the other is 'organization'
+             *
+             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+             */
+            'auth_type' => 'organization',
+            /** The Grant Type to use
+             *
+             * This has to be set to one of the 2 grant types that Apache Usergrid
+             * supports which at the moment is client_credentials or password but at
+             * 2 level organization or application
+             */
+            'grant_type' => 'client_credentials'
+
+        ]
+    ];
+    /**
+     * Setup resources and dependencies
+     *
+     * @return void
+     */
+    public function setup()
+    {
+        $boostrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $boostrap->createUsergrid();
+    }
+
+    /** @test */
+    public function it_can_retrieve_oauth2_token()
+    {
+        //TODO: phpunit test method implementation
+    }
+
+    /** @test */
+    public function it_can_set_the_oauth2_token()
+    {
+        $this->usergrid->setToken('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890');
+
+        $this->assertEquals('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', $this->usergrid->getToken());
+    }
+
+    /** @test */
+    public function it_can_retrieve_user_agent()
+    {
+
+        $this->assertEquals('BaaS-Usergrid/1.0.0', $this->usergrid->getUserAgent());
+    }
+
+    /** @test */
+    public function it_can_set_the_user_agent()
+    {
+
+        $this->usergrid->setUserAgent('Foo/Bar');
+
+        $this->assertEquals('Foo/Bar', $this->usergrid->getUserAgent());
+    }
+
+    /** @test */
+    public function it_can_retrieve_the_manifest_path()
+    {
+
+        $this->assertEquals('./src/Manifests/1.0.1', $this->usergrid->getManifestPath());
+    }
+
+    /** @test */
+    public function it_can_set_the_manifest_path()
+    {
+        $this->usergrid->setManifestPath('/usr/foo/bar');
+
+        $this->assertEquals('/usr/foo/bar', $this->usergrid->getManifestPath());
+    }
+
+    /** @test */
+    public function it_can_retrieve_api_version()
+    {
+        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+    }
+
+    /** @test */
+    public function it_can_set_api_version()
+    {
+        $this->usergrid->setVersion('1.0.0');
+
+        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+    }
+
+
+    /** @test */
+    public function it_can_retrieve_the_client_header()
+    {
+        $headers = $this->usergrid->getHeaders();
+
+        $expected = [
+            'Usergrid-Version' => '1.0.0',
+        ];
+
+        $this->assertEquals($headers, $expected);
+    }
+
+    /** @test */
+    public function it_can_set_client_headers()
+    {
+        $this->usergrid->setHeaders([
+            'some-header' => 'foo-bar',
+        ]);
+
+        $headers = $this->usergrid->getHeaders();
+
+        $expected = [
+            'some-header'    => 'foo-bar',
+            'Usergrid-Version' => '1.0.0',
+        ];
+
+        $this->assertEquals($headers, $expected);
+    }
+
+    /** @test */
+    public function it_can_retrieve_client_id_and_secret()
+    {
+        //TODO: phpunit test method implementation
+    }
+
+    /** @test */
+    public function it_can_set_client_id_and_secret()
+    {
+        //TODO: phpunit test method implementation
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/tests/Laravel/Facades/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Laravel/Facades/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Laravel/Facades/UsergridTest.php
new file mode 100644
index 0000000..9a72f17
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Laravel/Facades/UsergridTest.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Tests\Laravel\Facades;
+
+use ReflectionClass;
+use PHPUnit_Framework_TestCase;
+
+/**
+ * Class UsergridTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UsergridTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_test_it_is_a_facade()
+    {
+        $facade = new ReflectionClass('Illuminate\Support\Facades\Facade');
+
+        $reflection = new ReflectionClass('Apache\Usergrid\Laravel\Facades\Usergrid');
+
+        $this->assertTrue($reflection->isSubclassOf($facade));
+    }
+
+    /** @test */
+    public function it_can_test_it_is_a_facade_accessor()
+    {
+        $reflection = new ReflectionClass('Apache\Usergrid\Laravel\Facades\Usergrid');
+
+        $method = $reflection->getMethod('getFacadeAccessor');
+        $method->setAccessible(true);
+
+
+    }
+}
\ No newline at end of file


[09/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/GuzzleClient.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/GuzzleClient.php b/sdks/php5/apache-usergrid/src/Api/GuzzleClient.php
new file mode 100644
index 0000000..6ef9d8a
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/GuzzleClient.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api;
+
+
+use Guzzle\Service\Client;
+
+/**
+ * Class GuzzleClient
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class GuzzleClient extends Client
+{
+
+    /**
+     * The Usergrid API client instance.
+     *
+     * @var  \Apache\Usergrid\Api\Usergrid
+     */
+    protected $apiClient;
+
+    /**
+     * Returns the Usergrid API client instance.
+     *
+     * @return  \Apache\Usergrid\Api\Usergrid
+     */
+    public function getApiClient()
+    {
+        return $this->apiClient;
+    }
+
+    /**
+     * Sets the Usergrid API client instance.
+     *
+     * @param \Apache\Usergrid\Api\Usergrid $client
+     * @return void
+     */
+    public function setApiClient(Usergrid $client)
+    {
+        $this->apiClient = $client;
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Application.php b/sdks/php5/apache-usergrid/src/Api/Models/Application.php
new file mode 100644
index 0000000..336d6d9
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Application.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Application
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Application extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php b/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
new file mode 100644
index 0000000..e0ee801
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
@@ -0,0 +1,100 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use  Apache\Usergrid\Api\Usergrid;
+use Illuminate\Support\Collection;
+
+/**
+ * Class BaseCollection
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class BaseCollection extends Collection
+{
+    /**
+     * List of API response properties that'll be
+     * automatically converted into collections.
+     *
+     * @var array
+     */
+    protected $collections = [];
+
+    /**
+     * The Usergrid API client instance.
+     *
+     * @var /Apache\Usergrid\Api\Usergrid
+     */
+    protected $apiClient;
+
+    /**
+     * Returns the Usergrid API client instance.
+     *
+     * @return  /Apache\Usergrid\Api\Usergrid  /Apache\Usergrid\Api\Usergrid
+     */
+    public function getApiClient()
+    {
+        return $this->apiClient;
+    }
+
+    /**
+     * Sets the Usergrid API client instance.
+     *
+     * @param Usergrid $client
+     * @internal param $ /Apache\Usergrid\Api\Usergrid $client
+     * @return void
+     */
+    public function setApiClient(Usergrid $client)
+    {
+        $this->apiClient = $client;
+    }
+
+    /**
+     * Returns the given key value from the collection.
+     *
+     * @param  mixed $key
+     * @return mixed
+     */
+    public function __get($key)
+    {
+        if (in_array($key, $this->collections) || array_key_exists($key, $this->collections)) {
+            if ($mappedKey = array_get($this->collections, $key, [])) {
+                $key = strstr($mappedKey, '.', true);
+
+                $query = ltrim(strstr($mappedKey, '.'), '.');
+
+                $data = array_get($this->get($key), $query, []);
+            } else {
+                $data = $this->get($key, []);
+            }
+
+            return new Collection($data);
+        }
+
+        if (method_exists($this, $method = "{$key}Attribute")) {
+            return $this->{$method}($this->get($key));
+        }
+
+        return $this->get($key, null);
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/Collection.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Collection.php b/sdks/php5/apache-usergrid/src/Api/Models/Collection.php
new file mode 100644
index 0000000..9fb6d5b
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Collection.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Collection
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Collection extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/Entity.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Entity.php b/sdks/php5/apache-usergrid/src/Api/Models/Entity.php
new file mode 100644
index 0000000..5063fd0
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Entity.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Entity
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Entity extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/Event.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Event.php b/sdks/php5/apache-usergrid/src/Api/Models/Event.php
new file mode 100644
index 0000000..2e04595
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Event.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Event
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Event extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
new file mode 100644
index 0000000..f8bd6fa
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+use Guzzle\Service\Command\OperationCommand;
+
+/**
+ * Class GuzzleCommandTrait
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+trait GuzzleCommandTrait
+{
+    /**
+     * Create a response model object from a completed command.
+     *
+     * @param OperationCommand $command That serialized the request
+     * @return \Illuminate\Support\Collection
+     */
+    public static function fromCommand(OperationCommand $command)
+    {
+        // Initialize the collection
+        $collection = new self($command->getResponse()->json());
+
+        // Set the Usergrid API client on the collection
+        $collection->setApiClient($command->getClient()->getApiClient());
+
+        // Return the collection
+        return $collection;
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/Organization.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Organization.php b/sdks/php5/apache-usergrid/src/Api/Models/Organization.php
new file mode 100644
index 0000000..adf9833
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Organization.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Organization
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Organization extends BaseCollection implements ResponseClassInterface
+{
+
+    use GuzzleCommandTrait;
+
+    /**
+     * @var
+     */
+    protected $name;
+
+    /**
+     *  Collection Applications
+     *
+     * @var \Apache\Usergrid\Api\Models\Application $properties
+     */
+    protected $applications;
+
+    /** Organization UUID
+     * @var UUID $uuid
+     */
+    protected $uuid;
+
+
+    /**
+     *
+     * @var Array $properties
+     */
+    protected $properties = array();
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Models/User.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/User.php b/sdks/php5/apache-usergrid/src/Api/Models/User.php
new file mode 100644
index 0000000..a2d5ac4
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/User.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class User
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class User extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/QueryAggregator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/QueryAggregator.php b/sdks/php5/apache-usergrid/src/Api/QueryAggregator.php
new file mode 100644
index 0000000..f1362a7
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/QueryAggregator.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api;
+
+
+use Guzzle\Http\QueryString;
+use Guzzle\Http\QueryAggregator\QueryAggregatorInterface;
+
+/**
+ * Class QueryAggregator
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class QueryAggregator implements QueryAggregatorInterface
+{
+
+    /**
+     * {@inheritDoc}
+     */
+    public function aggregate($key, $value, QueryString $query)
+    {
+        $response = [];
+
+        foreach ($value as $k => $v) {
+            if (is_int($k)) {
+                return [
+                    $query->encodeValue("{$key}[]") => $value
+                ];
+            }
+
+            $k = "{$key}[{$k}]";
+
+            if (is_array($v)) {
+                $response = array_merge($response, self::aggregate($k, $v, $query));
+            } else {
+                $response[$query->encodeValue($k)] = $query->encodeValue($v);
+            }
+        }
+
+        return $response;
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
new file mode 100644
index 0000000..9eb9065
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+namespace Apache\Usergrid\Api;
+
+use Guzzle\Service\Command\CommandInterface;
+use Guzzle\Service\Resource\ResourceIterator as BaseIterator;
+
+/**
+ * Class ResourceIterator
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ResourceIterator extends BaseIterator
+{
+    /**
+     * {@inheritDoc}
+     */
+    public function __construct(CommandInterface $command, array $data = [])
+    {
+        parent::__construct($command, $data);
+
+        $this->pageSize = 100;
+    }
+
+    /**
+     * Send a request to retrieve the next page of results. Hook for subclasses to implement.
+     *
+     * @return array Returns the newly loaded resources
+     */
+    protected function sendRequest()
+    {
+        $this->command->set('limit', $this->pageSize);
+
+        if ($this->nextToken) {
+            $this->command->set('cursor', $this->nextToken);
+        }
+
+        $result = $this->command->execute();
+
+        $data = $result['entities'];
+
+        $lastItem = end($data);
+
+        $this->nextToken = $result['has_more'] ? $lastItem['uuid'] : false;
+
+        return $data;
+    }
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
new file mode 100644
index 0000000..5346b2d
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -0,0 +1,453 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api;
+
+
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\Oauth2Plugin;
+use Guzzle\Common\Event;
+use InvalidArgumentException;
+use Guzzle\Service\Description\ServiceDescription;
+use Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin;
+
+/**
+ * Class Usergrid
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Usergrid
+{
+
+    /**
+     *  Header Bearer Token
+     * @var
+     */
+    protected $token;
+
+    /**
+     *  Grant Type Client Id or password
+     * @var
+     */
+    protected $grantType;
+    /**
+     * The Usergrid API version.
+     *
+     * @var string
+     */
+    protected $version = '1.0.0';
+    /**
+     * The manifests path.
+     *
+     * @var string
+     */
+    protected $manifestPath;
+    /**
+     * The Base URL.
+     *
+     * @var string
+     */
+    protected $baseUrl;
+    /**
+     * Oauth2 Guzzle Plugin.
+     *
+     * @var \Apache\Usergrid\Guzzle\Plugin\Oauth2\Oauth2Plugin
+     */
+    protected $oauth2_plugin;
+    /**
+     * @return string
+     */
+    public function getManifestPath()
+    {
+        return $this->manifestPath;
+    }
+
+    /**
+     * @param string $manifestPath
+     * @return $this
+     */
+    public function setManifestPath($manifestPath)
+    {
+        $this->manifestPath = $manifestPath;
+        return $this;
+    }
+
+    /**
+     * The cached manifests data.
+     *
+     * @var array
+     */
+    protected $manifests = [];
+    /**
+     * The user agent.
+     *
+     * @var string
+     */
+    protected $userAgent = 'BaaS-Usergrid/1.0.0';
+
+    /**
+     * The headers to be sent to the Guzzle client.
+     *
+     * @var array
+     */
+    protected $headers = [];
+
+    private $org_name;
+    private $app_name;
+
+    /**
+     * @param null $orgName
+     * @param null $appName
+     * @param $manifestPath
+     * @param $version
+     * @param $baseUrl
+     * @param Oauth2Plugin $oauth2_plugin
+     */
+    function __construct($orgName = null, $appName = null, $manifestPath, $version, $baseUrl, Oauth2Plugin $oauth2_plugin = null)
+    {
+        //Set Version so its added to header
+        $this->setVersion($version); //TODO: move to constructor param
+
+        $this->baseUrl = $baseUrl;
+
+        $this->org_name = $orgName;
+        $this->app_name = $appName;
+
+        //check if OAuth2 plugin is enabled
+        if($oauth2_plugin != null){
+            $this->oauth2_plugin = $oauth2_plugin;
+        }
+
+        // Set the manifest path
+        $this->setManifestPath($manifestPath ?: __DIR__.'/Manifests');
+    }
+
+    /**
+     * Returns the Guzzle client headers.
+     *
+     * @return array
+     */
+    public function getHeaders()
+    {
+        return $this->headers;
+    }
+
+    /**
+     * Sets the Guzzle client headers.
+     *
+     * @param  array $headers
+     * @return $this
+     */
+    public function setHeaders(array $headers = [])
+    {
+        $this->headers = array_merge($this->headers, $headers);
+
+        return $this;
+    }
+
+    /**
+     * @return string
+     */
+    public function getVersion()
+    {
+        return $this->version;
+    }
+
+    /**
+     * @param string $version
+     * @return $this
+     */
+    public function setVersion($version)
+    {
+        $this->version = $version;
+
+        $this->setHeaders([
+            'Usergrid-Version' => (string)$version,
+        ]);
+        return $this;
+    }
+
+    /**
+     * @return string
+     */
+    public function getUserAgent()
+    {
+        return $this->userAgent;
+    }
+
+    /**
+     * @param string $userAgent
+     * @return $this
+     */
+    public function setUserAgent($userAgent)
+    {
+        $this->userAgent = $userAgent;
+
+        return $this;
+    }
+
+    /**
+     * @param mixed $token
+     * @return $this
+     */
+    public function setToken($token)
+    {
+        $this->token = $token;
+
+        $this->setHeaders([
+            'Authorization' => (string)'Bearer ' . $token,
+        ]);
+
+        return $this;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getToken()
+    {
+        return $this->token;
+    }
+
+    /**
+     * Dynamically handle missing methods.
+     *
+     * @param  string $method
+     * @param  array $arguments
+     * @return mixed
+     */
+    public function __call($method, array $arguments = [])
+    {
+        if (substr($method, -8) === 'Iterator') {
+            return $this->handleIteratorRequest($method, $arguments);
+        } elseif ($this->isSingleRequest($method)) {
+            return $this->handleSingleRequest($method, $arguments);
+        }
+
+        return $this->handleRequest($method);
+    }
+
+    /**
+     * Determines if the request is a single request.
+     *
+     * @return bool
+     */
+    protected function isSingleRequest($method)
+    {
+        return (str_singular($method) === $method && $this->manifestExists(str_plural($method)));
+    }
+
+    /**
+     * Handles a single request.
+     *
+     * @param  string $method
+     * @param  array $arguments
+     * @return \Guzzle\Service\Client
+     * @throws \InvalidArgumentException
+     */
+    protected function handleSingleRequest($method, array $arguments = [])
+    {
+        // Check if we have any arguments
+        if (empty($arguments)) {
+            throw new InvalidArgumentException('Not enough arguments provided!');
+        }
+
+        // Pluralize the method name
+        $pluralMethod = str_plural($method);
+
+        // Get the request manifest payload data
+        $manifest = $this->getRequestManifestPayload($pluralMethod);
+
+        if (!$parameters = array_get($manifest, 'find')) {
+            throw new InvalidArgumentException("Undefined method [{$method}] called.");;
+        }
+
+        // Get the required parameters for the request
+        $required = array_where(array_get($parameters, 'parameters'), function ($key, $value) {
+            return $value['required'] === true;
+        });
+
+        // Prepare the arguments for the request
+        $arguments = array_combine(
+            array_keys($required),
+            count($required) === 1 ? (array)$arguments[0] : $arguments
+        );
+
+        // Execute the request
+        return $this->handleRequest($pluralMethod)->find($arguments);
+    }
+
+    /**
+     * Handles an iterator request.
+     *
+     * @param  string $method
+     * @param  array $arguments
+     * @return \Apache\Usergrid\Api\ResourceIterator
+     * @throws \InvalidArgumentException
+     */
+    protected function handleIteratorRequest($method, array $arguments = [])
+    {
+        $client = $this->handleRequest(substr($method, 0, -8));
+
+        $command = $client->getCommand('all', array_get($arguments, 0, []));
+
+        return new ResourceIterator($command, array_get($arguments, 1, []));
+    }
+
+    /**
+     * Handles the current request.
+     *
+     * @param  string $method
+     * @throws InvalidArgumentException
+     * @return \Guzzle\Service\Client
+     */
+    protected function handleRequest($method)
+    {
+        if (!$this->manifestExists($method)) {
+            throw new InvalidArgumentException("Undefined method [{$method}] called.");
+        }
+
+        // Initialize the Guzzle client
+        $client = new GuzzleClient('',['command.params' => ['app_name_or_uuid' => $this->app_name, 'org_name_or_uuid' => $this->org_name]]);
+
+        // Set our own usergrid api client for internal
+        // usage within our api models.
+        $client->setApiClient($this);
+
+        // Set the client user agent
+        $client->setUserAgent($this->getUserAgent(), true);
+
+
+        // Set the headers
+        $client->setDefaultOption('headers', $this->getHeaders());
+
+        // Get the Guzzle event dispatcher
+        $dispatcher = $client->getEventDispatcher();
+
+        // Register the error response plugin for our custom exceptions
+        $dispatcher->addSubscriber(new ErrorResponsePlugin);
+
+        // Listen to the "command.after_prepare" event fired by Guzzle
+        $dispatcher->addListener('command.after_prepare', function (Event $event) {
+            $request = $event['command']->getRequest();
+
+            $request->getQuery()->setAggregator(new QueryAggregator());
+        });
+
+        //check if Oauth 2 plugin is a instance of Oauth2Plugin
+        if($this->oauth2_plugin instanceof Oauth2Plugin) {
+            $dispatcher->addSubscriber($this->oauth2_plugin);
+        }
+
+
+        // Set the manifest payload into the Guzzle client
+        $client->setDescription(ServiceDescription::factory(
+            $this->buildPayload($method)
+        ));
+
+        // Return the Guzzle client
+        return $client;
+    }
+
+    /**
+     * Returns the full versioned manifests path.
+     *
+     * @return string
+     */
+    protected function getFullManifestPath()
+    {
+        return $this->getManifestPath() . '/' . $this->getVersion();
+    }
+
+    /**
+     * Returns the given request manifest file path.
+     *
+     * @param  string $file
+     * @return string
+     */
+    protected function getManifestFilePath($file)
+    {
+        return $this->getFullManifestPath() . '/' . ucwords($file) . '.php';
+    }
+
+    /**
+     * Returns the current request payload.
+     *
+     * @param  string $method
+     * @return array
+     */
+    protected function buildPayload($method)
+    {
+        $operations = $this->getRequestManifestPayload($method);
+
+        $manifest = $this->getRequestManifestPayload('manifest', false);
+
+        return array_merge($manifest, compact('operations'));
+    }
+
+    /**
+     * Returns the given file manifest data.
+     *
+     * @param  string $file
+     * @param  bool $includeErrors
+     * @return array
+     */
+    protected function getRequestManifestPayload($file, $includeErrors = true)
+    {
+        $file = ucwords($file);
+
+        /** @noinspection PhpUnusedLocalVariableInspection */
+        $baseURL = $this->baseUrl;
+
+        if (!$manifest = array_get($this->manifests, $file)) {
+            if ($includeErrors) {
+                /** @noinspection PhpUnusedLocalVariableInspection */
+                $errors = $this->getRequestManifestPayload('errors', false);
+            }
+
+            /** @noinspection PhpIncludeInspection */
+            $manifest = require_once $this->getManifestFilePath($file);
+
+            array_set($this->manifests, $file, $manifest);
+        }
+
+        return $manifest;
+    }
+
+    /**
+     * Checks if the manifest file for the current request exists.
+     *
+     * @param  string $file
+     * @return bool
+     */
+    protected function manifestExists($file)
+    {
+        return file_exists($this->getManifestFilePath($file));
+    }
+
+    /**
+     * fetch token from by making api call,
+     * and call $this->setToken which will set the bearer token in the
+     * http header
+     */
+    protected function fetchToken(){
+
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/AuthorizationCode.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/AuthorizationCode.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/AuthorizationCode.php
new file mode 100755
index 0000000..0a31df6
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/AuthorizationCode.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+use Guzzle\Common\Collection;
+use Guzzle\Http\ClientInterface;
+use Guzzle\Http\Exception\RequestException;
+
+/**
+ * Authorization code grant type.
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749#section-4.1
+ */
+class AuthorizationCode implements GrantTypeInterface
+{
+    /** @var ClientInterface The token endpoint client */
+    protected $client;
+
+    /** @var Collection Configuration settings */
+    protected $config;
+
+    public function __construct(ClientInterface $client, $config)
+    {
+        $this->client = $client;
+        $this->config = Collection::fromConfig($config, array(
+            'client_secret' => '',
+            'scope' => '',
+            'redirect_uri' => '',
+        ), array(
+            'client_id', 'code',
+        ));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getTokenData()
+    {
+        $postBody = array(
+            'grant_type' => 'authorization_code',
+            'code' => $this->config['code'],
+        );
+        if ($this->config['scope']) {
+            $postBody['scope'] = $this->config['scope'];
+        }
+        if ($this->config['redirect_uri']) {
+            $postBody['redirect_uri'] = $this->config['redirect_uri'];
+        }
+        $request = $this->client->post(null, array(), $postBody);
+        $request->setAuth($this->config['client_id'], $this->config['client_secret']);
+        $response = $request->send();
+        $data = $response->json();
+
+        $requiredData = array_flip(array('access_token', 'expires_in', 'refresh_token'));
+        return array_intersect_key($data, $requiredData);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/ClientCredentials.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/ClientCredentials.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/ClientCredentials.php
new file mode 100755
index 0000000..bec4968
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/ClientCredentials.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+use Guzzle\Common\Collection;
+use Guzzle\Http\ClientInterface;
+use Guzzle\Http\Exception\RequestException;
+
+/**
+ * Client credentials grant type.
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749#section-4.4
+ */
+class ClientCredentials implements GrantTypeInterface
+{
+    /** @var ClientInterface The token endpoint client */
+    protected $client;
+
+    /** @var Collection Configuration settings */
+    protected $config;
+
+    public function __construct(ClientInterface $client, $config)
+    {
+        $this->client = $client;
+        $this->config = Collection::fromConfig($config, array(
+            'client_secret' => '',
+            'scope' => '',
+        ), array(
+            'client_id',
+        ));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getTokenData()
+    {
+        $postBody = array(
+            'grant_type' => 'client_credentials',
+            'client_id' => $this->config['client_id'],
+            'client_secret' => $this->config['client_secret']
+        );
+        if ($this->config['scope']) {
+            $postBody['scope'] = $this->config['scope'];
+        }
+        $request = $this->client->post(null, array(), $postBody);
+//        $request->setAuth($this->config['client_id'], $this->config['client_secret']);
+        $response = $request->send();
+        $data = $response->json();
+
+        $requiredData = array_flip(array('access_token', 'expires_in', 'refresh_token'));
+        return array_intersect_key($data, $requiredData);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/GrantTypeInterface.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/GrantTypeInterface.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/GrantTypeInterface.php
new file mode 100755
index 0000000..99096c0
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/GrantTypeInterface.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+
+/**
+ * Interface GrantTypeInterface
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+interface GrantTypeInterface
+{
+    /**
+     * Get the token data returned by the OAuth2 server.
+     *
+     * @return array An array with the following keys:
+     *               - access_token: The access token.
+     *               - expires_in: The access token lifetime, in seconds.
+     *               - refresh_token: The refresh token, if present.
+     */
+    public function getTokenData();
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/HWIOAuthBundleRefreshToken.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/HWIOAuthBundleRefreshToken.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/HWIOAuthBundleRefreshToken.php
new file mode 100755
index 0000000..c0d3713
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/HWIOAuthBundleRefreshToken.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+use Symfony\Component\Security\Core\SecurityContextInterface;
+use HWI\Bundle\OAuthBundle\Security\Http\ResourceOwnerMap;
+
+/**
+ * HWIOAuthBundle Aware Refresh token grant type.
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749#section-6
+ */
+class HWIOAuthBundleRefreshToken implements GrantTypeInterface
+{
+    /** @var SecurityContextInterface Symfony2 security component */
+    protected $securityContext;
+
+    /** @var ResourceOwnerMap         HWIOAuthBundle OAuth2 ResourceOwnerMap */
+    protected $resourceOwnerMap;
+
+    public function __construct(ResourceOwnerMap $resourceOwnerMap, SecurityContextInterface $securityContext)
+    {
+        $this->securityContext = $securityContext;
+        $this->resourceOwnerMap = $resourceOwnerMap;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getTokenData($refreshToken = null)
+    {
+        $token = $this->securityContext->getToken();
+        $resourceName = $token->getResourceOwnerName();
+        $resourceOwner = $this->resourceOwnerMap->getResourceOwnerByName($resourceName);
+
+        $data = $resourceOwner->refreshAccessToken($refreshToken);
+        $token->setRawToken($data);
+        $requiredData = array_flip(array('access_token', 'expires_in', 'refresh_token'));
+
+        return array_intersect_key($data, $requiredData);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/PasswordCredentials.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/PasswordCredentials.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/PasswordCredentials.php
new file mode 100755
index 0000000..44cf77b
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/PasswordCredentials.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+use Guzzle\Common\Collection;
+use Guzzle\Http\ClientInterface;
+use Guzzle\Http\Exception\RequestException;
+
+/**
+ * Resource owner password credentials grant type.
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749#section-4.3
+ */
+class PasswordCredentials implements GrantTypeInterface
+{
+    /** @var ClientInterface The token endpoint client */
+    protected $client;
+
+    /** @var Collection Configuration settings */
+    protected $config;
+
+    public function __construct(ClientInterface $client, $config)
+    {
+        $this->client = $client;
+        $this->config = Collection::fromConfig($config, array(
+            'client_secret' => '',
+            'scope' => '',
+        ), array(
+            'client_id', 'username', 'password'
+        ));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getTokenData()
+    {
+        $postBody = array(
+            'grant_type' => 'password',
+            'username' => $this->config['username'],
+            'password' => $this->config['password'],
+        );
+        if ($this->config['scope']) {
+            $postBody['scope'] = $this->config['scope'];
+        }
+        $request = $this->client->post(null, array(), $postBody);
+        //Note: Usergrid it not using Oauth2 to spec so it dose not need a Auth type set no need to client id + secret when using password
+//        $request->setAuth($this->config['client_id'], $this->config['client_secret']);
+        $response = $request->send();
+        $data = $response->json();
+
+        $requiredData = array_flip(array('access_token', 'expires_in', 'refresh_token'));
+        return array_intersect_key($data, $requiredData);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/RefreshToken.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/RefreshToken.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/RefreshToken.php
new file mode 100755
index 0000000..10999b2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/GrantType/RefreshToken.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType;
+
+use Guzzle\Common\Collection;
+use Guzzle\Http\ClientInterface;
+use Guzzle\Http\Exception\RequestException;
+
+/**
+ * Refresh token grant type.
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749#section-6
+ */
+class RefreshToken implements GrantTypeInterface
+{
+    /** @var ClientInterface The token endpoint client */
+    protected $client;
+
+    /** @var Collection Configuration settings */
+    protected $config;
+
+    public function __construct(ClientInterface $client, $config)
+    {
+        $this->client = $client;
+        $this->config = Collection::fromConfig($config, array(
+            'client_secret' => '',
+            'refresh_token' => '',
+            'scope' => '',
+        ), array(
+            'client_id',
+        ));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getTokenData($refreshToken = null)
+    {
+        $postBody = array(
+            'grant_type' => 'refresh_token',
+            // If no refresh token was provided to the method, use the one
+            // provided to the constructor.
+            'refresh_token' => $refreshToken ?: $this->config['refresh_token'],
+        );
+        if ($this->config['scope']) {
+            $postBody['scope'] = $this->config['scope'];
+        }
+        $request = $this->client->post(null, array(), $postBody);
+        $request->setAuth($this->config['client_id'], $this->config['client_secret']);
+        $response = $request->send();
+        $data = $response->json();
+
+        $requiredData = array_flip(array('access_token', 'expires_in', 'refresh_token'));
+        return array_intersect_key($data, $requiredData);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php
new file mode 100755
index 0000000..e5671f5
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php
@@ -0,0 +1,204 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Guzzle\Plugin\Oauth2;
+
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\GrantTypeInterface;
+use Guzzle\Common\Event;
+use Guzzle\Http\Exception\BadResponseException;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * OAuth2 plugin
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ *
+ * @link http://tools.ietf.org/html/rfc6749
+ */
+class Oauth2Plugin implements EventSubscriberInterface
+{
+
+    /** @var GrantTypeInterface The grant type implementation used to acquire access tokens */
+    protected $grantType;
+
+    /** @var GrantTypeInterface The grant type implementation used to refresh access tokens */
+    protected $refreshTokenGrantType;
+
+    /** @var array An array with the "access_token" and "expires" keys */
+    protected $accessToken;
+
+    /** @var string The refresh token string. * */
+    protected $refreshToken;
+
+    /**
+     * Create a new Oauth2 plugin
+     * @param GrantTypeInterface $grantType
+     * @param GrantTypeInterface $refreshTokenGrantType
+     */
+    public function __construct(GrantTypeInterface $grantType = null, GrantTypeInterface $refreshTokenGrantType = null)
+    {
+        $this->grantType = $grantType;
+        $this->refreshTokenGrantType = $refreshTokenGrantType;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function getSubscribedEvents()
+    {
+        return array(
+            'request.before_send' => 'onRequestBeforeSend',
+            'request.error' => 'onRequestError',
+        );
+    }
+
+    /**
+     * Request before-send event handler.
+     *
+     * Adds the Authorization header if an access token was found.
+     *
+     * @param Event $event Event received
+     */
+    public function onRequestBeforeSend(Event $event)
+    {
+        $accessToken = $this->getAccessToken();
+        if ($accessToken) {
+            $event['request']->setHeader('Authorization', 'Bearer ' . $accessToken['access_token']);
+        }
+    }
+
+    /**
+     * Request error event handler.
+     *
+     * Handles unauthorized errors by acquiring a new access token and
+     * retrying the request.
+     *
+     * @param Event $event Event received
+     */
+    public function onRequestError(Event $event)
+    {
+        if ($event['response']->getStatusCode() == 401) {
+            if ($event['request']->getHeader('X-Guzzle-Retry')) {
+                // We already retried once, give up.
+                return;
+            }
+
+            // Acquire a new access token, and retry the request.
+            $newAccessToken = $this->acquireAccessToken();
+            if ($newAccessToken) {
+                $newRequest = clone $event['request'];
+                $newRequest->setHeader('Authorization', 'Bearer ' . $newAccessToken['access_token']);
+                $newRequest->setHeader('X-Guzzle-Retry', '1');
+                $event['response'] = $newRequest->send();
+                $event->stopPropagation();
+            }
+        }
+    }
+
+    /**
+     * Get the access token.
+     *
+     * Handles token expiration for tokens with an "expires" timestamp.
+     * In case no valid token was found, tries to acquire a new one.
+     *
+     * @return array|null
+     */
+    public function getAccessToken()
+    {
+        if (isset($this->accessToken['expires']) && $this->accessToken['expires'] < time()) {
+            // The access token has expired.
+            $this->accessToken = null;
+        }
+        if (!$this->accessToken) {
+            // Try to acquire a new access token from the server.
+            $this->acquireAccessToken();
+        }
+
+        return $this->accessToken;
+    }
+
+    /**
+     * Set the access token.
+     *
+     * @param array|string $accessToken The access token
+     */
+    public function setAccessToken(array $accessToken)
+    {
+        $this->accessToken = $accessToken;
+    }
+
+    /**
+     * Get the refresh token.
+     *
+     * @return string
+     */
+    public function getRefreshToken()
+    {
+        return $this->refreshToken;
+    }
+
+    /**
+     * Set the refresh token.
+     *
+     * @param string $refreshToken The refresh token
+     */
+    public function setRefreshToken($refreshToken)
+    {
+        $this->refreshToken = $refreshToken;
+    }
+
+    /**
+     * Acquire a new access token from the server.
+     *
+     * @return array|null
+     */
+    protected function acquireAccessToken()
+    {
+        if ($this->refreshTokenGrantType && $this->refreshToken) {
+            try {
+                // Get an access token using the stored refresh token.
+                $tokenData = $this->refreshTokenGrantType->getTokenData($this->refreshToken);
+            } catch (BadResponseException $e) {
+                // The refresh token has probably expired.
+                $this->refreshToken = null;
+            }
+        }
+        if ($this->grantType && !isset($tokenData)) {
+            // Get a new access token.
+            $tokenData = $this->grantType->getTokenData();
+        }
+
+        $this->accessToken = null;
+        if (isset($tokenData)) {
+            // Process the returned data. Both expired_in and refresh_token
+            // are optional parameters.
+            $this->accessToken = array(
+                'access_token' => $tokenData['access_token'],
+            );
+            if (isset($tokenData['expires_in'])) {
+                $this->accessToken['expires'] = time() + $tokenData['expires_in'];
+            }
+            if (isset($tokenData['refresh_token'])) {
+                $this->refreshToken = $tokenData['refresh_token'];
+            }
+        }
+
+        return $this->accessToken;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
new file mode 100644
index 0000000..5bb4115
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Laravel;
+
+
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\PasswordCredentials;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\RefreshToken;
+use Apache\Usergrid\Guzzle\Plugin\Oauth2\Oauth2Plugin;
+use Guzzle\Http\Client;
+use Illuminate\Support\ServiceProvider;
+
+/**
+ * Class ApacheUsergridServiceProvider
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ApacheUsergridServiceProvider extends ServiceProvider
+{
+
+    protected $oauth2Plugin = null;
+    /**
+     *
+     */
+    public function boot()
+    {
+        $this->package('apache/usergrid', 'apache/usergrid', __DIR__ . '/..');
+    }
+
+    /**
+     * Register the service provider.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        $enable_oauth2_plugin = $this->app['config']->get('apache/usergrid::usergrid.enable_oauth2_plugin');
+
+        //check if user managed oauth auth flow
+        if($enable_oauth2_plugin){
+            // Create the Oauth2 Guzzle Plugin.
+            $this->createGuzzleOauth2Plugin();
+        }
+        // register Usergrid
+        $this->registerUsergrid();
+
+    }
+
+    protected function registerUsergrid() {
+
+        $this->app['usergrid'] = $this->app->share(function ($app) {
+
+            $baseUrl = $app['config']->get('apache/usergrid::usergrid.url');
+
+            $orgName = $app['config']->get('apache/usergrid::usergrid.orgName');
+
+            $appName = $app['config']->get('apache/usergrid::usergrid.appName');
+
+            $manifestPath = $app['config']->get('apache/usergrid::usergrid.manifestPath');
+
+            $version = $app['config']->get('apache/usergrid::usergrid.version');
+
+            return new Usergrid($orgName, $appName, $manifestPath, $version, $baseUrl, $this->oauth2Plugin);
+        });
+
+        $this->app->alias('usergrid', 'Apache\Usergrid\Api\Usergrid');
+    }
+
+
+    protected function createGuzzleOauth2Plugin(){
+
+        $base_url = $this->app['config']->get('apache/usergrid::usergrid.url');
+
+        $org_name = $this->app['config']->get('apache/usergrid::usergrid.orgName');
+
+        $app_name = $this->app['config']->get('apache/usergrid::usergrid.appName');
+
+        $grant_type = $this->app['config']->get('apache/usergrid::usergrid.grant_type');
+
+        $client_id = $this->app['config']->get('apache/usergrid::usergrid.clientId');
+
+        $client_secret = $this->app['config']->get('apache/usergrid::usergrid.clientSecret');
+
+        $username = $this->app['config']->get('apache/usergrid::usergrid.username');
+
+        $password = $this->app['config']->get('apache/usergrid::usergrid.password');
+
+
+        if($this->app['config']->get('apache/usergrid::usergrid.auth_type') == 'organization') {
+
+            $url = $base_url.'/management/token';
+
+        } elseif($this->app['config']->get('apache/usergrid::usergrid.auth_type') == 'application')
+        {
+            $url = $base_url.'/'.$org_name.'/'.$app_name.'/token';
+        }
+
+        $oauth2Client = new Client($url);
+
+        if($grant_type  == 'client_credentials') {
+            $config = [
+                'client_id' => $client_id,
+                'client_secret' => $client_secret,
+
+            ];
+            $grantType = new ClientCredentials($oauth2Client, $config);
+            $refreshTokenGrantType = new RefreshToken($oauth2Client,$config);
+            $this->oauth2Plugin = new Oauth2Plugin($grantType, $refreshTokenGrantType);
+
+        } elseif($grant_type == 'password') {
+            $config = [
+                'username' => $username,
+                'password' => $password,
+                'client_id' => $client_id,
+                'client_secret' => $client_secret
+            ];
+            $grantType = new PasswordCredentials($oauth2Client, $config);
+            $refreshTokenGrantType = new RefreshToken($oauth2Client, $config);
+            $this->oauth2Plugin =  new Oauth2Plugin($grantType,$refreshTokenGrantType);
+        }
+
+    }
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Laravel/Facades/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/Facades/Usergrid.php b/sdks/php5/apache-usergrid/src/Laravel/Facades/Usergrid.php
new file mode 100644
index 0000000..1ea29f2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Laravel/Facades/Usergrid.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Laravel\Facades;
+
+
+use Illuminate\Support\Facades\Facade;
+
+/**
+ * Class Usergrid
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Usergrid extends Facade
+{
+    /**
+     * @return string
+     */
+    protected static function getFacadeAccessor()
+    {
+        return "usergrid";
+    }
+
+} 
\ No newline at end of file


[10/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
First commit to ApacheUsergrid for new PHP5 sdks.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1f8a4920
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1f8a4920
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1f8a4920

Branch: refs/heads/master
Commit: 1f8a49207df7007fac8016a4898ab38c41ed4d1f
Parents: 7131c5a
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Fri Oct 24 18:45:13 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Fri Oct 24 18:45:13 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/.gitignore            |   12 +
 sdks/php5/apache-usergrid/LICENSE               |  202 +
 sdks/php5/apache-usergrid/README.md             |  162 +
 sdks/php5/apache-usergrid/TODO.md               |    2 +
 sdks/php5/apache-usergrid/composer.json         |   40 +
 sdks/php5/apache-usergrid/composer.lock         | 1116 +++++
 sdks/php5/apache-usergrid/phpunit.xml           |   29 +
 .../src/Api/Exception/BadRequestException.php   |   33 +
 .../src/Api/Exception/InvalidIdException.php    |   33 +
 .../src/Api/Exception/NotFoundException.php     |   32 +
 .../src/Api/Exception/ServerErrorException.php  |   32 +
 .../src/Api/Exception/UnauthorizedException.php |   33 +
 .../src/Api/Exception/UsergridException.php     |  155 +
 .../apache-usergrid/src/Api/Filters/Boolean.php |   44 +
 .../apache-usergrid/src/Api/Filters/Date.php    |   44 +
 .../apache-usergrid/src/Api/Filters/Number.php  |   48 +
 .../apache-usergrid/src/Api/GuzzleClient.php    |   64 +
 .../src/Api/Models/Application.php              |   35 +
 .../src/Api/Models/BaseCollection.php           |  100 +
 .../src/Api/Models/Collection.php               |   37 +
 .../apache-usergrid/src/Api/Models/Entity.php   |   36 +
 .../apache-usergrid/src/Api/Models/Event.php    |   35 +
 .../src/Api/Models/GuzzleCommandTrait.php       |   50 +
 .../src/Api/Models/Organization.php             |   60 +
 .../apache-usergrid/src/Api/Models/User.php     |   36 +
 .../apache-usergrid/src/Api/QueryAggregator.php |   61 +
 .../src/Api/ResourceIterator.php                |   69 +
 sdks/php5/apache-usergrid/src/Api/Usergrid.php  |  453 ++
 .../Oauth2/GrantType/AuthorizationCode.php      |   77 +
 .../Oauth2/GrantType/ClientCredentials.php      |   74 +
 .../Oauth2/GrantType/GrantTypeInterface.php     |   41 +
 .../GrantType/HWIOAuthBundleRefreshToken.php    |   62 +
 .../Oauth2/GrantType/PasswordCredentials.php    |   74 +
 .../Plugin/Oauth2/GrantType/RefreshToken.php    |   75 +
 .../src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php   |  204 +
 .../Laravel/ApacheUsergridServiceProvider.php   |  142 +
 .../src/Laravel/Facades/Usergrid.php            |   42 +
 .../src/Manifests/1.0.0/Application.php         |  979 ++++
 .../src/Manifests/1.0.0/Errors.php              |   60 +
 .../src/Manifests/1.0.0/Management.php          | 1076 ++++
 .../src/Manifests/1.0.0/Manifest.php            |   25 +
 .../src/Manifests/1.0.0/Notification.php        |  154 +
 .../src/Manifests/1.0.1/Application.php         | 1000 ++++
 .../src/Manifests/1.0.1/Errors.php              |   50 +
 .../src/Manifests/1.0.1/Management.php          |  319 ++
 .../src/Manifests/1.0.1/Manifest.php            |   24 +
 .../src/Manifests/1.0.1/Notification.php        |  154 +
 .../src/Manifests/Application.php               |  985 ++++
 .../src/Manifests/Management.php                | 1381 ++++++
 .../apache-usergrid/src/Manifests/Manifest.php  |   23 +
 .../apache-usergrid/src/Manifests/Usergrid.php  | 4689 ++++++++++++++++++
 .../src/Manifests/applications.json             | 1262 +++++
 .../src/Manifests/management.json               | 1905 +++++++
 .../src/Manifests/resources.json                |   15 +
 .../src/Native/ConfigRepository.php             |  102 +
 .../src/Native/Facades/Usergrid.php             |  119 +
 .../src/Native/UsergridBootstrapper.php         |  151 +
 sdks/php5/apache-usergrid/src/config/config.php |   65 +
 .../tests/Api/ApplicationTest.php               |   86 +
 .../tests/Api/Exception/ExceptionsTest.php      |   95 +
 .../tests/Api/Filters/BooleanTest.php           |   45 +
 .../tests/Api/Filters/DateTest.php              |   41 +
 .../tests/Api/ManagementTest.php                |   77 +
 .../tests/Api/QueryAggregatorTest.php           |   42 +
 .../apache-usergrid/tests/Api/UsergridTest.php  |  180 +
 .../tests/Laravel/Facades/UsergridTest.php      |   53 +
 66 files changed, 19001 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/.gitignore
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/.gitignore b/sdks/php5/apache-usergrid/.gitignore
new file mode 100644
index 0000000..61ba991
--- /dev/null
+++ b/sdks/php5/apache-usergrid/.gitignore
@@ -0,0 +1,12 @@
+# Created by .gitignore support plugin (hsz.mobi)
+### Composer template
+composer.phar
+vendor/
+
+# dot env files
+.env.php
+.evn.*.php
+
+# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+# composer.lock

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/LICENSE
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/LICENSE b/sdks/php5/apache-usergrid/LICENSE
new file mode 100644
index 0000000..e06d208
--- /dev/null
+++ b/sdks/php5/apache-usergrid/LICENSE
@@ -0,0 +1,202 @@
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
new file mode 100644
index 0000000..fe436e2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/README.md
@@ -0,0 +1,162 @@
+# README #
+
+This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
+
+## Getting Started ##
+install as composer package by adding this to your composer.json file.
+
+``` 
+"apache-usergrid" : "dev-master" 
+```
+
+and add the URL to the repositories section within your composer.json file.
+
+```
+"repositories": [{
+    "type" : "vcs",
+    "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+ }]
+```
+
+import the classes ``` include autoload.php ``` then create a new instance of the class with a path to you config file
+
+For native use just create a config file.
+
+```
+use Apache\Usergrid\UsergridBootstrapper;
+
+    $config = [    'usergrid' => [
+                       'url' => 'https://api.usergrid.com',
+                       'version' => '1.0.0',
+                       'orgName' => '',
+                       'appName' => '',
+                       'manifestPath' => './src/Manifests',
+                       'clientId' => '',
+                       'clientSecret' => '',
+                       'username' => '',
+                       'password' => '',
+                       /**
+                        * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+                        * Token from.  You have two options here one is 'application' the other is 'organization'
+                        *
+                        *  organization will get the the token from http://example.com/management/token using  client_credentials or password grant type
+                        *  application will get the token from http://example.com/org_name/app_name/token using client_credentials or password grant type
+                        */
+                       'auth_type' => 'application',
+                       /** The Grant Type to use
+                        *
+                        * This has to be set to one of the 2 grant types that Apache Usergrid
+                        * supports which at the moment is client_credentials or password.
+                        */
+                       'grant_type' => 'client_credentials'
+                        /**
+                        * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+                        * */
+                       'enable_oauth2_plugin' => true
+                   ]];
+                   
+                   $bootstrap = new UsergridBootstrapper($config);
+                   $usergrid = $bootstrap->createUsergrid();
+                   $collection =$usergrid->application()->getEntity(['collection' => 'shops']);
+                   
+```
+
+Or if you like Static Facades
+
+```
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+$bootstrap = new UsergridBootstrapper($config);
+Usergrid::instance($boostraper);
+$res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+
+```
+
+
+### Laravel ###
+In Laravel you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
+then add your client_id and secret to the config file and setup the service provider to app/config providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
+the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade
+example for Laravel
+
+```
+    $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
+```
+
+## how it works ##
+
+ You have one main client called Usergrid so if I wanted to call the Management Api and I have Facades enabled then
+ I would call like this ```Usergrid::Management->getApps();``` or ```Usergrid::Application->getEntity();```
+ 
+ There is one top level manifest file called Manifest.php and contain only top level Guzzle service descriptor properties and a empty operations array so 
+ when calling ```php Usergrid::Management()->getEntity() ```  the Main Manifest file has the operation array filled in by the Management Manifest files operations array
+ and they are cached by the Usergrid web service client. Calls on the Usergrid client are like magic method in the sense that ```php Usergrid::Management()-> method``` call is not
+ backed by a Management class or method its the Manifest that it being selected . Also by using Facades all method are like static method and fit in with newer PHP frameworks just like using the
+ AWS PHP SDK when calling enableFacades() on the AWS factory method.
+ 
+### Error Handling ### 
+All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want to just catch the correct exception eg. resource not found.
+
+```
+try {
+ $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
+} catch(NotFoundException $e) {
+    // Handle resource not found
+}
+
+```
+ 
+### Authentication ###
+  You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api and then set the token on the usergrid instance
+  by default this will manage Oauth2 for you but if you want to do it your self set the config setting to false and then do some like this.
+  
+```
+ $res  =  Usergrid::management()->authPasswordGet($array);
+ $token = $res->get('access_token');
+ Usergrid::setToken($token);
+ 
+```
+ 
+ Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication .
+ * Organization Token -- Top level organization access the token is for the organization.
+ * Organization Admin Token -- Top level Admin user this token is the organizations admin users.
+ * Application Token -- Per Application token that is for the application
+ * Application User Token -- User level access this token is for a logged in user.
+ 
+ The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to each resource
+ the Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
+ resources. The Admin user token is the organization admin user so it too has access to all Applications and Organizations and the last level which is a User
+ Token that is a per application users and will have access to all resources that roles attached to that user can access.
+ 
+So there are two settings in the config that controls which type of token you get.
+the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
+which type of credentials you use which can be either client_id & client_secret or username & password
+
+
+## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
+All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
+the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.
+Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
+
+## designs guidelines ##
+The design of this is to make it easy to add to existing project and be able to map Model objects in yor project 
+to response models for example in my project I have a organization object that is saved in a mysql database and I can
+call a Usergrid Api call on that model object just like using the Usergrid api class eg:
+``` Usergrid::Mangement->putOrganization($data_array) ``` is the same as
+``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
+Gateway Objects using php Traits
+
+
+## Javascript ##
+There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
+to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
+the javascript file in you page but It only works with Laravel as it posts the token to a route bu it would not be hard to use else where its not part of this SDK so think
+of it as a helper as some times it good to have access to both world server side calls for and Ajax calls using the one login token.
+
+
+### Contribution guidelines ###
+* Please help if you like this.
+* Writing tests
+* Code review
+* Code
+* Manifest files
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/TODO.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/TODO.md b/sdks/php5/apache-usergrid/TODO.md
new file mode 100644
index 0000000..9038491
--- /dev/null
+++ b/sdks/php5/apache-usergrid/TODO.md
@@ -0,0 +1,2 @@
+## To Do ##
+PHP unit tests , I need to create test for most API calls 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/composer.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/composer.json b/sdks/php5/apache-usergrid/composer.json
new file mode 100644
index 0000000..afa4756
--- /dev/null
+++ b/sdks/php5/apache-usergrid/composer.json
@@ -0,0 +1,40 @@
+{
+    "name": "apache/usergrid",
+    "description": "Apache Usergrid PHP SDK guzzle web service client and service descriptor to interact with usergrid management and application api",
+    "minimum-stability": "dev",
+    "license": "Apache",
+    "authors": [
+        {
+            "name": "Jason Kristian",
+            "email": "jasonk@apps4u.com.au"
+        }
+    ],
+    "repositories": [
+        {
+            "type" : "vcs",
+            "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+        }
+    ],
+    "require": {
+        "guzzle/guzzle": "3.9.*",
+        "illuminate/support": "~4.2",
+        "nesbot/carbon": "~1.0"
+
+    },
+    "require-dev": {
+        "mockery/mockery": "~0.9",
+        "phpunit/phpunit": "~4.0"
+    },
+    "autoload": {
+        "classmap": [],
+        "psr-4": {
+            "Apache\\Usergrid\\": "src/"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "master"
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/composer.lock
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/composer.lock b/sdks/php5/apache-usergrid/composer.lock
new file mode 100644
index 0000000..1dd33b1
--- /dev/null
+++ b/sdks/php5/apache-usergrid/composer.lock
@@ -0,0 +1,1116 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "This file is @generated automatically"
+    ],
+    "hash": "b5596d79dd2dd146c428d2e33431ed20",
+    "packages": [
+        {
+            "name": "guzzle/guzzle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/guzzle3.git",
+                "reference": "3c0ca2255751631f1dd64eb16bbe3b9440258297"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/3c0ca2255751631f1dd64eb16bbe3b9440258297",
+                "reference": "3c0ca2255751631f1dd64eb16bbe3b9440258297",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
+                "php": ">=5.3.3",
+                "symfony/event-dispatcher": "~2.1"
+            },
+            "replace": {
+                "guzzle/batch": "self.version",
+                "guzzle/cache": "self.version",
+                "guzzle/common": "self.version",
+                "guzzle/http": "self.version",
+                "guzzle/inflection": "self.version",
+                "guzzle/iterator": "self.version",
+                "guzzle/log": "self.version",
+                "guzzle/parser": "self.version",
+                "guzzle/plugin": "self.version",
+                "guzzle/plugin-async": "self.version",
+                "guzzle/plugin-backoff": "self.version",
+                "guzzle/plugin-cache": "self.version",
+                "guzzle/plugin-cookie": "self.version",
+                "guzzle/plugin-curlauth": "self.version",
+                "guzzle/plugin-error-response": "self.version",
+                "guzzle/plugin-history": "self.version",
+                "guzzle/plugin-log": "self.version",
+                "guzzle/plugin-md5": "self.version",
+                "guzzle/plugin-mock": "self.version",
+                "guzzle/plugin-oauth": "self.version",
+                "guzzle/service": "self.version",
+                "guzzle/stream": "self.version"
+            },
+            "require-dev": {
+                "doctrine/cache": "~1.3",
+                "monolog/monolog": "~1.0",
+                "phpunit/phpunit": "3.7.*",
+                "psr/log": "~1.0",
+                "symfony/class-loader": "~2.1",
+                "zendframework/zend-cache": "2.*,<2.3",
+                "zendframework/zend-log": "2.*,<2.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.9-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Guzzle": "src/",
+                    "Guzzle\\Tests": "tests/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Guzzle Community",
+                    "homepage": "https://github.com/guzzle/guzzle/contributors"
+                }
+            ],
+            "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+            "homepage": "http://guzzlephp.org/",
+            "keywords": [
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "rest",
+                "web service"
+            ],
+            "time": "2014-10-15 19:36:56"
+        },
+        {
+            "name": "illuminate/support",
+            "version": "4.2.x-dev",
+            "target-dir": "Illuminate/Support",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/illuminate/support.git",
+                "reference": "4831699d6bcddd766e3cebbd8279976854d37027"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/illuminate/support/zipball/4831699d6bcddd766e3cebbd8279976854d37027",
+                "reference": "4831699d6bcddd766e3cebbd8279976854d37027",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "jeremeamia/superclosure": "~1.0.1",
+                "patchwork/utf8": "1.1.*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.2-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Illuminate\\Support": ""
+                },
+                "files": [
+                    "Illuminate/Support/helpers.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Taylor Otwell",
+                    "email": "taylorotwell@gmail.com"
+                }
+            ],
+            "time": "2014-09-27 01:17:10"
+        },
+        {
+            "name": "nesbot/carbon",
+            "version": "1.13.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/briannesbitt/Carbon.git",
+                "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/5cb6e71055f7b0b57956b73d324cc4de31278f42",
+                "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "Carbon": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Nesbitt",
+                    "email": "brian@nesbot.com",
+                    "homepage": "http://nesbot.com"
+                }
+            ],
+            "description": "A simple API extension for DateTime.",
+            "homepage": "https://github.com/briannesbitt/Carbon",
+            "keywords": [
+                "date",
+                "datetime",
+                "time"
+            ],
+            "time": "2014-09-26 02:52:02"
+        },
+        {
+            "name": "symfony/event-dispatcher",
+            "version": "dev-master",
+            "target-dir": "Symfony/Component/EventDispatcher",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/EventDispatcher.git",
+                "reference": "e133748fd9165e24f8e9498ef5862f8bd37004e5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e133748fd9165e24f8e9498ef5862f8bd37004e5",
+                "reference": "e133748fd9165e24f8e9498ef5862f8bd37004e5",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "~2.0",
+                "symfony/dependency-injection": "~2.6",
+                "symfony/expression-language": "~2.6",
+                "symfony/stopwatch": "~2.2"
+            },
+            "suggest": {
+                "symfony/dependency-injection": "",
+                "symfony/http-kernel": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\EventDispatcher\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                },
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                }
+            ],
+            "description": "Symfony EventDispatcher Component",
+            "homepage": "http://symfony.com",
+            "time": "2014-10-04 06:08:58"
+        }
+    ],
+    "packages-dev": [
+        {
+            "name": "doctrine/instantiator",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/instantiator.git",
+                "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119",
+                "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3,<8.0-DEV"
+            },
+            "require-dev": {
+                "athletic/athletic": "~0.1.8",
+                "ext-pdo": "*",
+                "ext-phar": "*",
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "2.0.*@ALPHA"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Doctrine\\Instantiator\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "http://ocramius.github.com/"
+                }
+            ],
+            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+            "homepage": "https://github.com/doctrine/instantiator",
+            "keywords": [
+                "constructor",
+                "instantiate"
+            ],
+            "time": "2014-10-13 12:58:55"
+        },
+        {
+            "name": "mockery/mockery",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/padraic/mockery.git",
+                "reference": "8e567de2249a8f7eb8051a855b9d0a6472d38c8e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/padraic/mockery/zipball/8e567de2249a8f7eb8051a855b9d0a6472d38c8e",
+                "reference": "8e567de2249a8f7eb8051a855b9d0a6472d38c8e",
+                "shasum": ""
+            },
+            "require": {
+                "lib-pcre": ">=7.0",
+                "php": ">=5.3.2"
+            },
+            "require-dev": {
+                "hamcrest/hamcrest-php": "~1.1",
+                "phpunit/phpunit": "~4.0",
+                "satooshi/php-coveralls": "~0.7@dev"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "0.9.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Mockery": "library/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Pádraic Brady",
+                    "email": "padraic.brady@gmail.com",
+                    "homepage": "http://blog.astrumfutura.com"
+                },
+                {
+                    "name": "Dave Marshall",
+                    "email": "dave.marshall@atstsolutions.co.uk",
+                    "homepage": "http://davedevelopment.co.uk"
+                }
+            ],
+            "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
+            "homepage": "http://github.com/padraic/mockery",
+            "keywords": [
+                "BDD",
+                "TDD",
+                "library",
+                "mock",
+                "mock objects",
+                "mockery",
+                "stub",
+                "test",
+                "test double",
+                "testing"
+            ],
+            "time": "2014-10-16 09:15:15"
+        },
+        {
+            "name": "phpunit/php-code-coverage",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+                "reference": "28d21b57c189cb72829056353de603c4d4da55a0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/28d21b57c189cb72829056353de603c4d4da55a0",
+                "reference": "28d21b57c189cb72829056353de603c4d4da55a0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "phpunit/php-file-iterator": "~1.3",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-token-stream": "~1.3",
+                "sebastian/environment": "~1.0",
+                "sebastian/version": "~1.0"
+            },
+            "require-dev": {
+                "ext-xdebug": ">=2.1.4",
+                "phpunit/phpunit": "dev-master"
+            },
+            "suggest": {
+                "ext-dom": "*",
+                "ext-xdebug": ">=2.2.1",
+                "ext-xmlwriter": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+            "keywords": [
+                "coverage",
+                "testing",
+                "xunit"
+            ],
+            "time": "2014-10-05 10:46:54"
+        },
+        {
+            "name": "phpunit/php-file-iterator",
+            "version": "1.3.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "File/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+            "keywords": [
+                "filesystem",
+                "iterator"
+            ],
+            "time": "2013-10-10 15:34:57"
+        },
+        {
+            "name": "phpunit/php-text-template",
+            "version": "1.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-text-template.git",
+                "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+                "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "Text/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Simple template engine.",
+            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+            "keywords": [
+                "template"
+            ],
+            "time": "2014-01-30 17:20:04"
+        },
+        {
+            "name": "phpunit/php-timer",
+            "version": "1.0.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-timer.git",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "PHP/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Utility class for timing",
+            "homepage": "https://github.com/sebastianbergmann/php-timer/",
+            "keywords": [
+                "timer"
+            ],
+            "time": "2013-08-02 07:42:54"
+        },
+        {
+            "name": "phpunit/php-token-stream",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+                "reference": "f8d5d08c56de5cfd592b3340424a81733259a876"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876",
+                "reference": "f8d5d08c56de5cfd592b3340424a81733259a876",
+                "shasum": ""
+            },
+            "require": {
+                "ext-tokenizer": "*",
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Wrapper around PHP's tokenizer extension.",
+            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+            "keywords": [
+                "tokenizer"
+            ],
+            "time": "2014-08-31 06:12:13"
+        },
+        {
+            "name": "phpunit/phpunit",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit.git",
+                "reference": "628bcfbbefa0e47dbb7d773021338590bd7586ee"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/628bcfbbefa0e47dbb7d773021338590bd7586ee",
+                "reference": "628bcfbbefa0e47dbb7d773021338590bd7586ee",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "ext-json": "*",
+                "ext-pcre": "*",
+                "ext-reflection": "*",
+                "ext-spl": "*",
+                "php": ">=5.3.3",
+                "phpunit/php-code-coverage": "3.0.*@dev",
+                "phpunit/php-file-iterator": "~1.3.2",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-timer": "~1.0.2",
+                "phpunit/phpunit-mock-objects": "2.4.*@dev",
+                "sebastian/comparator": "1.1.*@dev",
+                "sebastian/diff": "~1.1",
+                "sebastian/environment": "~1.2",
+                "sebastian/exporter": "~1.0",
+                "sebastian/global-state": "1.0.*@dev",
+                "sebastian/version": "~1.0",
+                "symfony/yaml": "~2.0"
+            },
+            "suggest": {
+                "phpunit/php-invoker": "~1.1"
+            },
+            "bin": [
+                "phpunit"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.5.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "The PHP Unit Testing framework.",
+            "homepage": "https://phpunit.de/",
+            "keywords": [
+                "phpunit",
+                "testing",
+                "xunit"
+            ],
+            "time": "2014-10-22 11:54:43"
+        },
+        {
+            "name": "phpunit/phpunit-mock-objects",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+                "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+                "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/instantiator": "~1.0,>=1.0.2",
+                "php": ">=5.3.3",
+                "phpunit/php-text-template": "~1.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.4.*@dev"
+            },
+            "suggest": {
+                "ext-soap": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.4.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Mock Object library for PHPUnit",
+            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+            "keywords": [
+                "mock",
+                "xunit"
+            ],
+            "time": "2014-10-04 10:04:20"
+        },
+        {
+            "name": "sebastian/comparator",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/comparator.git",
+                "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6f67d2ae044ba17ba30573941f4ac96c4777be97",
+                "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "sebastian/diff": "~1.1",
+                "sebastian/exporter": "~1.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides the functionality to compare PHP values for equality",
+            "homepage": "http://www.github.com/sebastianbergmann/comparator",
+            "keywords": [
+                "comparator",
+                "compare",
+                "equality"
+            ],
+            "time": "2014-10-21 10:04:18"
+        },
+        {
+            "name": "sebastian/diff",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/diff.git",
+                "reference": "92d423df43b160006907ea4297b916fdf00415d8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/92d423df43b160006907ea4297b916fdf00415d8",
+                "reference": "92d423df43b160006907ea4297b916fdf00415d8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Kore Nordmann",
+                    "email": "mail@kore-nordmann.de"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Diff implementation",
+            "homepage": "http://www.github.com/sebastianbergmann/diff",
+            "keywords": [
+                "diff"
+            ],
+            "time": "2014-10-19 13:19:30"
+        },
+        {
+            "name": "sebastian/environment",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/environment.git",
+                "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0d9bf79554d2a999da194a60416c15cf461eb67d",
+                "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides functionality to handle HHVM/PHP environments",
+            "homepage": "http://www.github.com/sebastianbergmann/environment",
+            "keywords": [
+                "Xdebug",
+                "environment",
+                "hhvm"
+            ],
+            "time": "2014-10-22 06:38:05"
+        },
+        {
+            "name": "sebastian/exporter",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/exporter.git",
+                "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+                "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                },
+                {
+                    "name": "Adam Harvey",
+                    "email": "aharvey@php.net"
+                }
+            ],
+            "description": "Provides the functionality to export PHP variables for visualization",
+            "homepage": "http://www.github.com/sebastianbergmann/exporter",
+            "keywords": [
+                "export",
+                "exporter"
+            ],
+            "time": "2014-09-10 00:51:36"
+        },
+        {
+            "name": "sebastian/global-state",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/global-state.git",
+                "reference": "231d48620efde984fd077ee92916099a3ece9a59"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/231d48620efde984fd077ee92916099a3ece9a59",
+                "reference": "231d48620efde984fd077ee92916099a3ece9a59",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "suggest": {
+                "ext-uopz": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Snapshotting of global state",
+            "homepage": "http://www.github.com/sebastianbergmann/global-state",
+            "keywords": [
+                "global state"
+            ],
+            "time": "2014-10-06 09:49:11"
+        },
+        {
+            "name": "sebastian/version",
+            "version": "1.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/version.git",
+                "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+                "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+                "shasum": ""
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+            "homepage": "https://github.com/sebastianbergmann/version",
+            "time": "2014-03-07 15:35:33"
+        },
+        {
+            "name": "symfony/yaml",
+            "version": "dev-master",
+            "target-dir": "Symfony/Component/Yaml",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/Yaml.git",
+                "reference": "499f7d7aa96747ad97940089bd7a1fb24ad8182a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/Yaml/zipball/499f7d7aa96747ad97940089bd7a1fb24ad8182a",
+                "reference": "499f7d7aa96747ad97940089bd7a1fb24ad8182a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\Yaml\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                },
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                }
+            ],
+            "description": "Symfony Yaml Component",
+            "homepage": "http://symfony.com",
+            "time": "2014-10-05 13:53:50"
+        }
+    ],
+    "aliases": [],
+    "minimum-stability": "dev",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "platform": [],
+    "platform-dev": []
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/phpunit.xml
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/phpunit.xml b/sdks/php5/apache-usergrid/phpunit.xml
new file mode 100644
index 0000000..374f8ad
--- /dev/null
+++ b/sdks/php5/apache-usergrid/phpunit.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="vendor/autoload.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false"
+         syntaxCheck="false"
+        >
+    <testsuites>
+        <testsuite name="Apache Usergrid PHP SDK Test Suite">
+            <directory>./tests</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist>
+            <directory suffix=".php">./src/</directory>
+            <exclude>
+                <file>./src/Laravel/ApacheUsergridServiceProvider.php</file>
+            </exclude>
+        </whitelist>
+    </filter>
+    <logging>
+        <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
+    </logging>
+</phpunit>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php b/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
new file mode 100644
index 0000000..c6a2453
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class BadRequestException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class BadRequestException extends UsergridException{
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php b/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
new file mode 100644
index 0000000..c59a683
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class InvalidIdException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class InvalidIdException extends UsergridException
+{
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php b/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
new file mode 100644
index 0000000..a13277b
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class NotFoundException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class NotFoundException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php b/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
new file mode 100644
index 0000000..2525e12
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class ServerErrorException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ServerErrorException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php b/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
new file mode 100644
index 0000000..d7d3694
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class UnauthorizedException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UnauthorizedException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php b/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
new file mode 100644
index 0000000..4c6057f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+namespace Apache\Usergrid\Api\Exception;
+
+
+use Exception;
+use Guzzle\Http\Message\Request;
+use Guzzle\Http\Message\Response;
+use Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface;
+use Guzzle\Service\Command\CommandInterface;
+
+/**
+ * Class UsergridException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UsergridException extends Exception implements ErrorResponseExceptionInterface
+{
+    /**
+     * The Guzzle request.
+     *
+     * @var \Guzzle\Http\Message\Request
+     */
+    protected $request;
+
+    /**
+     * The Guzzle response.
+     *
+     * @var \Guzzle\Http\Message\Response
+     */
+    protected $response;
+
+    /**
+     * The error type returned by Usergrid.
+     *
+     * @var string
+     */
+    protected $errorType;
+
+    /**
+     * {@inheritDoc}
+     */
+    public static function fromCommand(CommandInterface $command, Response $response)
+    {
+        $errors = json_decode($response->getBody(true), true);
+
+        $type = array_get($errors, 'error.type', null);
+
+        $code = array_get($errors, 'error.code', null);
+
+        $message = array_get($errors, 'error.message', null);
+
+        $class = '\\Apache\\Usergrid\\Api\\Exception\\'.studly_case($type).'Exception';
+
+        if (class_exists($class))
+        {
+            $exception = new $class($message, $response->getStatusCode());
+        }
+        else
+        {
+            $exception = new static($message, $response->getStatusCode());
+        }
+
+        $exception->setErrorType($type);
+
+        $exception->setResponse($response);
+
+        $exception->setRequest($command->getRequest());
+
+        return $exception;
+    }
+
+    /**
+     * Returns the Guzzle request.
+     *
+     * @return \Guzzle\Http\Message\Request
+     */
+    public function getRequest()
+    {
+        return $this->request;
+    }
+
+    /**
+     * Sets the Guzzle request.
+     *
+     * @param  \Guzzle\Http\Message\Request  $request
+     * @return void
+     */
+    public function setRequest(Request $request)
+    {
+        $this->request = $request;
+    }
+
+    /**
+     * Returns the Guzzle response.
+     *
+     * @return \Guzzle\Http\Message\Response
+     */
+    public function getResponse()
+    {
+        return $this->response;
+    }
+
+    /**
+     * Sets the Guzzle response.
+     *
+     * @param  \Guzzle\Http\Message\Response  $response
+     * @return void
+     */
+    public function setResponse(Response $response)
+    {
+        $this->response = $response;
+    }
+
+    /**
+     * Returns the error type returned by Usergrid.
+     *
+     * @return string
+     */
+    public function getErrorType()
+    {
+        return $this->errorType;
+    }
+
+    /**
+     * Sets the error type returned by Usergrid.
+     *
+     * @param  string  $errorType
+     * @return void
+     */
+    public function setErrorType($errorType)
+    {
+        $this->errorType = $errorType;
+    }
+
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php b/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
new file mode 100644
index 0000000..021f2fd
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+
+/**
+ * Class Boolean
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Boolean
+{
+
+    /**
+     * Converts a boolean into its string representation.
+     *
+     * @param  bool $boolean
+     * @return string
+     */
+    public static function convert($boolean)
+    {
+        return $boolean ? 'true' : 'false';
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Date.php b/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
new file mode 100644
index 0000000..8b3c5c6
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+use Carbon\Carbon;
+
+/**
+ * Class Date
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Date
+{
+
+    /**
+     * @param $date
+     * @return static
+     */
+    public static function convert($date)
+    {
+        $date2 = (int)($date / 1000);
+        $date_string = Carbon::createFromTimestampUTC($date2)->toDayDateTimeString();
+        return $date_string;
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Number.php b/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
new file mode 100644
index 0000000..41047d3
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+
+/**
+ * Class Number
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Number
+{
+
+    /**
+     * Converts a number into an integer.
+     *
+     * @param  mixed $number
+     * @return int
+     */
+    public static function convert($number)
+    {
+        if (is_string($number) || is_float($number)) {
+            return (int)($number * 100);
+        }
+
+        return $number;
+    }
+
+}


[14/45] incubator-usergrid git commit: Update ResourceIterator.php

Posted by ro...@apache.org.
Update ResourceIterator.php

fixed last edit had the cursor as last item I forgot to change  $result['entities'] back to $result which I change for some testing and forgot to change back.

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/21e3aafa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/21e3aafa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/21e3aafa

Branch: refs/heads/master
Commit: 21e3aafab8fb1a94cde873a6c02ddecca392e850
Parents: 96455ee
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sun Oct 26 17:05:03 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sun Oct 26 17:05:03 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/21e3aafa/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index 643d089..5bb5432 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -57,13 +57,13 @@ class ResourceIterator extends BaseIterator
 
         $result = $this->command->execute();
 
-        $data = $result['entities'];
+        $data = $result;
 
         $lastItem = end($data);
 
-        $this->nextToken = $result['cursor'] ? $lastItem['uuid'] : false;
+        $this->nextToken = $result['cursor'] ? $lastItem['cursor'] : false;
 
         return $data;
     }
 
-} 
\ No newline at end of file
+} 


[21/45] incubator-usergrid git commit: add space after ' in error class and the client could not find the errors

Posted by ro...@apache.org.
add space after ' in error class and the client could not find the errors

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9737c934
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9737c934
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9737c934

Branch: refs/heads/master
Commit: 9737c9346c4b9f3662fdf426308c5bbc299943ce
Parents: 7122b21
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Oct 31 14:43:53 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Oct 31 14:43:53 2014 +1000

----------------------------------------------------------------------
 .../src/Manifests/1.0.1/Errors.php                | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9737c934/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
index 8a5fe6d..de2da47 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
@@ -16,35 +16,35 @@
 
 return [
     [
-        'class' => ' Apache\Usergrid\Api\Exception\BadRequestException',
+        'class' => 'Apache\Usergrid\Api\Exception\BadRequestException',
         'code' => 400,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\UnauthorizedException',
+        'class' => 'Apache\Usergrid\Api\Exception\UnauthorizedException',
         'code' => 401,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\RequestFailedException',
+        'class' => 'Apache\Usergrid\Api\Exception\RequestFailedException',
         'code' => 402,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\NotFoundException',
+        'class' => 'Apache\Usergrid\Api\Exception\NotFoundException',
         'code' => 404,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
         'code' => 500,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
         'code' => 502,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
         'code' => 503,
     ],
     [
-        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
         'code' => 504,
     ],
-];
\ No newline at end of file
+];


[20/45] incubator-usergrid git commit: added http headers how too, to the README.md file

Posted by ro...@apache.org.
added http headers how too, to the README.md file

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7122b21a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7122b21a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7122b21a

Branch: refs/heads/master
Commit: 7122b21a69891a4ed24b2db82d46c16d0db3cb2f
Parents: 3136d91
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Oct 27 13:37:40 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Oct 27 13:37:40 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/README.md | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7122b21a/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index b0ca6d4..f4787d4 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -144,7 +144,12 @@ foreach($allDevices as $device) {
 // this will have all devices. 
 }
 ```
-
+### HTTP headers and UserAgents ###
+ When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
+ can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 
+ have some customer analytics set up on your version of usergrid server then just pass the headers you like in a fluent way eg:
+ ``` Usergrid::setHeaders(['BAAS-PLATFORM-ANALYTICS' => 'user001'])->users()->findById(['uuid' => '12343']); ```
+ 
 ## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
 All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
 the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.


[17/45] incubator-usergrid git commit: Had to move the enable_oauth2_plugin check in to the RegisterUsergrid function left note as to why

Posted by ro...@apache.org.
Had to move the enable_oauth2_plugin check in to the RegisterUsergrid function left note as to why

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/83ca146a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/83ca146a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/83ca146a

Branch: refs/heads/master
Commit: 83ca146a992c80881d8d10b6859c919dcd1fb9ed
Parents: 143a025
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Oct 27 12:37:38 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Oct 27 12:37:38 2014 +1000

----------------------------------------------------------------------
 .../Laravel/ApacheUsergridServiceProvider.php   | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/83ca146a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
index d24ad40..2e6bda4 100644
--- a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -15,6 +15,7 @@
  */
 namespace Apache\Usergrid\Laravel;
 
+
 use Apache\Usergrid\Api\Usergrid;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\PasswordCredentials;
@@ -52,13 +53,6 @@ class ApacheUsergridServiceProvider extends ServiceProvider
      */
     public function register()
     {
-        $enable_oauth2_plugin = $this->app['config']->get('apache/usergrid::usergrid.enable_oauth2_plugin');
-
-        //check if user managed oauth auth flow
-        if($enable_oauth2_plugin){
-            // Create the Oauth2 Guzzle Plugin.
-            $this->createGuzzleOauth2Plugin();
-        }
         // register Usergrid
         $this->registerUsergrid();
 
@@ -68,6 +62,27 @@ class ApacheUsergridServiceProvider extends ServiceProvider
 
         $this->app['usergrid'] = $this->app->share(function ($app) {
 
+            /** Note: I had to move this to here from the register function as the below config values would not get set and would be null
+             * unless I has this with the package namespace missing but doing that would mean that it would not find the  enable_oauth2_plugin
+             * value .. This has been driving me crazy as I tried to read the config values from a rout and they would not show up
+             * then I did . Also this would not find the config values if the boot function did not have the package method called with
+             * all 3 args
+            $enable_oauth2_plugin = $this->app['config']->get('usergrid.enable_oauth2_plugin');
+
+            //check if user managed oauth auth flow
+            if($enable_oauth2_plugin){
+            // Create the Oauth2 Guzzle Plugin.
+            $this->createGuzzleOauth2Plugin();
+            }
+             */
+            $enable_oauth2_plugin = $app['config']->get('apache/usergrid::usergrid.enable_oauth2_plugin');
+
+            //check if user managed oauth auth flow
+            if($enable_oauth2_plugin){
+                // Create the Oauth2 Guzzle Plugin.
+                $this->createGuzzleOauth2Plugin();
+            }
+
             $baseUrl = $app['config']->get('apache/usergrid::usergrid.url');
 
             $orgName = $app['config']->get('apache/usergrid::usergrid.orgName');


[22/45] incubator-usergrid git commit: had to remove space from class string as web client could not find the error classes

Posted by ro...@apache.org.
had to remove space from class string as web client could not find the error classes

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4de1a9c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4de1a9c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4de1a9c5

Branch: refs/heads/master
Commit: 4de1a9c525e21b653e108f18fd81c1b73377c68d
Parents: 9737c93
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Oct 31 14:44:52 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Oct 31 14:44:52 2014 +1000

----------------------------------------------------------------------
 .../apache-usergrid/src/Manifests/1.0.0/Errors.php    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4de1a9c5/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
index 91fa18f..aadb172 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
@@ -18,17 +18,17 @@
 return [
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\BadRequestException',
+		'class' => 'Apache\Usergrid\Api\Exception\BadRequestException',
 		'code'  => 400,
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\UnauthorizedException',
+		'class' => 'Apache\Usergrid\Api\Exception\UnauthorizedException',
 		'code'  => 401,
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\RequestFailedException',
+		'class' => 'Apache\Usergrid\Api\Exception\RequestFailedException',
 		'code'  => 402,
 	],
 
@@ -38,22 +38,22 @@ return [
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
 		'code'  => 500,
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
 		'code'  => 502,
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
 		'code'  => 503,
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
 		'code'  => 504,
 	],
 


[12/45] incubator-usergrid git commit: fixed iterator had typo .

Posted by ro...@apache.org.
fixed iterator had typo .


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5ba6f0be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5ba6f0be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5ba6f0be

Branch: refs/heads/master
Commit: 5ba6f0bef0a17089b67e2500b565619d8f4a14dd
Parents: bf7aaba
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Sun Oct 26 15:58:07 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Sun Oct 26 15:58:07 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5ba6f0be/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index 9eb9065..e26f38f 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -39,7 +39,7 @@ class ResourceIterator extends BaseIterator
     {
         parent::__construct($command, $data);
 
-        $this->pageSize = 100;
+        $this->pageSize = 20;
     }
 
     /**
@@ -61,7 +61,7 @@ class ResourceIterator extends BaseIterator
 
         $lastItem = end($data);
 
-        $this->nextToken = $result['has_more'] ? $lastItem['uuid'] : false;
+        $this->nextToken = $result['cursor'] ? $lastItem['cursor'] : false;
 
         return $data;
     }


[26/45] incubator-usergrid git commit: fix iterator I still had last sdks responses not usergrid now iterator will work on entities not the whole result which is why responseType is now model in all descriptors

Posted by ro...@apache.org.
fix iterator I still had last sdks responses not usergrid now iterator will work on entities not the whole result which is why responseType is now model in all descriptors

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b79f6153
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b79f6153
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b79f6153

Branch: refs/heads/master
Commit: b79f61538272c1126000f8fcd023d432f107a7a8
Parents: 4bd2360
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Oct 31 17:34:25 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Oct 31 17:34:25 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b79f6153/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index be3d79c..9be318a 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -57,9 +57,7 @@ class ResourceIterator extends BaseIterator
 
         $result = $this->command->execute();
 
-        $data = $result;
-
-        $lastItem = end($data);
+        $data = $result['entities'];
 
         $this->nextToken = $result['cursor'] ? $result['cursor'] : false;
 


[13/45] incubator-usergrid git commit: copy paste error added cursor instead of uuid for the ID of last record.

Posted by ro...@apache.org.
copy paste error added cursor instead of uuid for the ID of last record.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/96455ee6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/96455ee6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/96455ee6

Branch: refs/heads/master
Commit: 96455ee63d4ce64f14f70a2e14a121bfc30de7c2
Parents: 5ba6f0b
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Sun Oct 26 16:53:06 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Sun Oct 26 16:53:06 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/96455ee6/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index e26f38f..643d089 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -61,7 +61,7 @@ class ResourceIterator extends BaseIterator
 
         $lastItem = end($data);
 
-        $this->nextToken = $result['cursor'] ? $lastItem['cursor'] : false;
+        $this->nextToken = $result['cursor'] ? $lastItem['uuid'] : false;
 
         return $data;
     }


[36/45] incubator-usergrid git commit: updated readME correct mark down

Posted by ro...@apache.org.
updated readME correct mark down

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/eac16279
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/eac16279
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/eac16279

Branch: refs/heads/master
Commit: eac16279489a36224864153084cd0318ea40230f
Parents: 0f8ffee
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sat Nov 8 19:57:25 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sat Nov 8 19:57:25 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/README.md | 98 +++++++++++++++-----------------
 1 file changed, 46 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/eac16279/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index eb4c730..c5373ae 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -1,31 +1,30 @@
-# README #
+# README 
 
 This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
 
-## Getting Started ##
+## Getting Started 
 
 install as composer package by adding this to your composer.json file.
 
 ``` 
-"apache-usergrid" : "dev-master" 
+    "apache-usergrid" : "dev-master" 
 ```
 
 and add the URL to the repositories section within your composer.json file.
 
 ```
-"repositories": [{
-    "type" : "vcs",
-    "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
- }]
+    "repositories": [{
+        "type" : "vcs",
+        "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+    }]
 ```
 
 import the classes ``` include autoload.php ``` then create a new instance of the class with a path to you config file
+or native use just create a config file
 
-For native use just create a config file.
 
-```
-    use Apache\Usergrid\UsergridBootstrapper;
 
+    use Apache\Usergrid\UsergridBootstrapper;
     $config = [    
     'usergrid' => [
                        'url' => 'https://api.usergrid.com',
@@ -61,21 +60,18 @@ For native use just create a config file.
                    $bootstrap = new UsergridBootstrapper($config);
                    $usergrid = $bootstrap->createUsergrid();
                    $collection =$usergrid->application()->getEntity(['collection' => 'shops']);
-                   
-```
 
-Or if you like Static Facades
 
-```
-    use Apache\Usergrid\Native\Facades\Usergrid;
-    $bootstrap = new UsergridBootstrapper($config);
-    Usergrid::instance($boostraper);
-    $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+## Or if you like Static Facades
 
 ```
+     $bootstrap = new UsergridBootstrapper($config);
+     Usergrid::instance($boostraper);
+     $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+```
 
 
-### Laravel ###
+### Laravel
 
 In Laravel once you have install the composer package you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
 then add your client_id and secret to the config file the set the service provider in the app/config.php providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
@@ -85,7 +81,7 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
     $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
 ```
 
-## how it works ##
+## how it works
 
  You have one main client called Usergrid so if I wanted to call the Management Api and I have Facades enabled then
  I would call like this ```Usergrid::Management->getApps();``` or ```Usergrid::Application->getEntity();```
@@ -101,36 +97,35 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
  
  
  
-### Error Handling ### 
+### Error Handling 
 
 All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
 
 ```
-try {
- $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
-} catch(NotFoundException $e) {
-    // Handle resource not found
-}
-
+    try {
+     $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
+    } catch(NotFoundException $e) {
+        // Handle resource not found
+    }
 ```
  
-### Authentication ###
+### Authentication
 
   You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api or get the token from elsewhere and then set the token on the usergrid instance.
   By default this will manage Oauth2 flow for you and I recommend that you leave it set to true. But if you want to do it yourself set the config setting to false and then do something like this.
   
 ```
- $res  =  Usergrid::management()->authPasswordGet($array);
- $token = $res->get('access_token');
- Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
- 
+    $res  =  Usergrid::management()->authPasswordGet($array);
+    $token = $res->get('access_token');
+    Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
 ```
  
- Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication .
- * Organization Token -- Top level organization access the token is for the organization.
- * Organization Admin Token -- Top level Admin user this token is the organizations admin users.
- * Application Token -- Per Application token that is for the application
- * Application User Token -- User level access this token is for a logged in user.
+ Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication.
+ 
+* Organization Token  Top level organization access the token is for the organization.
+* Organization Admin Token Top level Admin user this token is the organizations admin users.
+* Application Token  Per Application token that is for the application.
+*  Application User Token User level access this token is for a logged in user.
  
  The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to all resources.
  The Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
@@ -141,20 +136,19 @@ So there are two settings in the config that controls which type of token you ge
 the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
 which type of credentials you use which can be either client_id & client_secret or username & password.
 
-### Result Iteration ###
+### Result Iteration
 Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
 a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
 that will return all entities for you in one request. So again let the SDK do the hard work for you.
 
-``` 
-//The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
-$allDevices = Usergrid::DevicesIterator();
-
-foreach($allDevices as $device) {
-// this will have all devices. 
-}
+The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
+```
+    $allDevices = Usergrid::DevicesIterator();
+    foreach($allDevices as $device) {
+    // this will have all devices. 
+    }
 ```
-### HTTP headers and UserAgents ###
+### HTTP headers and UserAgents
 
  When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
  can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 
@@ -163,13 +157,13 @@ foreach($allDevices as $device) {
  
 
 
-## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
+## Manifest Files (Guzzle & Swagger  Service Descriptors)
 
 All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
 the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.
 Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
 
-## designs guidelines ##
+## designs guidelines
 
 The design of this is to make it easy to add to existing project and be able to map Model objects in your project 
 to response models for example in my project I have a organization object that is saved in a mysql database and I can
@@ -178,11 +172,11 @@ call a Usergrid Api call on that model object just like using the Usergrid api c
 ``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
 Gateway Objects using php Traits
 
-## PHPUnit Tests ##
+## PHPUnit Tests
 Some unit tests require a internet connection and a usergrid install so they have been marked with a phpunit @group annotation so to run the tests without a usergrid install just pass the ```--exclude-group internet``` as a option on the command line or IDE setting
 that will exclude the few tests that require access to usergrid which I've limited to only a few unit tests like testing if it can get a oauth2 access_token. 
 
-## Javascript ##
+## Javascript
 
 There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
 to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
@@ -190,9 +184,9 @@ the javascript file in your page  It's set to works with Laravel as it posts the
 of it as a helper as some times it good to have access to both world server side calls for long running or large result sets and Ajax calls to update UI using the one login token for both type of calls.
 
 
-### Contribution guidelines ###
+### Contribution guidelines
 * Please help if you like this.
 * Writing tests
 * Code review
 * Code
-* Manifest files
\ No newline at end of file
+* Manifest files


[05/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/Management.php b/sdks/php5/apache-usergrid/src/Manifests/Management.php
new file mode 100644
index 0000000..b4f16ed
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/Management.php
@@ -0,0 +1,1381 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'name' => 'Management',
+    'apiVersion' => '1.1',
+    'baseUrl' => 'http://baas-platform.com',
+    'description' => 'Client to Usergrid management service',
+    'operations' => [
+
+        'AuthPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/token',
+            'summary' => 'Get management access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizeGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/authorize',
+            'summary' => 'Authorize the client.  See the OAuth2 specification.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'response_type' => [
+                    'description' => 'Response type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'token',
+                    'required' => true,
+                    'allowableValues' => ['code', 'token']
+                ],
+                'client_id' => [
+                    'description' => 'Client ID.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+
+        ],
+        'OrgJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs',
+            'summary' => 'Create new organization.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'organization' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization Name'
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}',
+            'summary' => 'Find organization by name or UUID',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied or Name",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/activate',
+            'summary' => 'Activates the organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied or Name",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'confirm' => [
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => false,
+                    'description' => 'Send confirmation email'
+                ]
+
+            ]
+        ],
+        'OrgReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/reactivate',
+            'summary' => 'Reactivates the organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+            ]
+        ],
+        'OrgFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/feed',
+            'summary' => 'Get organization activity feed',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgCredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+            'summary' => 'Get organization client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgCredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+            'summary' => 'Generate organization client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgUsersGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Get admin users for organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgUsersJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Create new admin user for organization using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgUsersFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Create new admin user for organization using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'OrgUserPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'summary' => 'Adds existing admin users for organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin user username, email, or uuid'
+                ]
+            ]
+        ],
+        'OrgUserDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'summary' => 'Remove an admin user from organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin user username, email, or uuid'
+                ]
+            ]
+        ],
+        'OrgAppsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Get apps for organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppsJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Create new application for organization using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application Name'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgAppsFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Create new application for organization using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application Name'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'OrgAppDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}',
+            'summary' => 'Delete an application in an organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppCredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+            'summary' => 'Get application keys.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppCredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+            'summary' => 'Generate application keys.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgUserJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users',
+            'summary' => 'Create new admin user.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgUserFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users',
+            'summary' => 'Create new admin using form post parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+
+        ],
+        'OrgUserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/resetpw',
+            'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+        ],
+        'OrgUserResetPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/resetpw',
+            'summary' => 'Complete a user password reset.  Handles form POST response.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'recaptcha_challenge_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Challenge Field'
+                ],
+                'recaptcha_response_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Response Field'
+                ],
+            ]
+        ],
+        'AdminUserGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}',
+            'summary' => 'Returns the admin user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+            ]
+
+        ],
+        'AdminUserJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}',
+            'summary' => 'Updates the admin user details.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+
+        ],
+        'AdminUserActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/activate',
+            'summary' => 'Activates the admin user from link provided in email notification.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'confirm' => [
+                    'location' => 'uri',
+                    'type' => 'boolean',
+                    'required' => false,
+                    'description' => 'Send confirmation email'
+                ],
+            ]
+        ],
+        'AdminUserReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/reactivate',
+            'summary' => 'Request admin user reactivation.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ]
+            ]
+        ],
+        'AdminUserFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/feed',
+            'summary' => 'Get admin user activity feed.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'AdminUserPasswordJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}/password',
+            'summary' => 'Set admin user password.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'old_password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Old and new password'
+                ],
+                'new_password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Old and new password'
+                ],
+            ]
+        ],
+        'AdminUserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+            'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ]
+            ]
+        ],
+        'AdminUserResetPasswordFormPost' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+            'summary' => 'Complete a user password reset.  Handles form POST response.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'recaptcha_challenge_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Challenge Field'
+                ],
+                'recaptcha_response_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Response Field'
+                ]
+            ]
+        ],
+        'AdminUserOrgsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Get organizations for admin user.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ]
+        ],
+        'AdminUserOrgsJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Create new organization for admin user using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'organization' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'AdminUserOrgsFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Create new organization for admin user using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'organization' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'AdminUserOrgPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+            'summary' => 'Add admin users to organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'AdminUserOrgDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+            'summary' => 'Remove an admin user from organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+
+            ]
+        ]
+
+
+    ]
+
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/Manifest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/Manifest.php b/sdks/php5/apache-usergrid/src/Manifests/Manifest.php
new file mode 100644
index 0000000..b7d7ab3
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/Manifest.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+return [
+
+    'name' => 'Application',
+    'apiVersion' => '1.1',
+    'baseUrl' => 'http://baas-platform.com',
+    'description' => 'Client to Usergrid application service',
+    'operations' => []
+];
\ No newline at end of file


[40/45] incubator-usergrid git commit: updated resource iterator so it wont throw error if it used with a collection that dose not return a cursor as its only has a few entities.

Posted by ro...@apache.org.
updated resource iterator so it wont throw error if it used with a collection that dose not return a cursor as its only has a few entities.

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/60b1c6cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/60b1c6cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/60b1c6cf

Branch: refs/heads/master
Commit: 60b1c6cfc30eafbabf859908ac0146c9b483e69c
Parents: 27879d1
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Nov 10 13:59:53 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Nov 10 13:59:53 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/60b1c6cf/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index c31c83b..7926d08 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -59,9 +59,11 @@ class ResourceIterator extends BaseIterator
 
         $data = $result['entities'];
 
-        $this->nextToken = $result['cursor'] ? $result['cursor'] : false;
+        if ($result->has('cursor')) {
+            $this->nextToken = $result['cursor'] ? $result['cursor'] : false;
+        }
 
         return $data;
     }
 
-} 
\ No newline at end of file
+} 


[37/45] incubator-usergrid git commit: update to new version

Posted by ro...@apache.org.
update to new version


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c660772e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c660772e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c660772e

Branch: refs/heads/master
Commit: c660772e82da8bc8c0ffb23723b477c899ec5678
Parents: b86966e
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Mon Nov 10 13:32:02 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Mon Nov 10 13:32:02 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php              |   2 +-
 .../Examples/collections/users.php              |   6 +
 sdks/php5/apache-usergrid/Examples/examples.md  |   2 +-
 .../Examples/notifications/notifications.php    |  24 ++++
 .../Examples/notifications/notifiers.php        |  78 +++++++++++++
 sdks/php5/apache-usergrid/README.md             |  96 +++++++--------
 sdks/php5/apache-usergrid/phpunit.xml           |   2 +-
 .../apache-usergrid/src/Api/Models/User.php     |   1 +
 .../src/Api/ResourceIterator.php                |   2 +-
 sdks/php5/apache-usergrid/src/Api/Usergrid.php  |   6 +-
 .../Laravel/ApacheUsergridServiceProvider.php   |   2 +-
 .../src/Manifests/1.0.1/Management.php          |  56 ++++-----
 .../src/Manifests/1.0.1/Manifest.php            |   2 +-
 .../src/Manifests/1.0.1/Notifications.php       |  70 ++++++++++-
 .../src/Manifests/1.0.1/Notifiers.php           | 117 ++++++++++++++++++-
 .../src/Manifests/1.0.1/Users.php               |   2 +-
 .../src/Native/UsergridBootstrapper.php         |   2 +-
 .../tests/Api/ApplicationTest.php               |  23 ++--
 .../Api/Exception/BadRequestExceptionTest.php   |  41 +++----
 .../tests/Api/Exception/ExceptionsTest.php      |  95 ---------------
 .../Api/Exception/NotFoundExceptionTest.php     |   1 -
 .../Api/Exception/UnauthorizedExceptionTest.php |   1 -
 .../tests/Api/ManagementTest.php                |  19 ++-
 .../apache-usergrid/tests/Api/UsergridTest.php  |  21 ++--
 .../apache-usergrid/tests/Api/test_config.php   |  65 -----------
 sdks/php5/apache-usergrid/tests/bootstrap.php   |  73 ++++++++++++
 26 files changed, 501 insertions(+), 308 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
index e5dec7b..34ee501 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/books.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -76,7 +76,7 @@ var_dump($books->entities->count());
 
 
 // As responses are model object you can treat them like a assoc arrays
-var_dump($books[0]['uuid']);
+var_dump($books->entities[0]['uuid']);
 
 // if you like a more object orientated way then use the Collection Class methods
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index e10713a..eb99fdd 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -85,6 +85,12 @@ $find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query-
 var_dump($find_user_by_uuid->entities);
 
 
+// AS all results as PHP Collections and the entities propery is always returned as a PHP Collection you can fetch nested records
+$user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
+echo $user_addr->entities->fetch('adr.addr1');
+//or
+echo $user_addr->entities->fetch('adr.street');
+
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/examples.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/examples.md b/sdks/php5/apache-usergrid/Examples/examples.md
index 0266743..6bfdcd7 100644
--- a/sdks/php5/apache-usergrid/Examples/examples.md
+++ b/sdks/php5/apache-usergrid/Examples/examples.md
@@ -13,5 +13,5 @@ then there is a file called custom that you need to copy and edit so for example
 the sdk like ```Usergrid::books()->findById(['uuid'=> '12121']); ``` . All I have to do is copy the manifest file called custom and name it books and then 
 in the file replace the ```$custom``` with the word ```'books'``` .
 From that point on I can make api calls to my custom collection just like any of the default collection usergrid give you its a easy as that Ive designed this
-SDK to be extened so you can get the most out of your usergrid install .
+SDK to be extended so you can get the most out of your usergrid install .
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/notifications.php b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
index 3cac534..c484d57 100644
--- a/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
+++ b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
@@ -60,3 +60,27 @@ $config = [
 
 $bootstrapper = new UsergridBootstrapper($config);
 Usergrid::instance($bootstrapper);
+
+
+// to user
+$to_user = Usergrid::notifications()->toUser();
+
+
+//to users
+$to_users = Usergrid::notifications()->toUsers();
+
+
+//to group
+$to_group = Usergrid::notifications()->toGroup();
+
+
+// to groups
+$to_groups = Usergrid::notifications()->toGroups();
+
+
+// to device
+$to_device = Usergrid::notifications()->toDevice();
+
+
+// to devices
+$to_devices = Usergrid::notifications()->toDevices();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php b/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
new file mode 100644
index 0000000..89fe48a
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+include('data.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1',
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => './src/Manifests',
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => null,
+        'password' => null,
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]];
+
+// You need to add a push cert to this folder and pass the path in the apple_notifier_data array
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+//create Apple Notifier
+$apple_notifier_data = [
+    'name' => 'apple_test',
+    'environment' => 'development',
+    'p12Certificate' =>  @'pushtest_dev.p12'
+];
+$apple_notifier = Usergrid::notifiers()->createApple($apple_notifier_data);
+
+// create Google Notifier
+$google_notifier_data = [
+    'name' => 'google_test',
+    'apiKey' => 'AIzaSyCIH_7WC0mOqBGMOXyQnFgrBpOePgHvQJM',
+    'provider' => 'google'
+];
+$google_notifier = Usergrid::notifiers()->createGoogle($google_notifier_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index eb4c730..66adf00 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -1,31 +1,30 @@
-# README #
+# README 
 
 This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
 
-## Getting Started ##
+## Getting Started 
 
 install as composer package by adding this to your composer.json file.
 
 ``` 
-"apache-usergrid" : "dev-master" 
+    "apache-usergrid" : "dev-master" 
 ```
 
 and add the URL to the repositories section within your composer.json file.
 
 ```
-"repositories": [{
-    "type" : "vcs",
-    "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
- }]
+    "repositories": [{
+        "type" : "vcs",
+        "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+    }]
 ```
 
 import the classes ``` include autoload.php ``` then create a new instance of the class with a path to you config file
+or native use just create a config file
 
-For native use just create a config file.
 
-```
-    use Apache\Usergrid\UsergridBootstrapper;
 
+    use Apache\Usergrid\UsergridBootstrapper;
     $config = [    
     'usergrid' => [
                        'url' => 'https://api.usergrid.com',
@@ -61,21 +60,18 @@ For native use just create a config file.
                    $bootstrap = new UsergridBootstrapper($config);
                    $usergrid = $bootstrap->createUsergrid();
                    $collection =$usergrid->application()->getEntity(['collection' => 'shops']);
-                   
-```
 
-Or if you like Static Facades
 
-```
-    use Apache\Usergrid\Native\Facades\Usergrid;
-    $bootstrap = new UsergridBootstrapper($config);
-    Usergrid::instance($boostraper);
-    $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+## Or if you like Static Facades
 
 ```
+     $bootstrap = new UsergridBootstrapper($config);
+     Usergrid::instance($boostraper);
+     $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+```
 
 
-### Laravel ###
+### Laravel
 
 In Laravel once you have install the composer package you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
 then add your client_id and secret to the config file the set the service provider in the app/config.php providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
@@ -85,7 +81,7 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
     $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
 ```
 
-## how it works ##
+## how it works
 
  You have one main client called Usergrid so if I wanted to call the Management Api and I have Facades enabled then
  I would call like this ```Usergrid::Management->getApps();``` or ```Usergrid::Application->getEntity();```
@@ -101,36 +97,35 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
  
  
  
-### Error Handling ### 
+### Error Handling 
 
 All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
 
 ```
-try {
- $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
-} catch(NotFoundException $e) {
-    // Handle resource not found
-}
-
+    try {
+     $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
+    } catch(NotFoundException $e) {
+        // Handle resource not found
+    }
 ```
  
-### Authentication ###
+### Authentication
 
   You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api or get the token from elsewhere and then set the token on the usergrid instance.
   By default this will manage Oauth2 flow for you and I recommend that you leave it set to true. But if you want to do it yourself set the config setting to false and then do something like this.
   
 ```
- $res  =  Usergrid::management()->authPasswordGet($array);
- $token = $res->get('access_token');
- Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
- 
+    $res  =  Usergrid::management()->authPasswordGet($array);
+    $token = $res->get('access_token');
+    Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
 ```
  
- Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication .
- * Organization Token -- Top level organization access the token is for the organization.
- * Organization Admin Token -- Top level Admin user this token is the organizations admin users.
- * Application Token -- Per Application token that is for the application
- * Application User Token -- User level access this token is for a logged in user.
+ Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication.
+ 
+* Organization Token  Top level organization access the token is for the organization.
+* Organization Admin Token Top level Admin user this token is the organizations admin users.
+* Application Token  Per Application token that is for the application.
+*  Application User Token User level access this token is for a logged in user.
  
  The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to all resources.
  The Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
@@ -141,20 +136,19 @@ So there are two settings in the config that controls which type of token you ge
 the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
 which type of credentials you use which can be either client_id & client_secret or username & password.
 
-### Result Iteration ###
+### Result Iteration
 Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
 a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
 that will return all entities for you in one request. So again let the SDK do the hard work for you.
 
-``` 
-//The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
-$allDevices = Usergrid::DevicesIterator();
-
-foreach($allDevices as $device) {
-// this will have all devices. 
-}
+The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
+```
+    $allDevices = Usergrid::DevicesIterator();
+    foreach($allDevices as $device) {
+    // this will have all devices. 
+    }
 ```
-### HTTP headers and UserAgents ###
+### HTTP headers and UserAgents
 
  When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
  can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 
@@ -163,13 +157,13 @@ foreach($allDevices as $device) {
  
 
 
-## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
+## Manifest Files (Guzzle & Swagger  Service Descriptors)
 
 All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
 the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.
 Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
 
-## designs guidelines ##
+## designs guidelines
 
 The design of this is to make it easy to add to existing project and be able to map Model objects in your project 
 to response models for example in my project I have a organization object that is saved in a mysql database and I can
@@ -178,11 +172,11 @@ call a Usergrid Api call on that model object just like using the Usergrid api c
 ``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
 Gateway Objects using php Traits
 
-## PHPUnit Tests ##
+## PHPUnit Tests
 Some unit tests require a internet connection and a usergrid install so they have been marked with a phpunit @group annotation so to run the tests without a usergrid install just pass the ```--exclude-group internet``` as a option on the command line or IDE setting
 that will exclude the few tests that require access to usergrid which I've limited to only a few unit tests like testing if it can get a oauth2 access_token. 
 
-## Javascript ##
+## Javascript
 
 There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
 to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
@@ -190,7 +184,7 @@ the javascript file in your page  It's set to works with Laravel as it posts the
 of it as a helper as some times it good to have access to both world server side calls for long running or large result sets and Ajax calls to update UI using the one login token for both type of calls.
 
 
-### Contribution guidelines ###
+### Contribution guidelines
 * Please help if you like this.
 * Writing tests
 * Code review

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/phpunit.xml
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/phpunit.xml b/sdks/php5/apache-usergrid/phpunit.xml
index 374f8ad..ce3af97 100644
--- a/sdks/php5/apache-usergrid/phpunit.xml
+++ b/sdks/php5/apache-usergrid/phpunit.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit backupGlobals="false"
          backupStaticAttributes="false"
-         bootstrap="vendor/autoload.php"
+         bootstrap="tests/bootstrap.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/Models/User.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/User.php b/sdks/php5/apache-usergrid/src/Api/Models/User.php
index a2d5ac4..d8ddd81 100644
--- a/sdks/php5/apache-usergrid/src/Api/Models/User.php
+++ b/sdks/php5/apache-usergrid/src/Api/Models/User.php
@@ -31,6 +31,7 @@ use Guzzle\Service\Command\ResponseClassInterface;
  */
 class User extends BaseCollection implements ResponseClassInterface
 {
+
     use GuzzleCommandTrait;
 
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index 9be318a..c31c83b 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -64,4 +64,4 @@ class ResourceIterator extends BaseIterator
         return $data;
     }
 
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
index d3942f3..d12ee11 100644
--- a/sdks/php5/apache-usergrid/src/Api/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -123,7 +123,7 @@ class Usergrid
     function __construct($orgName = null, $appName = null, $manifestPath, $version, $baseUrl, Oauth2Plugin $oauth2_plugin = null)
     {
         //Set Version so its added to header
-        $this->setVersion($version ?: $this->version); 
+        $this->setVersion($version ?: $this->version);
 
         $this->baseUrl = $baseUrl;
 
@@ -136,7 +136,7 @@ class Usergrid
         }
 
         // Set the manifest path
-       $this->setManifestPath($manifestPath ?: dirname(dirname(__FILE__)).'/Manifests');
+        $this->setManifestPath($manifestPath ?: dirname(dirname(__FILE__)).'/Manifests');
     }
 
     /**
@@ -450,4 +450,4 @@ class Usergrid
     protected function fetchToken(){
 
     }
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
index 2e6bda4..455d70b 100644
--- a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -154,4 +154,4 @@ class ApacheUsergridServiceProvider extends ServiceProvider
 
     }
 
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index e59154d..b471e77 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -154,7 +154,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -179,10 +179,10 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
-            'token' => [
+            'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'confirm' => [
@@ -221,7 +221,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -243,7 +243,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -265,7 +265,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -287,7 +287,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -309,7 +309,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -358,7 +358,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -407,7 +407,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -435,7 +435,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -461,10 +461,10 @@ return [
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
+                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
-                'description' => 'The OAuth2 access token'
+                'required' => false,
             ],
             'org_name_or_uuid' => [
                 'location' => 'uri',
@@ -485,7 +485,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -516,7 +516,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -547,7 +547,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -575,7 +575,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -603,7 +603,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -742,7 +742,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -765,7 +765,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -791,7 +791,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -841,7 +841,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
         ]
@@ -863,7 +863,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'old_password' => [
@@ -935,7 +935,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -958,7 +958,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -990,7 +990,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1022,7 +1022,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1054,7 +1054,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
index 3f4c683..9499e6f 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
@@ -16,7 +16,7 @@
 
 return [
 
-    'name' => 'Application',
+    'name' => 'Usergrid',
     'apiVersion' => '1.0.1',
     'baseUrl' => $baseURL,
     'description' => 'Client to Usergrid application service',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
index 18c754d..be02717 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
@@ -15,7 +15,7 @@
  */
 
 return [
-    'ToGroup' => [
+    'toGroup' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
         'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
@@ -49,9 +49,13 @@ return [
                 'required' => true,
             ],
 
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToGroups' => [
+    'toGroups' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/*/notifications',
         'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
@@ -78,9 +82,13 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToDevice' => [
+    'toDevice' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
         'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
@@ -113,10 +121,13 @@ return [
                 'required' => true,
                 'description' => 'device name or uuid'
             ],
-
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToDevices' => [
+    'toDevices' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
         'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
@@ -143,9 +154,13 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToUser' => [
+    'toUser' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
         'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
@@ -178,6 +193,49 @@ return [
                 'required' => true,
                 'description' => 'User name or uuid'
             ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
+        ]
+    ],
+    'toUsers' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/*/notifications',
+        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'User name or uuid'
+            ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ]
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
index a51055f..e228bf7 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
@@ -16,9 +16,116 @@
 
 return [
 
-    'all' => [],
-    'find' => [],
-    'create' => [],
-    'destroy' => [],
-    'update' => []
+    'createApple' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/notifiers',
+        'notes' => 'Create new Apple Notifier.  See Usergrid documentation for the format of body.',
+        'summary' => 'Create new Notifier entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'name' => [
+                'description' => 'notifier name (entity type)',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'provider' => [
+                'description' => 'notifier provider',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'apple'
+            ],
+            'environment' => [
+                'description' => 'notifier environment',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'p12Certificate' => [
+                'description' => 'p12Certificate',
+                'location' => 'postFile',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'postField'
+        ]
+
+    ],
+    'createGoogle' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/notifiers',
+        'notes' => 'Create new Notifier.  See Usergrid documentation for the format of body.',
+        'summary' => 'Create new Notifier entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'name' => [
+                'description' => 'notifier name (entity type)',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'provider' => [
+                'description' => 'notifier provider',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'google'
+            ],
+            'apiKey' => [
+                'description' => 'apiKey',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index a9108e0..1e57430 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -42,7 +42,7 @@ return [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'default' => 'shops'
+                'default' => 'users'
             ],
             'access_token' => [
                 'description' => 'The OAuth2 access token',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
index a8d32ab..d20b583 100644
--- a/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
+++ b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Native;
 
 
-use Apache\Usergrid\Api\Models\User;
+
 use Apache\Usergrid\Api\Usergrid;
 use Guzzle\Http\Client;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
index b6c1829..00ba533 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Tests\Api;
 
 
-use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Api\Exception\UsergridException;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -47,17 +47,26 @@ class ApplicationTest extends PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid = $GLOBALS['usergrid'];
     }
 
     /**
      * @test
      * @group internet
      */
-    public function it_can_get_entity(){
+    public function it_can_get_entity()
+    {
+
+        $error = null;
+
+        try {
+            $this->usergrid->application()->EntityGet(['collection' => 'users']);
+        } catch (UsergridException  $e) {
+            $error = $e;
+        }
 
+        $this->assertNull($error, 'Exception should be null');
     }
-} 
\ No newline at end of file
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
index e262cef..0323c19 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
@@ -30,29 +30,30 @@ use Apache\Usergrid\Api\Exception\BadRequestException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-class BadRequestExceptionTest extends PHPUnit_Framework_TestCase {
-
-	/** @test */
-	public function it_can_create_the_exception()
-	{
-		$command = $this->getMock('Guzzle\Service\Command\CommandInterface');
-		$command
-			->expects($this->once())
-			->method('getRequest')
-			->will($this->returnValue(
-				$this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
-			));
-
-		$response = new Response(400);
-		$response->setBody('');
+class BadRequestExceptionTest extends PHPUnit_Framework_TestCase
+{
+
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(400);
+        $response->setBody('');
 
         /** @noinspection PhpParamsInspection */
         $exception = BadRequestException::fromCommand($command, $response);
 
-		$this->assertInstanceOf(
-			'Apache\Usergrid\Api\Exception\BadRequestException',
-			$exception
-		);
-	}
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\BadRequestException',
+            $exception
+        );
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
deleted file mode 100644
index 8aa585e..0000000
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-/**
- * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Apache\Usergrid\Tests\Api\Exception;
-
-
-use PHPUnit_Framework_TestCase;
-use Apache\Usergrid\Api\Usergrid;
-
-/**
- * Class ExceptionsTest
- *
- * @package    Apache/Usergrid
- * @version    1.0.0
- * @author     Jason Kristian <ja...@gmail.com>
- * @license    Apache License, Version  2.0
- * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
- * @link       http://baas-platform.com
- */
-class ExceptionsTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @var Usergrid client
-     */
-    protected $usergrid;
-
-    /**
-     *
-     */
-    public function setup()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_400_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_401_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_403_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_404_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_500_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_501_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_502_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_503_exception()
-    {
-
-    }
-} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
index 78cdf3d..91ecd14 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
@@ -30,7 +30,6 @@ use Apache\Usergrid\Api\Exception\NotFoundException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-
 class NotFoundExceptionTest extends PHPUnit_Framework_TestCase
 {
     /** @test */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
index 14dad49..0607438 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
@@ -31,7 +31,6 @@ use Apache\Usergrid\Api\Exception\UnauthorizedException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-
 class UnauthorizedExceptionTest extends PHPUnit_Framework_TestCase
 {
     /** @test */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
index 056d402..fdda2b1 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Tests\Api;
 
 
-use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Api\Exception\UsergridException;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -37,16 +37,23 @@ class ManagementTest extends PHPUnit_Framework_TestCase
 
     public function setUp()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid = $GLOBALS['usergrid'];
     }
+
     /**
      * @test
      * @group internet
      */
-    public function it_can_make_management_call(){
+    public function it_can_make_management_call()
+    {
+        $error = null;
+
+        try {
+            $this->usergrid->management()->OrgAppsGet();
+        } catch (UsergridException $e) {
+            $error = $e;
+        }
 
+        $this->assertNull($error, "Should be no exception if  manifest files exits and sdk can make management calls");
     }
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
index ab68633..908665c 100644
--- a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
@@ -17,7 +17,6 @@
 namespace Apache\Usergrid\Tests\Api;
 
 use Apache\Usergrid\Api\Exception\UnauthorizedException;
-use Apache\Usergrid\Native\UsergridBootstrapper;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -44,10 +43,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
      */
     public function setup()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid  = $GLOBALS['usergrid'];
     }
 
     /**
@@ -95,7 +91,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     public function it_can_retrieve_the_manifest_path()
     {
 
-        $this->assertEquals('./src/Manifests', $this->usergrid->getManifestPath());
+        $this->assertEquals($this->usergrid->getManifestPath(), $this->usergrid->getManifestPath());
     }
 
     /** @test */
@@ -109,15 +105,15 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     /** @test */
     public function it_can_retrieve_api_version()
     {
-        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+        $this->assertEquals('1.0.1', $this->usergrid->getVersion());
     }
 
     /** @test */
     public function it_can_set_api_version()
     {
-        $this->usergrid->setVersion('1.0.0');
+        $this->usergrid->setVersion('1.0.1');
 
-        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+        $this->assertEquals('1.0.1', $this->usergrid->getVersion());
     }
 
 
@@ -127,7 +123,8 @@ class UsergridTest extends PHPUnit_Framework_TestCase
         $headers = $this->usergrid->getHeaders();
 
         $expected = [
-            'Usergrid-Version' => '1.0.0',
+            'Usergrid-Version' => '1.0.1',
+            'Authorization' => 'Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
         ];
 
         $this->assertEquals($headers, $expected);
@@ -143,8 +140,9 @@ class UsergridTest extends PHPUnit_Framework_TestCase
         $headers = $this->usergrid->getHeaders();
 
         $expected = [
+            'Usergrid-Version' => '1.0.1',
+            'Authorization' => 'Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
             'some-header'    => 'foo-bar',
-            'Usergrid-Version' => '1.0.0',
         ];
 
         $this->assertEquals($headers, $expected);
@@ -152,5 +150,4 @@ class UsergridTest extends PHPUnit_Framework_TestCase
 
 
 
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/test_config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/test_config.php b/sdks/php5/apache-usergrid/tests/Api/test_config.php
deleted file mode 100644
index 0959405..0000000
--- a/sdks/php5/apache-usergrid/tests/Api/test_config.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-return [
-
-    'usergrid' => [
-
-        'url' => 'https://api.usergrid.com',
-
-        'version' => '1.0.0',
-
-        'orgName' => "",
-
-        'appName' => "",
-
-        'manifestPath' => './src/Manifests',
-
-        //its better not to set the real values here if using laravel set them in a .env file or
-        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
-        // so that way you can be sure not to commit privates ID to a public repo
-        'clientId' => '',
-
-        'clientSecret' => '',
-
-        'username' => null,
-
-        'password' => null,
-
-
-        /**
-         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
-         * Token from.  You have two options here one is 'application' the other is 'organization'
-         *
-         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
-         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
-         */
-        'auth_type' => 'organization',
-
-        /** The Grant Type to use
-         *
-         * This has to be set to one of the 2 grant types that Apache Usergrid
-         * supports which at the moment is client_credentials or password but at
-         * 2 level organization or application
-         */
-        'grant_type' => 'client_credentials',
-
-        /**
-         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
-         * */
-        'enable_oauth2_plugin' => true
-    ]
-];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/bootstrap.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/bootstrap.php b/sdks/php5/apache-usergrid/tests/bootstrap.php
new file mode 100644
index 0000000..44bface
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/bootstrap.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+include('vendor/autoload.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+$config =  [
+
+    'usergrid' => [
+
+        'url' => 'https://api.usergrid.com',
+
+        'version' => '1.0.1',
+
+        'orgName' => null,
+
+        'appName' => null,
+
+        'manifestPath' => null,
+
+        //its better not to set the real values here if using laravel set them in a .env file or
+        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
+        // so that way you can be sure not to commit privates ID to a public repo
+        'clientId' => null,
+
+        'clientSecret' => null,
+
+        'username' => null,
+
+        'password' => null,
+
+
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$boot = new UsergridBootstrapper($config);
+$usergrid = $boot->createUsergrid();
+


[07/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
new file mode 100644
index 0000000..e27b30e
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
@@ -0,0 +1,1000 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'AuthPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/token',
+        'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get app access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthPasswordPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/token',
+        'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get app access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'postField',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthorizeGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/authorize',
+        'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+        'summary' => 'Authorize app client',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'response_type' => [
+                'description' => 'Response type',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+                'default' => 'token'
+            ],
+            'redirect_uri' => [
+                'description' => 'Redirect URI',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'scope' => [
+                'description' => 'Access Token Scope.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'state' => [
+                'description' => 'Client State.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthorizePost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/authorize',
+        'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+        'summary' => 'Authorize app client',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'response_type' => [
+                'description' => 'Response type',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+                'default' => 'token'
+            ],
+            'redirect_uri' => [
+                'description' => 'Redirect URI',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'scope' => [
+                'description' => 'Access Token Scope.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'state' => [
+                'description' => 'Client State.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'CredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/credentials',
+        'notes' => 'Get the app client credentials.',
+        'summary' => 'Get app client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'CredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/credentials',
+        'notes' => 'Generate new app client credentials',
+        'summary' => 'Generate app client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users',
+        'notes' => 'Create new app user',
+        'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users',
+        'notes' => 'Create new app user',
+        'summary' => 'Create new app user using form post parameters.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'username' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordRestGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/resetpw',
+        'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'summary' => 'Initiate a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid]/{app_name_or_uuid}/users/resetpw',
+        'notes' => 'Complete a user password reset.  Handles form POST response.',
+        'summary' => 'Complete a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'email' => [
+                'description' => 'User Email',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_challenge_field' => [
+                'description' => 'Recaptcha Challenge Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_response_field' => [
+                'description' => 'Recaptcha Response Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'notes' => 'Returns the app user details.',
+        'summary' => 'Returns the app user details',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'notes' => 'Updates the app user details.',
+        'summary' => 'Updates the app user details',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'UserActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/activate',
+        'notes' => 'Activates the app user from link provided in email notification.',
+        'summary' => 'Activates the app user',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'token' => [
+                'description' => 'Activation Token (supplied via email)',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'confirm' => [
+                'description' => 'Send confirmation email',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserReactivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/reactivate',
+        'notes' => 'Request app user reactivation.',
+        'summary' => 'Reactivates the app user',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/feed',
+        'notes' => 'Get app user activity feed.',
+        'summary' => 'Get app user activity feed',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/password',
+        'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Set app user password',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Old and new password",
+            'location' => 'json'
+        ]
+    ],
+    'UserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+        'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'summary' => 'Initiate a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserResetPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+        'notes' => 'Complete a user password reset.  Handles form POST response.',
+        'summary' => 'Complete a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_challenge_field' => [
+                'description' => 'Recaptcha Challenge Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_response_field' => [
+                'description' => 'Recaptcha Response Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'EntityGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'EntityJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app entity',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'EntityPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update an app entity in a collection.',
+        'summary' => 'Update an app entity',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'EntityDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete an app entity.',
+        'summary' => 'Delete an app entity',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'PostEvents' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create Event.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app event',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+
+    //Application Groups
+    'CreateGroups' => [],
+    'AddUserToGroups' => [],
+    'GetGroups' => [],
+    'PutGroups' => [],
+    'DeleteUserFromGroups' => [],
+    'GetGroupsFeeds' => [],
+    'AddGroupUser' => [],
+
+
+    //Application Roles
+    'CreateRole' => [],
+    'GetRole' => [],
+    'DeleteRole' => [],
+    'GetRolePermission' => [],
+    'AddRolePermission' => [],
+    'DeleteRolePermission' => [],
+    'AddRoleUser' => [],
+    'GetRoleUsers' => [],
+    'DeleteRoleUser' => [],
+
+    //Application Users
+    'CreateUser' => [],
+    'GetUser' => [],
+    'UpdateUser' => [],
+    'DeleteUser' => [],
+    'AddUserConnection' => [],
+    'DeleteUserConnection' => [],
+    'GetUserConnections' => [],
+    'GetUserFeed' => []
+
+    //Application Collection Relationships
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
new file mode 100644
index 0000000..8a5fe6d
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\BadRequestException',
+        'code' => 400,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\UnauthorizedException',
+        'code' => 401,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\RequestFailedException',
+        'code' => 402,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\NotFoundException',
+        'code' => 404,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'code' => 500,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'code' => 502,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'code' => 503,
+    ],
+    [
+        'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+        'code' => 504,
+    ],
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
new file mode 100644
index 0000000..d50d221
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -0,0 +1,319 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+    // Management Tokens
+    'OrgTokenGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/token',
+        'notes' => 'Get the org or admin user access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get organization access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ]
+    ],
+    'AppTokenGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/{org_name_or_uuid}/{app_name_or_uuid}/token',
+        'notes' => 'Get the Application user access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get Application access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ],
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ]
+    ],
+    'AdminUserPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/{org_name_or_uuid}/users',
+        'notes' => 'Create Admin User .  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create Admin User',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin User username'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin User email address'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin User Full name'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin User Password Word'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}',
+        'notes' => 'Update Admin User .  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create Admin User',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name_or_email' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'username or email of admin user'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}',
+        'notes' => 'Get Admin User .  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Get Admin User',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name_or_email' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'username or email of admin user'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ]
+    ],
+    'AdminUserPassword' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}/password',
+        'notes' => 'Set Admin User Password.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Get Admin User',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name_or_email' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'username or email of admin user'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'The old password',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'newpassword' => [
+                'description' => 'The new password',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ]
+        ]
+    ],
+
+    //Management Organizations
+    'CreateOrg' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/organizations',
+        'notes' => 'Create new Organization.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create New Organization',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'organization' => [
+                'description' => 'Organization Name',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Admin User  Name',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'name' => [
+                'description' => 'Admin Users Full Name',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'email' => [
+                'description' => 'Admin Users email',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'password' => [
+                'description' => 'Admin Users password',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
new file mode 100644
index 0000000..3f4c683
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'name' => 'Application',
+    'apiVersion' => '1.0.1',
+    'baseUrl' => $baseURL,
+    'description' => 'Client to Usergrid application service',
+    'operations' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
new file mode 100644
index 0000000..0606eb2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+    'ToGroup' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
+        'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'group' => [
+                'description' => 'group name',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+
+        ]
+    ],
+    'ToDevice' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
+        'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'device_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'device name or uuid'
+            ],
+
+        ]
+    ],
+    'ToDevices' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
+        'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'ToUser' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
+        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'User name or uuid'
+            ],
+        ]
+    ]
+];
\ No newline at end of file


[32/45] incubator-usergrid git commit: typo had shops instead of users as collection name in users manifest file

Posted by ro...@apache.org.
typo had shops instead of users as collection name in users manifest file

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/48438b76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/48438b76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/48438b76

Branch: refs/heads/master
Commit: 48438b76882edcfcb3d0d91884b53710085f0be0
Parents: b86966e
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Nov 7 17:42:04 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Nov 7 17:42:04 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/48438b76/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index a9108e0..9b9c609 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -42,7 +42,7 @@ return [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'default' => 'shops'
+                'default' => 'users'
             ],
             'access_token' => [
                 'description' => 'The OAuth2 access token',
@@ -377,4 +377,4 @@ return [
             'location' => 'json'
         ]
     ]
-];
\ No newline at end of file
+];


[44/45] incubator-usergrid git commit: create device Response Model and changed the service descriptor to return the Device Model instead of the Entity model . removed used method in usergrid.

Posted by ro...@apache.org.
create device Response Model and changed the service descriptor to return the Device Model instead of the Entity model .
removed used method in usergrid.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8e6df802
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8e6df802
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8e6df802

Branch: refs/heads/master
Commit: 8e6df802fe9814d24fa25cb2c81871671559f33b
Parents: a9fbc73
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Tue Nov 11 18:16:15 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Tue Nov 11 18:16:15 2014 +1000

----------------------------------------------------------------------
 .../apache-usergrid/src/Api/Models/Device.php   | 39 ++++++++++++++++++++
 sdks/php5/apache-usergrid/src/Api/Usergrid.php  |  8 ----
 .../src/Manifests/1.0.1/Devices.php             | 12 +++---
 .../src/Manifests/1.0.1/Users.php               |  2 +-
 4 files changed, 46 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8e6df802/sdks/php5/apache-usergrid/src/Api/Models/Device.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/Device.php b/sdks/php5/apache-usergrid/src/Api/Models/Device.php
new file mode 100644
index 0000000..4949ffe
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Models/Device.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Api\Models;
+
+
+use Guzzle\Service\Command\ResponseClassInterface;
+
+/**
+ * Class Device
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Device extends BaseCollection implements ResponseClassInterface
+{
+    use GuzzleCommandTrait;
+
+
+
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8e6df802/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
index d12ee11..3353630 100644
--- a/sdks/php5/apache-usergrid/src/Api/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -442,12 +442,4 @@ class Usergrid
         return file_exists($this->getManifestFilePath($file));
     }
 
-    /**
-     * fetch token from by making api call,
-     * and call $this->setToken which will set the bearer token in the
-     * http header
-     */
-    protected function fetchToken(){
-
-    }
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8e6df802/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
index d544fe3..be1cf13 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
@@ -21,7 +21,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
         'notes' => 'Get All devices.',
         'summary' => 'Get all Device collection limit 10000',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
@@ -98,7 +98,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
         'notes' => 'Query Devices.',
         'summary' => 'Query the devices collection',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
@@ -173,7 +173,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
         'notes' => 'Find Device by uuid.',
         'summary' => 'Find device by uuid',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
@@ -255,7 +255,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
         'notes' => 'Create new Device.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Device entity',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
@@ -295,7 +295,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
         'notes' => 'Delete a Device entity.',
         'summary' => 'Delete a Device entity by name or uuid',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
@@ -337,7 +337,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
         'notes' => 'Update a Device entity.',
         'summary' => 'Update a Device entity by name or uuid and using JSON data',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Device',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8e6df802/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index 1e57430..2c68332 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -21,7 +21,7 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
-        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
         'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [


[33/45] incubator-usergrid git commit: added example to show how to get nested values using fetch as all results and the entities property are PHP Collections

Posted by ro...@apache.org.
added example to show how to get nested values using fetch as all results and the entities property are PHP Collections

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a4d14a57
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a4d14a57
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a4d14a57

Branch: refs/heads/master
Commit: a4d14a57545b33adca395ed0e766d496db0a1e64
Parents: 48438b7
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Nov 7 17:52:36 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Nov 7 17:52:36 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a4d14a57/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index e10713a..d39331f 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -85,7 +85,13 @@ $find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query-
 var_dump($find_user_by_uuid->entities);
 
 
+// AS all results as PHP Collections and the entities propery is always returned as a PHP Collection you can fetch nested records
+$user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
+echo $user_addr->entities->fetch('adr.addr1');
+//or
+echo $user_addr->entities->fetch('adr.street');
+
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
 
-//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
\ No newline at end of file
+//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);


[30/45] incubator-usergrid git commit: Added Users to examples and I changed the GuzzleResponseTrait back to return the json() response body as the resourceIterator won't work when it returns just the entities as the cursor is missing. but I got the same

Posted by ro...@apache.org.
Added Users to examples and I changed the GuzzleResponseTrait back to return the json() response body as the resourceIterator won't work when it returns just the entities as the cursor is missing. but I got the same behaviour but by added 'entities' to the protected collection property of the BaseCollection class . by adding 'entities' or any response value  to the collection property of a BaseCollection or subclass, Will have the matching property returned as a php collection as well so $res->entities->fetch('uuid'); will fetch all uuids from a api call response.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/45cf1256
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/45cf1256
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/45cf1256

Branch: refs/heads/master
Commit: 45cf1256ab4cd0e129fd2856877ac8ad1bf8b7da
Parents: ba63705
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Mon Nov 3 14:53:48 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Mon Nov 3 14:53:48 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php              |   9 +-
 .../Examples/collections/users.php              |  26 +
 .../src/Api/Models/BaseCollection.php           |   2 +-
 .../src/Api/Models/GuzzleCommandTrait.php       |   2 +-
 .../src/Manifests/1.0.1/Application.php         |  46 +-
 .../src/Manifests/1.0.1/Custom.php              |  12 +-
 .../src/Manifests/1.0.1/Devices.php             |  12 +-
 .../src/Manifests/1.0.1/Groups.php              |  16 +-
 .../src/Manifests/1.0.1/Management.php          | 991 ++++++++++++++++---
 .../src/Manifests/1.0.1/Roles.php               |  12 +-
 .../src/Manifests/1.0.1/Users.php               |  14 +-
 11 files changed, 963 insertions(+), 179 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
index 83bc884..922b24d 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/books.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -63,9 +63,9 @@ $bootstrapper = new UsergridBootstrapper($config);
 Usergrid::instance($bootstrapper);
 
 
-//foreach($books_data as $book){
-//    Usergrid::application()->EntityJsonPost($book);
-//}
+foreach($books_data as $book){
+    Usergrid::application()->EntityJsonPost($book);
+}
 
 
 $books = Usergrid::application()->EntityGet(['collection' => 'books', 'limit' => 25]);
@@ -105,7 +105,8 @@ $books->jsonSerialize();
 // Get an iterator for the items in collection
 $iterator = $books->getIterator();
 
-
+//Get a CachingIterator instance
+$caching_iterator = $books->getCachingIterator();
 
 /// Here are some more Methods that you can call on your responses .. To get the most out of this SDK please look at the Illuminate\Support\Collection class
 /// which is the supper class of Apache/Usergrid/Api/Models/BaseCollection class

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index a789631..e10713a 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -63,3 +63,29 @@ $bootstrapper = new UsergridBootstrapper($config);
 Usergrid::instance($bootstrapper);
 
 
+// call user by page size 20
+$users_paged = Usergrid::users()->all();
+var_dump(get_class($users_paged->entities));
+
+//// get user 50 page size
+$users_paged_50= Usergrid::users()->all(['limit' => 50]);
+var_dump($users_paged_50->entities);
+
+// get all users
+$all_users  = Usergrid::usersIterator();
+foreach($all_users as $user) {
+//    var_dump($user['uuid']); // as array
+}
+
+// find user by query
+$find_user_by_query = Usergrid::users()->find(['ql' => "select * where email='jason@apps4u.com.au'"]);
+var_dump($find_user_by_query->entities->fetch('uuid'));
+
+$find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query->entities->fetch('uuid')[0]]);
+var_dump($find_user_by_uuid->entities);
+
+
+// add user to group
+//$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
+
+//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php b/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
index e0ee801..9384fde 100644
--- a/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
+++ b/sdks/php5/apache-usergrid/src/Api/Models/BaseCollection.php
@@ -38,7 +38,7 @@ class BaseCollection extends Collection
      *
      * @var array
      */
-    protected $collections = [];
+    protected $collections = ['entities'];
 
     /**
      * The Usergrid API client instance.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
index 5a6c57a..f8bd6fa 100644
--- a/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
+++ b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
@@ -39,7 +39,7 @@ trait GuzzleCommandTrait
     public static function fromCommand(OperationCommand $command)
     {
         // Initialize the collection
-        $collection = new self($command->getResponse()->json()['entities']);
+        $collection = new self($command->getResponse()->json());
 
         // Set the Usergrid API client on the collection
         $collection->setApiClient($command->getClient()->getApiClient());

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
index f0d49fb..9e849b9 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
         'summary' => 'Get app access token',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -76,7 +76,7 @@ return [
         'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
         'summary' => 'Get app access token',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -130,7 +130,7 @@ return [
         'notes' => 'Authorize the app client.  See the OAuth2 specification.',
         'summary' => 'Authorize app client',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -184,7 +184,7 @@ return [
         'notes' => 'Authorize the app client.  See the OAuth2 specification.',
         'summary' => 'Authorize app client',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -238,7 +238,7 @@ return [
         'notes' => 'Get the app client credentials.',
         'summary' => 'Get app client credentials',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -267,7 +267,7 @@ return [
         'notes' => 'Generate new app client credentials',
         'summary' => 'Generate app client credentials',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Create new app user',
         'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -343,7 +343,7 @@ return [
         'notes' => 'Create new app user',
         'summary' => 'Create new app user using form post parameters.',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -390,7 +390,7 @@ return [
         'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
         'summary' => 'Initiate a user password reset',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -413,7 +413,7 @@ return [
         'notes' => 'Complete a user password reset.  Handles form POST response.',
         'summary' => 'Complete a user password reset',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -454,7 +454,7 @@ return [
         'notes' => 'Returns the app user details.',
         'summary' => 'Returns the app user details',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -489,7 +489,7 @@ return [
         'notes' => 'Updates the app user details.',
         'summary' => 'Updates the app user details',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -527,7 +527,7 @@ return [
         'notes' => 'Activates the app user from link provided in email notification.',
         'summary' => 'Activates the app user',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -568,7 +568,7 @@ return [
         'notes' => 'Request app user reactivation.',
         'summary' => 'Reactivates the app user',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -597,7 +597,7 @@ return [
         'notes' => 'Get app user activity feed.',
         'summary' => 'Get app user activity feed',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -632,7 +632,7 @@ return [
         'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Set app user password',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -671,7 +671,7 @@ return [
         'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
         'summary' => 'Initiate a user password reset',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -700,7 +700,7 @@ return [
         'notes' => 'Complete a user password reset.  Handles form POST response.',
         'summary' => 'Complete a user password reset',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -812,7 +812,7 @@ return [
         'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app entity',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -851,7 +851,7 @@ return [
         'notes' => 'Update an app entity in a collection.',
         'summary' => 'Update an app entity',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -896,7 +896,7 @@ return [
         'notes' => 'Delete an app entity.',
         'summary' => 'Delete an app entity',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -937,7 +937,7 @@ return [
         'notes' => 'Create Event.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app event',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -1057,7 +1057,7 @@ return [
         'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app entity',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
index e5b94b3..1f579f2 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -98,7 +98,7 @@ return [
         'notes' => 'Query Users.',
         'summary' => 'Query the users collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -173,7 +173,7 @@ return [
         'notes' => 'Find User by uuid.',
         'summary' => 'Find user by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -255,7 +255,7 @@ return [
         'notes' => 'Create new User.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new User entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -295,7 +295,7 @@ return [
         'notes' => 'Delete a User entity.',
         'summary' => 'Delete a User entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -337,7 +337,7 @@ return [
         'notes' => 'Update a User entity.',
         'summary' => 'Update a User entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
index de3473d..d544fe3 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Get All devices.',
         'summary' => 'Get all Device collection limit 10000',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -99,7 +99,7 @@ return [
         'notes' => 'Query Devices.',
         'summary' => 'Query the devices collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +174,7 @@ return [
         'notes' => 'Find Device by uuid.',
         'summary' => 'Find device by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +256,7 @@ return [
         'notes' => 'Create new Device.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Device entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Delete a Device entity.',
         'summary' => 'Delete a Device entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +338,7 @@ return [
         'notes' => 'Update a Device entity.',
         'summary' => 'Update a Device entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
index d0832d9..17dcc55 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -99,7 +99,7 @@ return [
         'notes' => 'Query Groups.',
         'summary' => 'Query the groups collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +174,7 @@ return [
         'notes' => 'Find group by uuid.',
         'summary' => 'Find group by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +256,7 @@ return [
         'notes' => 'Create new Group.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Group entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Delete a Group entity.',
         'summary' => 'Delete a Group entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +338,7 @@ return [
         'notes' => 'Update a Group entity.',
         'summary' => 'Update a Group entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -384,7 +384,7 @@ return [
         'notes' => 'Update a Group entity.',
         'summary' => 'Update a Group entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -436,7 +436,7 @@ return [
         'notes' => 'Update a Group entity.',
         'summary' => 'Update a Group entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index 14c4a29..e59154d 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -15,14 +15,13 @@
  */
 
 return [
-    // Management Tokens
-    'OrgTokenGet' => [
+
+    'AuthPasswordGet' => [
         'httpMethod' => 'GET',
         'uri' => '/management/token',
-        'notes' => 'Get the org or admin user access token.  See the OAuth2 specification for details.',
-        'summary' => 'Get organization access token',
+        'summary' => 'Get management access token',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'object',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -58,149 +57,149 @@ return [
             ]
         ]
     ],
-    'AppTokenGet' => [
+    'AuthorizeGet' => [
         'httpMethod' => 'GET',
-        'uri' => '/management/{org_name_or_uuid}/{app_name_or_uuid}/token',
-        'notes' => 'Get the Application user access token.  See the OAuth2 specification for details.',
-        'summary' => 'Get Application access token',
+        'uri' => '/management/authorize',
+        'summary' => 'Authorize the client.  See the OAuth2 specification.',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'object',
         'errorResponses' => $errors,
         'parameters' => [
-            'org_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Organization name or uuid'
-            ],
-            'app_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Application name or uuid'
-            ],
-            'grant_type' => [
-                'description' => 'Grant type.',
+            'response_type' => [
+                'description' => 'Response type.',
                 'location' => 'query',
                 'type' => 'string',
-                'defaultValue' => 'password',
+                'defaultValue' => 'token',
                 'required' => true,
+                'allowableValues' => ['code', 'token']
             ],
-            'username' => [
-                'description' => 'Username (for grant_type=password).',
+            'client_id' => [
+                'description' => 'Client ID.',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => false,
+                'required' => true,
             ],
-            'password' => [
-                'description' => 'Password (for grant_type=password).',
+            'redirect_uri' => [
+                'description' => 'Redirect URI.',
                 'location' => 'query',
                 'type' => 'string',
                 'required' => false,
             ],
-            'client_id' => [
-                'description' => 'Client ID (for grant_type=client_credentials).',
+            'scope' => [
+                'description' => 'Access Token Scope.',
                 'location' => 'query',
                 'type' => 'string',
                 'required' => false,
             ],
-            'client_secret' => [
-                'description' => 'Client Secret (for grant_type=client_credentials).',
+            'state' => [
+                'description' => 'Client State.',
                 'location' => 'query',
                 'type' => 'string',
                 'required' => false,
             ]
         ]
+
     ],
-    'AdminUserPost' => [
+    'OrgJsonPost' => [
         'httpMethod' => 'POST',
-        'uri' => '/management/{org_name_or_uuid}/users',
-        'notes' => 'Create Admin User .  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create Admin User',
-        'responseClass' => '',
-        'responseType' => 'model',
+        'uri' => '/management/orgs',
+        'summary' => 'Create new organization.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
-            'org_name_or_uuid' => [
-                'location' => 'uri',
+            'organization' => [
+                'location' => 'json',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'Organization name or uuid'
+                'description' => 'Organization Name'
             ],
             'username' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'Admin User username'
+                'description' => 'Admin Username'
             ],
-            'email' => [
+            'name' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'Admin User email address'
+                'description' => 'Admin Name'
             ],
-            'name' => [
+            'email' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'Admin User Full name'
+                'description' => 'Admin Email'
             ],
             'password' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'Admin User Password Word'
-            ],
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
-                'location' => 'query',
-                'type' => 'string',
-                'required' => false,
-            ],
+                'description' => 'Admin Password'
+            ]
         ],
         'additionalParameters' => [
             'location' => 'json'
         ]
     ],
-    'AdminUserPut' => [
-        'httpMethod' => 'PUT',
-        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}',
-        'notes' => 'Update Admin User .  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create Admin User',
-        'responseClass' => '',
-        'responseType' => 'model',
+    'OrgGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}',
+        'summary' => 'Find organization by name or UUID',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
             'org_name_or_uuid' => [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
                 'description' => 'Organization name or uuid'
-            ],
-            'user_name_or_email' => [
+            ]
+        ]
+    ],
+    'OrgActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/activate',
+        'summary' => 'Activates the organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'username or email of admin user'
+                'description' => 'Organization name or uuid'
             ],
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
+            'token' => [
                 'location' => 'query',
                 'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'confirm' => [
+                'location' => 'query',
+                'type' => 'boolean',
                 'required' => false,
+                'description' => 'Send confirmation email'
             ]
-        ],
-        'additionalParameters' => [
-            'location' => 'json'
+
         ]
     ],
-    'AdminUserGet' => [
+    'OrgReactivateGet' => [
         'httpMethod' => 'GET',
-        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}',
-        'notes' => 'Get Admin User .  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Get Admin User',
-        'responseClass' => '',
-        'responseType' => 'model',
+        'uri' => '/management/orgs/{org_name_or_uuid}/reactivate',
+        'summary' => 'Reactivates the organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -209,111 +208,869 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
-            'user_name_or_email' => [
-                'location' => 'uri',
+        ]
+    ],
+    'OrgFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/feed',
+        'summary' => 'Get organization activity feed',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'username or email of admin user'
+                'description' => 'The OAuth2 access token'
             ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgCredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+        'summary' => 'Get organization client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
             'access_token' => [
-                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => false,
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
             ]
         ]
     ],
-    'AdminUserPassword' => [
-        'httpMethod' => 'PUT',
-        'uri' => '/management/{org_name_or_uuid}/users/{user_name_or_email}/password',
-        'notes' => 'Set Admin User Password.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Get Admin User',
+    'OrgCredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+        'summary' => 'Generate organization client credentials',
         'responseClass' => '',
-        'responseType' => 'model',
+        'responseType' => 'object',
         'errorResponses' => $errors,
         'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
             'org_name_or_uuid' => [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
                 'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgUsersGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Get admin users for organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
             ],
-            'user_name_or_email' => [
+            'org_name_or_uuid' => [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'description' => 'username or email of admin user'
-            ],
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgUsersJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Create new admin user for organization using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
             'access_token' => [
-                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => false,
+                'required' => true,
+                'description' => 'The OAuth2 access token'
             ],
-            'password' => [
-                'description' => 'The old password',
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Admin Email'
             ],
-            'newpassword' => [
-                'description' => 'The new password',
+            'password' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Admin Password'
             ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
         ]
     ],
-
-    //Management Organizations
-    'CreateOrg' => [
+    'OrgUsersFormPost' => [
         'httpMethod' => 'POST',
-        'uri' => '/management/organizations',
-        'notes' => 'Create new Organization.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create New Organization',
-        'responseClass' => '',
-        'responseType' => 'model',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Create new admin user for organization using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
-                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => false,
+                'required' => true,
+                'description' => 'The OAuth2 access token'
             ],
-            'organization' => [
-                'description' => 'Organization Name',
-                'location' => 'json',
+            'org_name_or_uuid' => [
+                'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Organization name or uuid'
             ],
             'username' => [
-                'description' => 'Admin User  Name',
-                'location' => 'json',
+                'location' => 'postField',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Admin Username'
             ],
             'name' => [
-                'description' => 'Admin Users Full Name',
-                'location' => 'json',
+                'location' => 'postField',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Admin Name'
             ],
             'email' => [
-                'description' => 'Admin Users email',
-                'location' => 'json',
+                'location' => 'postField',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Admin Email'
             ],
             'password' => [
-                'description' => 'Admin Users password',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'OrgUserPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'summary' => 'Adds existing admin users for organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin user username, email, or uuid'
+            ]
+        ]
+    ],
+    'OrgUserDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'summary' => 'Remove an admin user from organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin user username, email, or uuid'
+            ]
+        ]
+    ],
+    'OrgAppsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Get apps for organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppsJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Create new application for organization using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'name' => [
                 'location' => 'json',
                 'type' => 'string',
                 'required' => true,
+                'description' => 'Application Name'
             ]
         ],
         'additionalParameters' => [
             'location' => 'json'
         ]
     ],
+    'OrgAppsFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Create new application for organization using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application Name'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'OrgAppDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}',
+        'summary' => 'Delete an application in an organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppCredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+        'summary' => 'Get application keys.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppCredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+        'summary' => 'Generate application keys.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgUserJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users',
+        'summary' => 'Create new admin user.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'OrgUserFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users',
+        'summary' => 'Create new admin using form post parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'username' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+
+    ],
+    'OrgUserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/resetpw',
+        'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+    ],
+    'OrgUserResetPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/resetpw',
+        'summary' => 'Complete a user password reset.  Handles form POST response.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'recaptcha_challenge_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Challenge Field'
+            ],
+            'recaptcha_response_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Response Field'
+            ],
+        ]
+    ],
+    'AdminUserGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}',
+        'summary' => 'Returns the admin user details',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+        ]
+
+    ],
+    'AdminUserJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}',
+        'summary' => 'Updates the admin user details.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+
+    ],
+    'AdminUserActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/activate',
+        'summary' => 'Activates the admin user from link provided in email notification.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'confirm' => [
+                'location' => 'uri',
+                'type' => 'boolean',
+                'required' => false,
+                'description' => 'Send confirmation email'
+            ],
+        ]
+    ],
+    'AdminUserReactivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/reactivate',
+        'summary' => 'Request admin user reactivation.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ]
+        ]
+    ],
+    'AdminUserFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/feed',
+        'summary' => 'Get admin user activity feed.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+        ]
+    ],
+    'AdminUserPasswordJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}/password',
+        'summary' => 'Set admin user password.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'old_password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Old and new password'
+            ],
+            'new_password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Old and new password'
+            ],
+        ]
+    ],
+    'AdminUserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+        'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ]
+        ]
+    ],
+    'AdminUserResetPasswordFormPost' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+        'summary' => 'Complete a user password reset.  Handles form POST response.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'recaptcha_challenge_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Challenge Field'
+            ],
+            'recaptcha_response_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Response Field'
+            ]
+        ]
+    ],
+    'AdminUserOrgsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Get organizations for admin user.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ]
+    ],
+    'AdminUserOrgsJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Create new organization for admin user using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'organization' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserOrgsFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Create new organization for admin user using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'organization' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'AdminUserOrgPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+        'summary' => 'Add admin users to organization.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserOrgDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+        'summary' => 'Remove an admin user from organization.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+
+        ]
+    ]
+
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
index eaabf26..22e4df7 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -98,7 +98,7 @@ return [
         'notes' => 'Query Roles.',
         'summary' => 'Query the roles collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -173,7 +173,7 @@ return [
         'notes' => 'Find Role by uuid.',
         'summary' => 'Find role by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -255,7 +255,7 @@ return [
         'notes' => 'Create new Role.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Role entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -295,7 +295,7 @@ return [
         'notes' => 'Delete a Role entity.',
         'summary' => 'Delete a Role entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -337,7 +337,7 @@ return [
         'notes' => 'Update a Role entity.',
         'summary' => 'Update a Roles entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45cf1256/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index b187fdd..a9108e0 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -42,7 +42,7 @@ return [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'default' => 'users'
+                'default' => 'shops'
             ],
             'access_token' => [
                 'description' => 'The OAuth2 access token',
@@ -98,7 +98,7 @@ return [
         'notes' => 'Query Users.',
         'summary' => 'Query the users collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -173,7 +173,7 @@ return [
         'notes' => 'Find User by uuid.',
         'summary' => 'Find user by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -255,7 +255,7 @@ return [
         'notes' => 'Create new User.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new User entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -295,7 +295,7 @@ return [
         'notes' => 'Delete a User entity.',
         'summary' => 'Delete a User entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -337,7 +337,7 @@ return [
         'notes' => 'Update a User entity.',
         'summary' => 'Update a User entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'model',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [


[43/45] incubator-usergrid git commit: added one more example to users example to show how to get a nested values from the results agin using PHP Collection methods

Posted by ro...@apache.org.
added one more example to users example to show how to get a nested values from the results agin using PHP Collection methods

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1742b151
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1742b151
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1742b151

Branch: refs/heads/master
Commit: 1742b15186dd37ed7d91fb6b31d1dd6e9201c68c
Parents: a9fbc73
Author: Apps4u <ja...@apps4u.com.au>
Authored: Tue Nov 11 14:47:31 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Tue Nov 11 14:47:31 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1742b151/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index 34a897d..9bcea83 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -91,7 +91,11 @@ echo $user_addr->entities->fetch('adr.addr1');
 //or
 echo $user_addr->entities->fetch('adr.city');
 
+// get users device URL -- nested fetch on php collection
+$users_nested = Usergrid::users()->all();
+var_dump($users_nested->entities->fetch('metadata.collections.devices')->first());
+
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
 
-//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
\ No newline at end of file
+//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);


[27/45] incubator-usergrid git commit: done tests and added example file. To run the tests you need to add your details to the test_config.php file in the tests folder Also for tests use client_id & client_secret and a auth_type of Organisation . Example

Posted by ro...@apache.org.
done tests and added example file. To run the tests you need to add your details to the test_config.php file in the tests folder Also for tests use client_id & client_secret and a auth_type of Organisation .
Examples.php file contain most api calls but its more then enough to work out whats what. Also going through the manifest files you can see which param are required for which calls and the api will let you know if there is a param missing that is required.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3c6ebe83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3c6ebe83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3c6ebe83

Branch: refs/heads/master
Commit: 3c6ebe835547c39236c7eb2aed5e92291af680f8
Parents: b79f615
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Sat Nov 1 16:37:17 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Sat Nov 1 16:37:17 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/examples.php          | 244 ++++++++++++
 .../src/Manifests/1.0.1/Application.php         | 169 +++++++--
 .../src/Manifests/1.0.1/Custom.php              | 380 +++++++++++++++++++
 .../src/Manifests/1.0.1/Groups.php              | 106 +++++-
 .../tests/Api/ApplicationTest.php               |  43 +--
 .../Api/Exception/BadRequestExceptionTest.php   |  58 +++
 .../Api/Exception/InvalidIdExceptionTest.php    |  58 +++
 .../Api/Exception/NotFoundExceptionTest.php     |  58 +++
 .../Api/Exception/ServerErrorExceptionTest.php  |  58 +++
 .../Api/Exception/UnauthorizedExceptionTest.php |  59 +++
 .../tests/Api/ManagementTest.php                |  45 +--
 .../apache-usergrid/tests/Api/UsergridTest.php  |  64 +---
 .../apache-usergrid/tests/Api/test_config.php   |  65 ++++
 13 files changed, 1265 insertions(+), 142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/examples.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/examples.php b/sdks/php5/apache-usergrid/examples.php
new file mode 100644
index 0000000..f139808
--- /dev/null
+++ b/sdks/php5/apache-usergrid/examples.php
@@ -0,0 +1,244 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+include('vendor/autoload.php');
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => './src/Manifests', //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'application',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'password',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+/** Usergrid Facades Off */
+
+//call the bootstrap class that will create the api client then get the usergrid instance from the bootstrapper
+$bootstrapper = new UsergridBootstrapper($config);
+$usergrid = $bootstrapper->createUsergrid();
+
+/** Note: I'm using Users for the first lot of example's but you could do the same for all default collections eg: groups, devices, roles, notification etc*/
+
+//find users with query
+$user = $usergrid->users()->find(['ql' => 'select * where activated=true']);
+
+//var_dump($user->first());
+
+//request that throw exception in this case 404 not found
+try {
+
+    $user2 = $usergrid->users()->findById(['uuid' => 'uuid-number']);
+//    var_dump($user2->get('entities'));
+} catch (Apache\Usergrid\Api\Exception\NotFoundException $e) {
+
+//    var_dump($e->getResponse());
+}
+/**
+ * There a errors for all Usergrid response errors and http errors so you can create a catch all error class or plug it into your fav php frameworks error handling.
+ * Apache\Usergrid\Api\Exception\BadRequestException = http 400
+ * Apache\Usergrid\Api\Exception\UnauthorizedException = http 401
+ * Apache\Usergrid\Api\Exception\RequestFailedException = http 402
+ * Apache\Usergrid\Api\Exception\NotFoundException = http 404
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 500
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 502
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 503
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 504
+ */
+
+// collection Iterators no need to keep calling request with a cursor to get all entities in a collection
+// UserIterator(), DeviceIterator() GroupsIterator() , RolesIterator() etc.
+$user_iterator = $usergrid->usersIterator();
+
+foreach ($user_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$new_user = ['name' => 'jasonk', 'username' => 'JasonK', 'email' => 'jason@example.com', 'password' => 'some_password'];
+//$created_user = $usergrid->users()->create($new_user);
+//var_dump($created_user);
+
+//Update Users by name or uuid
+$new_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$updated_user = $usergrid->users()->update($new_email);
+//var_dump($updated_user);
+
+// delete a user
+//$deleted_user = $usergrid->users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($deleted_user);
+
+//get custom collection
+$custom_collection = $usergrid->application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->get('entities'));
+
+//get custom collection with query
+$custom_collection_query = $usergrid->application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('entities'));
+
+// Post custom collection as JSON data
+$custom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+//$created_entity = $usergrid->application()->EntityJsonPost($custom_entity);
+//var_dump($created_entity);
+
+// update custom Entity
+$custom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => '918a044a-618a-11e4-8c11-253e9c3723a9',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$edited_entity = $usergrid->application()->EntityPut($custom_entity_edit);
+
+
+/** Usergrid Facades On */
+
+//create a bootstrap instance and then call the static instance method on the Usergrid facade
+$bootstrapper2 = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper2);
+
+
+// find users with query
+$fUser = Usergrid::users()->find(['ql' => 'select * where activated=true']);
+
+$fUser_iterator = Usergrid::usersIterator();
+
+foreach ($fUser_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$fNew_user = [
+    'name' => 'jasonk',
+    'username' => 'JasonK2',
+    'email' => 'jaso2n@example.com',
+    'password' => 'some_password'
+];
+$fCreated_user = Usergrid::users()->create($fNew_user);
+//var_dump($fCreated_user);
+
+//Update Users by name or uuid
+$fNew_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$fUpdated_user = Usergrid::users()->update($fNew_email);
+//var_dump($fUpdated_user);
+
+// delete a user
+$fDeleted_user = Usergrid::users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($fDeleted_user);
+
+//get custom collection
+$fCustom_collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->get('entities'));
+
+//get custom collection with query
+$fCustom_collection_query = Usergrid::application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('entities'));
+
+// Post custom collection as JSON data
+$fCustom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name3',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+$fCreated_entity = Usergrid::applictions()->EntityJsonPost($custom_entity);
+//var_dump($fCreated_entity);
+
+// update entity
+$fCustom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => 'shop_name2',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$fEdited_entity = Usergrid::applications()->EntityPut($fCustom_entity_edit);
+//var_dump($fEdited_entity);
+
+
+
+/** Relationships */
+$related_data =[
+    'collection' => 'required',
+    'entity_id' => 'required',
+    'relationship' => 'required',
+    'ql' => 'optional'
+];
+$get_relationship = Usergrid::application()->GetRelationship($related_data);
+
+
+$create_relationship_data = [
+    'collection' => 'required',
+    'first_entity_id' => 'required',
+    'relationship' => 'required',
+    'second_entity_id' => 'required'
+];
+$new_relationship = Usergrid::application()->CreateRelationship($create_relationship_data);
+
+
+/** Groups  */
+
+//add user to group
+$fAdd_user_to_group_data = [
+    'entity_name_or_uuid' => 'group_name',
+    'user_name_or_uuid' => 'username'
+];
+$fAdded_user_to_group = Usergrid::groups()->addUser($fAdd_user_to_group_data);
+
+//delete user from group
+$fDeleted_user_from_group = Usergrid::groups()->deleteUser($fAdd_user_to_group_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
index 64f8cbc..f0d49fb 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
@@ -965,36 +965,147 @@ return [
         ]
     ],
 
-    //Application Groups
-    'CreateGroups' => [],
-    'AddUserToGroups' => [],
-    'GetGroups' => [],
-    'PutGroups' => [],
-    'DeleteUserFromGroups' => [],
-    'GetGroupsFeeds' => [],
-    'AddGroupUser' => [],
 
 
-    //Application Roles
-    'CreateRole' => [],
-    'GetRole' => [],
-    'DeleteRole' => [],
-    'GetRolePermission' => [],
-    'AddRolePermission' => [],
-    'DeleteRolePermission' => [],
-    'AddRoleUser' => [],
-    'GetRoleUsers' => [],
-    'DeleteRoleUser' => [],
-
-    //Application Users
-    'CreateUser' => [],
-    'GetUser' => [],
-    'UpdateUser' => [],
-    'DeleteUser' => [],
-    'AddUserConnection' => [],
-    'DeleteUserConnection' => [],
-    'GetUserConnections' => [],
-    'GetUserFeed' => []
-
     //Application Collection Relationships
+    'GetRelationship' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_id}/{relationship}',
+        'notes' => 'Query an Entity Relationship ',
+        'summary' => 'Query an Entity Relationship',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_id' => [
+                'description' => 'Entity  ID (uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'relationship' => [
+                'description' => 'Relationship',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'CreateRelationship' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{first_entity_id}/{relationship}/{second_entity_id}',
+        'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app entity',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'first_entity_id' => [
+                'description' => 'first entity id (uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'relationship' => [
+                'description' => 'relationship',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'second_entity_id' => [
+                'description' => '2nd entity id (uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
new file mode 100644
index 0000000..e5b94b3
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Custom.php
@@ -0,0 +1,380 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'find' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query Users.',
+        'summary' => 'Query the users collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'findById' => ['httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
+        'notes' => 'Find User by uuid.',
+        'summary' => 'Find user by uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'uuid' => [
+                'description' => 'User UUID (entity uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'create' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new User entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'destroy' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete a User entity.',
+        'summary' => 'Delete a User entity by name or uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'update' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update a User entity.',
+        'summary' => 'Update a User entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => $custom
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
index 230f347..d0832d9 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
@@ -348,7 +348,111 @@ return [
                 'required' => true,
             ],
             'entity_name_or_uuid' => [
-                'description' => 'entity name or uuid',
+                'description' => 'group name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'addUser' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}/users/{user_name_or_uuid}',
+        'notes' => 'Update a Group entity.',
+        'summary' => 'Update a Group entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'group name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_name_or_uuid' => [
+                'description' => 'user name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'removeUser' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}/users/{user_name_or_uuid}',
+        'notes' => 'Update a Group entity.',
+        'summary' => 'Update a Group entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'group name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_name_or_uuid' => [
+                'description' => 'user name or uuid',
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
index fa80e0c..b6c1829 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
@@ -40,47 +40,24 @@ class ApplicationTest extends PHPUnit_Framework_TestCase
      */
     protected $usergrid;
 
-    protected $config = [
-        'usergrid' => [
-            'url' => 'https://api.usergrid.com',
-            'version' => '1.0.0',
-            'orgName' => null,
-            'appName' => null,
-            'manifestPath' => './src/Manifests/1.0.1',
-            'clientId' => null,
-            'clientSecret' => null,
-            'username' => null,
-            'password' => null,
-            /**
-             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
-             * Token from.  You have two options here one is 'application' the other is 'organization'
-             *
-             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
-             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
-             */
-            'auth_type' => 'organization',
-            /** The Grant Type to use
-             *
-             * This has to be set to one of the 2 grant types that Apache Usergrid
-             * supports which at the moment is client_credentials or password but at
-             * 2 level organization or application
-             */
-            'grant_type' => 'client_credentials'
-        ]
-    ];
+    protected $config;
 
     /**
      *
      */
     public function setUp()
     {
-        $boostrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $boostrap->createUsergrid();
+        /** @noinspection PhpIncludeInspection */
+        $this->config = include  $_SERVER['CONFIG'];
+        $bootstrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $bootstrap->createUsergrid();
     }
 
-    /** @test */
-    public function it_can_get_oauth2_token()
-    {
+    /**
+     * @test
+     * @group internet
+     */
+    public function it_can_get_entity(){
 
     }
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
new file mode 100644
index 0000000..e262cef
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+use PHPUnit_Framework_TestCase;
+use Guzzle\Http\Message\Response;
+use Apache\Usergrid\Api\Exception\BadRequestException;
+
+/**
+ * Class BadRequestExceptionTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class BadRequestExceptionTest extends PHPUnit_Framework_TestCase {
+
+	/** @test */
+	public function it_can_create_the_exception()
+	{
+		$command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+		$command
+			->expects($this->once())
+			->method('getRequest')
+			->will($this->returnValue(
+				$this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+			));
+
+		$response = new Response(400);
+		$response->setBody('');
+
+        /** @noinspection PhpParamsInspection */
+        $exception = BadRequestException::fromCommand($command, $response);
+
+		$this->assertInstanceOf(
+			'Apache\Usergrid\Api\Exception\BadRequestException',
+			$exception
+		);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/Exception/InvalidIdExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/InvalidIdExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/InvalidIdExceptionTest.php
new file mode 100644
index 0000000..d2256d1
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/InvalidIdExceptionTest.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+use PHPUnit_Framework_TestCase;
+use Guzzle\Http\Message\Response;
+use Apache\Usergrid\Api\Exception\InvalidIdException;
+
+/**
+ * Class InvalidIdExceptionTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class InvalidIdExceptionTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(400);
+        $response->setBody('');
+
+        /** @noinspection PhpParamsInspection */
+        $exception = InvalidIdException::fromCommand($command, $response);
+
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\InvalidIdException',
+            $exception
+        );
+    }
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
new file mode 100644
index 0000000..78cdf3d
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+use PHPUnit_Framework_TestCase;
+use Guzzle\Http\Message\Response;
+use Apache\Usergrid\Api\Exception\NotFoundException;
+
+/**
+ * Class UnauthorizedExceptionTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+
+class NotFoundExceptionTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(404);
+        $response->setBody('');
+
+        /** @noinspection PhpParamsInspection */
+        $exception = NotFoundException::fromCommand($command, $response);
+
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\NotFoundException',
+            $exception
+        );
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/Exception/ServerErrorExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/ServerErrorExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/ServerErrorExceptionTest.php
new file mode 100644
index 0000000..7782bcc
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/ServerErrorExceptionTest.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+use PHPUnit_Framework_TestCase;
+use Guzzle\Http\Message\Response;
+use Apache\Usergrid\Api\Exception\ServerErrorException;
+
+/**
+ * Class ServerErrorException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ServerErrorExceptionTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(400);
+        $response->setBody('');
+
+        /** @noinspection PhpParamsInspection */
+        $exception = ServerErrorException::fromCommand($command, $response);
+
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\ServerErrorException',
+            $exception
+        );
+    }
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
new file mode 100644
index 0000000..14dad49
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+namespace Apache\Usergrid\Tests\Api\Exception;
+
+
+use PHPUnit_Framework_TestCase;
+use Guzzle\Http\Message\Response;
+use Apache\Usergrid\Api\Exception\UnauthorizedException;
+
+/**
+ * Class UnauthorizedExceptionTest
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+
+class UnauthorizedExceptionTest extends PHPUnit_Framework_TestCase
+{
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(401);
+        $response->setBody('');
+
+        /** @noinspection PhpParamsInspection */
+        $exception = UnauthorizedException::fromCommand($command, $response);
+
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\UnauthorizedException',
+            $exception
+        );
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
index 3df4824..056d402 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
@@ -33,45 +33,20 @@ use PHPUnit_Framework_TestCase;
 class ManagementTest extends PHPUnit_Framework_TestCase
 {
     protected $usergrid;
-    protected $config = [
-        'usergrid' => [
-            'url' => 'https://api.usergrid.com',
-            'version' => '1.0.0',
-            'orgName' => null,
-            'appName' => null,
-            'manifestPath' => './src/Manifests/1.0.1',
-            'clientId' => null,
-            'clientSecret' => null,
-            'username' => null,
-            'password' => null,
-            /**
-             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
-             * Token from.  You have two options here one is 'application' the other is 'organization'
-             *
-             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
-             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
-             */
-            'auth_type' => 'organization',
-            /** The Grant Type to use
-             *
-             * This has to be set to one of the 2 grant types that Apache Usergrid
-             * supports which at the moment is client_credentials or password but at
-             * 2 level organization or application
-             */
-            'grant_type' => 'client_credentials'
-
-        ]
-    ];
+    protected $config;
 
     public function setUp()
     {
-        $boostrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $boostrap->createUsergrid();
+        /** @noinspection PhpIncludeInspection */
+        $this->config = include  $_SERVER['CONFIG'];
+        $bootstrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $bootstrap->createUsergrid();
     }
-
-    /** @test */
-    public function it_can_retrive_token()
-    {
+    /**
+     * @test
+     * @group internet
+     */
+    public function it_can_make_management_call(){
 
     }
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
index 80b919a..5fab892 100644
--- a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
@@ -16,6 +16,7 @@
 
 namespace Apache\Usergrid\Tests\Api;
 
+use Apache\Usergrid\Api\Exception\UnauthorizedException;
 use Apache\Usergrid\Native\UsergridBootstrapper;
 use PHPUnit_Framework_TestCase;
 
@@ -35,35 +36,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     /** @var  Usergrid Api Client */
     protected $usergrid;
 
-    protected $config = [
-        'usergrid' => [
-            'url' => 'https://api.usergrid.com',
-            'version' => '1.0.0',
-            'orgName' => null,
-            'appName' => null,
-            'manifestPath' => './src/Manifests/1.0.1',
-            'clientId' => null,
-            'clientSecret' => null,
-            'username' => null,
-            'password' => null,
-            /**
-             * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
-             * Token from.  You have two options here one is 'application' the other is 'organization'
-             *
-             *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
-             *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
-             */
-            'auth_type' => 'organization',
-            /** The Grant Type to use
-             *
-             * This has to be set to one of the 2 grant types that Apache Usergrid
-             * supports which at the moment is client_credentials or password but at
-             * 2 level organization or application
-             */
-            'grant_type' => 'client_credentials'
-
-        ]
-    ];
+    protected $config;
     /**
      * Setup resources and dependencies
      *
@@ -71,14 +44,27 @@ class UsergridTest extends PHPUnit_Framework_TestCase
      */
     public function setup()
     {
-        $boostrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $boostrap->createUsergrid();
+        /** @noinspection PhpIncludeInspection */
+        $this->config = include  $_SERVER['CONFIG'];
+        $bootstrap = new UsergridBootstrapper($this->config);
+        $this->usergrid = $bootstrap->createUsergrid();
     }
 
-    /** @test */
+    /**
+     * @test
+     * @group internet
+     */
     public function it_can_retrieve_oauth2_token()
     {
-        //TODO: phpunit test method implementation
+        $error = null;
+
+        try {
+            $this->usergrid->application()->EntityGet(['collection' => 'roles']);
+        } catch(UnauthorizedException $e) {
+            $error = $e;
+        }
+
+        $this->assertNull($error, 'Exception should be null if authorized');
     }
 
     /** @test */
@@ -109,7 +95,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     public function it_can_retrieve_the_manifest_path()
     {
 
-        $this->assertEquals('./src/Manifests/1.0.1', $this->usergrid->getManifestPath());
+        $this->assertEquals('/Users/admin/PhpstormProjects/Apache-Usergrid/src/Manifests', $this->usergrid->getManifestPath());
     }
 
     /** @test */
@@ -164,17 +150,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($headers, $expected);
     }
 
-    /** @test */
-    public function it_can_retrieve_client_id_and_secret()
-    {
-        //TODO: phpunit test method implementation
-    }
 
-    /** @test */
-    public function it_can_set_client_id_and_secret()
-    {
-        //TODO: phpunit test method implementation
-    }
 
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3c6ebe83/sdks/php5/apache-usergrid/tests/Api/test_config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/test_config.php b/sdks/php5/apache-usergrid/tests/Api/test_config.php
new file mode 100644
index 0000000..cd1df43
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/Api/test_config.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'usergrid' => [
+
+        'url' => 'https://api.usergrid.com',
+
+        'version' => '1.0.0',
+
+        'orgName' => "",
+
+        'appName' => "",
+
+        'manifestPath' => null,
+
+        //its better not to set the real values here if using laravel set them in a .env file or
+        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
+        // so that way you can be sure not to commit privates ID to a public repo
+        'clientId' => '',
+
+        'clientSecret' => '',
+
+        'username' => null,
+
+        'password' => null,
+
+
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
\ No newline at end of file


[25/45] incubator-usergrid git commit: updated manifest files change response model to model from class .

Posted by ro...@apache.org.
updated manifest files change response model to model from class .


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4bd23609
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4bd23609
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4bd23609

Branch: refs/heads/master
Commit: 4bd236092fb085a99c409863fbb75741206033e6
Parents: fbc8168
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Fri Oct 31 17:32:22 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Fri Oct 31 17:32:22 2014 +1000

----------------------------------------------------------------------
 .../src/Manifests/1.0.1/Application.php         | 48 ++++++++++----------
 .../src/Manifests/1.0.1/Devices.php             | 16 +++----
 .../src/Manifests/1.0.1/Errors.php              |  2 +-
 .../src/Manifests/1.0.1/Groups.php              | 14 +++---
 .../src/Manifests/1.0.1/Management.php          | 14 +++---
 .../src/Manifests/1.0.1/Notification.php        |  8 ++--
 .../src/Manifests/1.0.1/Roles.php               | 15 +++---
 .../src/Manifests/1.0.1/Users.php               | 13 +++---
 8 files changed, 64 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
index e27b30e..64f8cbc 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Application.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
         'summary' => 'Get app access token',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -76,7 +76,7 @@ return [
         'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
         'summary' => 'Get app access token',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -130,7 +130,7 @@ return [
         'notes' => 'Authorize the app client.  See the OAuth2 specification.',
         'summary' => 'Authorize app client',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -184,7 +184,7 @@ return [
         'notes' => 'Authorize the app client.  See the OAuth2 specification.',
         'summary' => 'Authorize app client',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -238,7 +238,7 @@ return [
         'notes' => 'Get the app client credentials.',
         'summary' => 'Get app client credentials',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -267,7 +267,7 @@ return [
         'notes' => 'Generate new app client credentials',
         'summary' => 'Generate app client credentials',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Create new app user',
         'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -343,7 +343,7 @@ return [
         'notes' => 'Create new app user',
         'summary' => 'Create new app user using form post parameters.',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -390,7 +390,7 @@ return [
         'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
         'summary' => 'Initiate a user password reset',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -413,7 +413,7 @@ return [
         'notes' => 'Complete a user password reset.  Handles form POST response.',
         'summary' => 'Complete a user password reset',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -454,7 +454,7 @@ return [
         'notes' => 'Returns the app user details.',
         'summary' => 'Returns the app user details',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -489,7 +489,7 @@ return [
         'notes' => 'Updates the app user details.',
         'summary' => 'Updates the app user details',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -527,7 +527,7 @@ return [
         'notes' => 'Activates the app user from link provided in email notification.',
         'summary' => 'Activates the app user',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -568,7 +568,7 @@ return [
         'notes' => 'Request app user reactivation.',
         'summary' => 'Reactivates the app user',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -597,7 +597,7 @@ return [
         'notes' => 'Get app user activity feed.',
         'summary' => 'Get app user activity feed',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -632,7 +632,7 @@ return [
         'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Set app user password',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -671,7 +671,7 @@ return [
         'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
         'summary' => 'Initiate a user password reset',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -700,7 +700,7 @@ return [
         'notes' => 'Complete a user password reset.  Handles form POST response.',
         'summary' => 'Complete a user password reset',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -740,8 +740,8 @@ return [
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
-        'responseClass' => '',
-        'responseType' => 'object',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -812,7 +812,7 @@ return [
         'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app entity',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -851,7 +851,7 @@ return [
         'notes' => 'Update an app entity in a collection.',
         'summary' => 'Update an app entity',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -896,7 +896,7 @@ return [
         'notes' => 'Delete an app entity.',
         'summary' => 'Delete an app entity',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -937,7 +937,7 @@ return [
         'notes' => 'Create Event.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app event',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
index b688575..de3473d 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Get All devices.',
         'summary' => 'Get all Device collection limit 10000',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -78,8 +78,8 @@ return [
                 'description' => 'an encoded representation of the query position for paging',
                 'location' => 'query',
                 'type' => 'integer',
-                'required' => false,
-                'default' => 10000
+                'required' => false
+
             ],
             'filter' => [
                 'description' => 'a condition to filter on',
@@ -99,7 +99,7 @@ return [
         'notes' => 'Query Devices.',
         'summary' => 'Query the devices collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +174,7 @@ return [
         'notes' => 'Find Device by uuid.',
         'summary' => 'Find device by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +256,7 @@ return [
         'notes' => 'Create new Device.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Device entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Delete a Device entity.',
         'summary' => 'Delete a Device entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +338,7 @@ return [
         'notes' => 'Update a Device entity.',
         'summary' => 'Update a Device entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
index de2da47..3230dbd 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Errors.php
@@ -47,4 +47,4 @@ return [
         'class' => 'Apache\Usergrid\Api\Exception\ServerErrorException',
         'code' => 504,
     ],
-];
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
index e874ce9..230f347 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -79,7 +79,7 @@ return [
                 'location' => 'query',
                 'type' => 'integer',
                 'required' => false,
-                'default' => 10000
+
             ],
             'filter' => [
                 'description' => 'a condition to filter on',
@@ -99,7 +99,7 @@ return [
         'notes' => 'Query Groups.',
         'summary' => 'Query the groups collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +174,7 @@ return [
         'notes' => 'Find group by uuid.',
         'summary' => 'Find group by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +256,7 @@ return [
         'notes' => 'Create new Group.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Group entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +296,7 @@ return [
         'notes' => 'Delete a Group entity.',
         'summary' => 'Delete a Group entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +338,7 @@ return [
         'notes' => 'Update a Group entity.',
         'summary' => 'Update a Group entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index d50d221..14c4a29 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Get the org or admin user access token.  See the OAuth2 specification for details.',
         'summary' => 'Get organization access token',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'grant_type' => [
@@ -64,7 +64,7 @@ return [
         'notes' => 'Get the Application user access token.  See the OAuth2 specification for details.',
         'summary' => 'Get Application access token',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -118,7 +118,7 @@ return [
         'notes' => 'Create Admin User .  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create Admin User',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -168,7 +168,7 @@ return [
         'notes' => 'Update Admin User .  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create Admin User',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -200,7 +200,7 @@ return [
         'notes' => 'Get Admin User .  See Usergrid documentation for JSON format of body.',
         'summary' => 'Get Admin User',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -229,7 +229,7 @@ return [
         'notes' => 'Set Admin User Password.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Get Admin User',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'org_name_or_uuid' => [
@@ -272,7 +272,7 @@ return [
         'notes' => 'Create new Organization.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create New Organization',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
index 0606eb2..7f65626 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
@@ -21,7 +21,7 @@ return [
         'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app notification',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
@@ -57,7 +57,7 @@ return [
         'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app notification',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
@@ -93,7 +93,7 @@ return [
         'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app notification',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
@@ -122,7 +122,7 @@ return [
         'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new app notification',
         'responseClass' => '',
-        'responseType' => 'object',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
index a0f7c43..eaabf26 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -79,7 +79,6 @@ return [
                 'location' => 'query',
                 'type' => 'integer',
                 'required' => false,
-                'default' => 10000
             ],
             'filter' => [
                 'description' => 'a condition to filter on',
@@ -99,7 +98,7 @@ return [
         'notes' => 'Query Roles.',
         'summary' => 'Query the roles collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +173,7 @@ return [
         'notes' => 'Find Role by uuid.',
         'summary' => 'Find role by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +255,7 @@ return [
         'notes' => 'Create new Role.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new Role entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +295,7 @@ return [
         'notes' => 'Delete a Role entity.',
         'summary' => 'Delete a Role entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +337,7 @@ return [
         'notes' => 'Update a Role entity.',
         'summary' => 'Update a Roles entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -358,7 +357,7 @@ return [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'default' => 'roles'
+                'default' => 'r'
             ],
             'access_token' => [
                 'description' => 'The OAuth2 access token',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4bd23609/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index 2b8e199..b187fdd 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -22,7 +22,7 @@ return [
         'notes' => 'Query an app collection.',
         'summary' => 'Query an app collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -79,7 +79,6 @@ return [
                 'location' => 'query',
                 'type' => 'integer',
                 'required' => false,
-                'default' => 10000
             ],
             'filter' => [
                 'description' => 'a condition to filter on',
@@ -99,7 +98,7 @@ return [
         'notes' => 'Query Users.',
         'summary' => 'Query the users collection',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -174,7 +173,7 @@ return [
         'notes' => 'Find User by uuid.',
         'summary' => 'Find user by uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -256,7 +255,7 @@ return [
         'notes' => 'Create new User.  See Usergrid documentation for JSON format of body.',
         'summary' => 'Create new User entity',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -296,7 +295,7 @@ return [
         'notes' => 'Delete a User entity.',
         'summary' => 'Delete a User entity by name or uuid',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [
@@ -338,7 +337,7 @@ return [
         'notes' => 'Update a User entity.',
         'summary' => 'Update a User entity by name or uuid and using JSON data',
         'responseClass' => 'Apache\Usergrid\Api\Models\User',
-        'responseType' => 'class',
+        'responseType' => 'model',
         'errorResponses' => $errors,
         'parameters' => [
             'app_name_or_uuid' => [


[39/45] incubator-usergrid git commit: update I had to copy paste from other repo thats why there is so many file changes.

Posted by ro...@apache.org.
update I had to copy paste from other repo thats why there is so many file changes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/27879d19
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/27879d19
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/27879d19

Branch: refs/heads/master
Commit: 27879d19ebc46658505aa4f4de0ee4713423b500
Parents: e57f853
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Mon Nov 10 13:36:49 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Mon Nov 10 13:36:49 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php     | 7 +++----
 sdks/php5/apache-usergrid/README.md                          | 2 +-
 sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php | 2 +-
 sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php      | 2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/27879d19/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index f1c529d..eb99fdd 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -87,12 +87,11 @@ var_dump($find_user_by_uuid->entities);
 
 // AS all results as PHP Collections and the entities propery is always returned as a PHP Collection you can fetch nested records
 $user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
-echo $user_addr->entities->fetch('adr');
-//or
-
 echo $user_addr->entities->fetch('adr.addr1');
+//or
+echo $user_addr->entities->fetch('adr.street');
 
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
 
-//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
+//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/27879d19/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index c5373ae..66adf00 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -189,4 +189,4 @@ of it as a helper as some times it good to have access to both world server side
 * Writing tests
 * Code review
 * Code
-* Manifest files
+* Manifest files
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/27879d19/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index ea7c8ad..b471e77 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -1073,4 +1073,4 @@ return [
         ]
     ]
 
-];
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/27879d19/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index 9b9c609..1e57430 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -377,4 +377,4 @@ return [
             'location' => 'json'
         ]
     ]
-];
+];
\ No newline at end of file


[19/45] incubator-usergrid git commit: typo

Posted by ro...@apache.org.
typo

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3136d91c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3136d91c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3136d91c

Branch: refs/heads/master
Commit: 3136d91c9e4225d84598956231ff7ff411fa9bc0
Parents: 7b452da
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Oct 27 12:41:35 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Oct 27 12:41:35 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/Usergrid.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3136d91c/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
index 392c85a..d3942f3 100644
--- a/sdks/php5/apache-usergrid/src/Api/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -123,7 +123,7 @@ class Usergrid
     function __construct($orgName = null, $appName = null, $manifestPath, $version, $baseUrl, Oauth2Plugin $oauth2_plugin = null)
     {
         //Set Version so its added to header
-        $this->setVersion($version ?: $this-version); 
+        $this->setVersion($version ?: $this->version); 
 
         $this->baseUrl = $baseUrl;
 


[45/45] incubator-usergrid git commit: Merge branch 'master' of https://github.com/apps4u/incubator-usergrid

Posted by ro...@apache.org.
Merge branch 'master' of https://github.com/apps4u/incubator-usergrid

# By Apps4u
# Via Apps4u
* 'master' of https://github.com/apps4u/incubator-usergrid:
  added one more example to users example to show how to get a nested values from the results agin using PHP Collection methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a89c57b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a89c57b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a89c57b8

Branch: refs/heads/master
Commit: a89c57b89fe73d2f259bff10212abca854be4860
Parents: 8e6df80 1742b15
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Tue Nov 11 18:16:24 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Tue Nov 11 18:16:24 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[38/45] incubator-usergrid git commit: Merge branch 'master' of https://github.com/apps4u/incubator-usergrid

Posted by ro...@apache.org.
Merge branch 'master' of https://github.com/apps4u/incubator-usergrid

# By Apps4u
# Via Apps4u
* 'master' of https://github.com/apps4u/incubator-usergrid:
  updated readME correct mark down
  changed the access_token from required True to false as the SDK puts the token in the header on uri
  typo
  added example to show how to get nested values using fetch as all results and the entities property are PHP Collections
  typo had shops instead of users as collection name in users manifest file

Conflicts:
	sdks/php5/apache-usergrid/Examples/collections/users.php


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e57f8535
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e57f8535
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e57f8535

Branch: refs/heads/master
Commit: e57f8535dd09d25422655554f4850d777427eacb
Parents: c660772 eac1627
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Mon Nov 10 13:34:39 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Mon Nov 10 13:34:39 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php     | 7 ++++---
 sdks/php5/apache-usergrid/README.md                          | 2 +-
 sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php | 2 +-
 sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php      | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e57f8535/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --cc sdks/php5/apache-usergrid/Examples/collections/users.php
index eb99fdd,a6791d9..f1c529d
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@@ -87,9 -87,9 +87,10 @@@ var_dump($find_user_by_uuid->entities)
  
  // AS all results as PHP Collections and the entities propery is always returned as a PHP Collection you can fetch nested records
  $user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
--echo $user_addr->entities->fetch('adr.addr1');
++echo $user_addr->entities->fetch('adr');
  //or
- echo $user_addr->entities->fetch('adr.street');
++
+ echo $user_addr->entities->fetch('adr.addr1');
  
  // add user to group
  //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);


[03/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/applications.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/applications.json b/sdks/php5/apache-usergrid/src/Manifests/applications.json
new file mode 100644
index 0000000..f747154
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/applications.json
@@ -0,0 +1,1262 @@
+{
+    "basePath": "${basePath}",
+    "swaggerVersion": "1.1-SHAPSHOT.121026",
+    "apiVersion": "0.1",
+    "apis": [
+        {
+            "path": "/apps/{app_name_or_uuid}/token",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_auth_password_get",
+                    "summary": "Get app access token",
+                    "notes": "Get the app access token.  See the OAuth2 specification for details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "grant_type",
+                            "dataType": "string",
+                            "description": "Grant type",
+                            "defaultValue": "password",
+                            "allowableValues": {
+                                "values": [
+                                    "password",
+                                    "client_credentials",
+                                    "refresh_token",
+                                    "authorization_code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_secret",
+                            "dataType": "string",
+                            "description": "Client Secret (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_auth_password_post",
+                    "summary": "Get app access token",
+                    "notes": "Get the app access token.  See the OAuth2 specification for details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "grant_type",
+                            "dataType": "string",
+                            "description": "Grant type",
+                            "defaultValue": "password",
+                            "allowableValues": {
+                                "values": [
+                                    "password",
+                                    "client_credentials",
+                                    "refresh_token",
+                                    "authorization_code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "client_secret",
+                            "dataType": "string",
+                            "description": "Client Secret (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/authorize",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_authorize_get",
+                    "summary": "Authorize app client",
+                    "notes": "Authorize the app client.  See the OAuth2 specification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "response_type",
+                            "dataType": "string",
+                            "description": "Response type",
+                            "defaultValue": "token",
+                            "allowableValues": {
+                                "values": [
+                                    "token",
+                                    "code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "redirect_uri",
+                            "dataType": "string",
+                            "description": "Redirect URI",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "scope",
+                            "dataType": "string",
+                            "description": "Access Token Scope",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "state",
+                            "dataType": "string",
+                            "description": "Client State",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_authorize_post",
+                    "summary": "Authorize app client",
+                    "notes": "Authorize the app client.  See the OAuth2 specification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "response_type",
+                            "dataType": "string",
+                            "description": "Response type",
+                            "defaultValue": "token",
+                            "allowableValues": {
+                                "values": [
+                                    "token",
+                                    "code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "redirect_uri",
+                            "dataType": "string",
+                            "description": "Redirect URI",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "scope",
+                            "dataType": "string",
+                            "description": "Access Token Scope",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "state",
+                            "dataType": "string",
+                            "description": "Client State",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/credentials",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_credentials_get",
+                    "summary": "Get app client credentials",
+                    "notes": "Get the app client credentials.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_credentials_post",
+                    "summary": "Generate app client credentials",
+                    "notes": "Generate new app client credentials.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_user_json_post",
+                    "summary": "Create new app user",
+                    "notes": "Create new app user.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "User to post",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_user_form_post",
+                    "summary": "Create new app user",
+                    "notes": "Create new app user using form post parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "name",
+                            "dataType": "string",
+                            "description": "User Full Name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "User Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "User Password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/resetpw",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_users_reset_password_get",
+                    "summary": "Initiate a user password reset",
+                    "notes": "Initiate a user password reset.  Returns browser-viewable HTML page.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_users_reset_password_form_post",
+                    "summary": "Complete a user password reset",
+                    "notes": "Complete a user password reset.  Handles form POST response.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "User Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_challenge_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Challenge Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_response_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Response Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_user_get",
+                    "summary": "Returns the app user details",
+                    "notes": "Returns the app user details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "app_user_json_put",
+                    "summary": "Updates the app user details",
+                    "notes": "Updates the app user details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "App user details",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/activate",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_user_activate_get",
+                    "summary": "Activates the app user",
+                    "notes": "Activates the app user from link provided in email notification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "token",
+                            "dataType": "string",
+                            "description": "Activation Token (supplied via email)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "confirm",
+                            "dataType": "boolean",
+                            "description": "Send confirmation email",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/reactivate",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_user_reactivate_get",
+                    "summary": "Reactivates the app user",
+                    "notes": "Request app user reactivation.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/feed",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_user_feed_get",
+                    "summary": "Get app user activity feed",
+                    "notes": "Get app user activity feed.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/password",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "app_user_password_json_put",
+                    "summary": "Set app user password",
+                    "notes": "Set app user password.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Old and new password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_user_reset_password_get",
+                    "summary": "Initiate a user password reset",
+                    "notes": "Initiate a user password reset.  Returns browser-viewable HTML page.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_user_reset_password_form_post",
+                    "summary": "Complete a user password reset",
+                    "notes": "Complete a user password reset.  Handles form POST response.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "User username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "recaptcha_challenge_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Challenge Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_response_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Response Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/{collection}",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "app_entity_get",
+                    "summary": "Query an app collection",
+                    "notes": "Query an app collection.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "collection",
+                            "dataType": "string",
+                            "description": "collection name (entity type)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "ql",
+                            "dataType": "string",
+                            "description": "a query in the query language",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "reversed",
+                            "dataType": "boolean",
+                            "description": "return results in reverse order",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "start",
+                            "dataType": "string",
+                            "description": "the first entity UUID to return",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "cursor",
+                            "dataType": "string",
+                            "description": "an encoded representation of the query position for paging",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "limit",
+                            "dataType": "integer",
+                            "description": "an encoded representation of the query position for paging",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "filter",
+                            "dataType": "integer",
+                            "description": "a condition to filter on",
+                            "required": false,
+                            "allowMultiple": true,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "app_entity_json_post",
+                    "summary": "Create new app entity",
+                    "notes": "Create new app entity.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "collection",
+                            "dataType": "string",
+                            "description": "collection name (entity type)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "User to post",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/apps/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}",
+            "description": "Applications",
+            "operations": [
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "app_entity_put",
+                    "summary": "Update an app entity",
+                    "notes": "Update an app entity in a collection.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "collection",
+                            "dataType": "string",
+                            "description": "collection name (entity type)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "entity_name_or_uuid",
+                            "dataType": "string",
+                            "description": "entity name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "User to post",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "DELETE",
+                    "nickname": "app_entity_delete",
+                    "summary": "Delete an app entity",
+                    "notes": "Delete an app entity.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "app name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "collection",
+                            "dataType": "string",
+                            "description": "collection name (entity type)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "entity_name_or_uuid",
+                            "dataType": "string",
+                            "description": "entity name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "models": {
+        "response": {
+            "properties": {
+                "id": {
+                    "type": "long"
+                },
+                "name": {
+                    "type": "string"
+                }
+            },
+            "id": "response"
+        }
+    }
+}
\ No newline at end of file


[08/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Application.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Application.php
new file mode 100644
index 0000000..0054a8c
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Application.php
@@ -0,0 +1,979 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'AuthPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/token',
+        'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get app access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthPasswordPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/token',
+        'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+        'summary' => 'Get app access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'postField',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthorizeGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/authorize',
+        'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+        'summary' => 'Authorize app client',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'response_type' => [
+                'description' => 'Response type',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+                'default' => 'token'
+            ],
+            'redirect_uri' => [
+                'description' => 'Redirect URI',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'scope' => [
+                'description' => 'Access Token Scope.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'state' => [
+                'description' => 'Client State.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'AuthorizePost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/authorize',
+        'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+        'summary' => 'Authorize app client',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'response_type' => [
+                'description' => 'Response type',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+                'default' => 'token'
+            ],
+            'redirect_uri' => [
+                'description' => 'Redirect URI',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'scope' => [
+                'description' => 'Access Token Scope.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'state' => [
+                'description' => 'Client State.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'CredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/credentials',
+        'notes' => 'Get the app client credentials.',
+        'summary' => 'Get app client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'CredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/credentials',
+        'notes' => 'Generate new app client credentials',
+        'summary' => 'Generate app client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users',
+        'notes' => 'Create new app user',
+        'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users',
+        'notes' => 'Create new app user',
+        'summary' => 'Create new app user using form post parameters.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'username' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordRestGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/resetpw',
+        'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'summary' => 'Initiate a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/resetpw',
+        'notes' => 'Complete a user password reset.  Handles form POST response.',
+        'summary' => 'Complete a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'email' => [
+                'description' => 'User Email',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_challenge_field' => [
+                'description' => 'Recaptcha Challenge Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_response_field' => [
+                'description' => 'Recaptcha Response Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'notes' => 'Returns the app user details.',
+        'summary' => 'Returns the app user details',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'notes' => 'Updates the app user details.',
+        'summary' => 'Updates the app user details',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'UserActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/activate',
+        'notes' => 'Activates the app user from link provided in email notification.',
+        'summary' => 'Activates the app user',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'token' => [
+                'description' => 'Activation Token (supplied via email)',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'confirm' => [
+                'description' => 'Send confirmation email',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserReactivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/reactivate',
+        'notes' => 'Request app user reactivation.',
+        'summary' => 'Reactivates the app user',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/feed',
+        'notes' => 'Get app user activity feed.',
+        'summary' => 'Get app user activity feed',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserPasswordJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/password',
+        'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Set app user password',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Old and new password",
+            'location' => 'json'
+        ]
+    ],
+    'UserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+        'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'summary' => 'Initiate a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'UserResetPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+        'notes' => 'Complete a user password reset.  Handles form POST response.',
+        'summary' => 'Complete a user password reset',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'user_username_email_or_uuid' => [
+                'description' => 'User username, email or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_challenge_field' => [
+                'description' => 'Recaptcha Challenge Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'recaptcha_response_field' => [
+                'description' => 'Recaptcha Response Field',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'EntityGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'EntityJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'EntityPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update an app entity in a collection.',
+        'summary' => 'Update an app entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'EntityDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete an app entity.',
+        'summary' => 'Delete an app entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'PostEvents' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Event',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+
+
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
new file mode 100644
index 0000000..91fa18f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+return [
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\BadRequestException',
+		'code'  => 400,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\UnauthorizedException',
+		'code'  => 401,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\RequestFailedException',
+		'code'  => 402,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\NotFoundException',
+		'code'  => 404,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'code'  => 500,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'code'  => 502,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'code'  => 503,
+	],
+
+	[
+		'class' => ' Apache\Usergrid\Api\Exception\ServerErrorException',
+		'code'  => 504,
+	],
+
+];

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Management.php
new file mode 100644
index 0000000..e59154d
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Management.php
@@ -0,0 +1,1076 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'AuthPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/token',
+        'summary' => 'Get management access token',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'grant_type' => [
+                'description' => 'Grant type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'password',
+                'required' => true,
+            ],
+            'username' => [
+                'description' => 'Username (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'password' => [
+                'description' => 'Password (for grant_type=password).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_id' => [
+                'description' => 'Client ID (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'client_secret' => [
+                'description' => 'Client Secret (for grant_type=client_credentials).',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ]
+    ],
+    'AuthorizeGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/authorize',
+        'summary' => 'Authorize the client.  See the OAuth2 specification.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'response_type' => [
+                'description' => 'Response type.',
+                'location' => 'query',
+                'type' => 'string',
+                'defaultValue' => 'token',
+                'required' => true,
+                'allowableValues' => ['code', 'token']
+            ],
+            'client_id' => [
+                'description' => 'Client ID.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'redirect_uri' => [
+                'description' => 'Redirect URI.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'scope' => [
+                'description' => 'Access Token Scope.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'state' => [
+                'description' => 'Client State.',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ]
+        ]
+
+    ],
+    'OrgJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs',
+        'summary' => 'Create new organization.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'organization' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization Name'
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'OrgGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}',
+        'summary' => 'Find organization by name or UUID',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/activate',
+        'summary' => 'Activates the organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'confirm' => [
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+                'description' => 'Send confirmation email'
+            ]
+
+        ]
+    ],
+    'OrgReactivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/reactivate',
+        'summary' => 'Reactivates the organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+        ]
+    ],
+    'OrgFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/feed',
+        'summary' => 'Get organization activity feed',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgCredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+        'summary' => 'Get organization client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgCredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+        'summary' => 'Generate organization client credentials',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgUsersGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Get admin users for organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgUsersJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Create new admin user for organization using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'OrgUsersFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users',
+        'summary' => 'Create new admin user for organization using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'username' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'OrgUserPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'summary' => 'Adds existing admin users for organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin user username, email, or uuid'
+            ]
+        ]
+    ],
+    'OrgUserDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+        'summary' => 'Remove an admin user from organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin user username, email, or uuid'
+            ]
+        ]
+    ],
+    'OrgAppsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Get apps for organization',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppsJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Create new application for organization using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application Name'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'OrgAppsFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+        'summary' => 'Create new application for organization using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application Name'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'OrgAppDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}',
+        'summary' => 'Delete an application in an organization.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Application',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppCredentialsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+        'summary' => 'Get application keys.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgAppCredentialsPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+        'summary' => 'Generate application keys.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'app_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Application name or uuid'
+            ]
+        ]
+    ],
+    'OrgUserJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users',
+        'summary' => 'Create new admin user.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'username' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'OrgUserFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users',
+        'summary' => 'Create new admin using form post parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'username' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Username'
+            ],
+            'name' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Name'
+            ],
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'password' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Password'
+            ]
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+
+    ],
+    'OrgUserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/resetpw',
+        'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+    ],
+    'OrgUserResetPasswordFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/resetpw',
+        'summary' => 'Complete a user password reset.  Handles form POST response.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'email' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin Email'
+            ],
+            'recaptcha_challenge_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Challenge Field'
+            ],
+            'recaptcha_response_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Response Field'
+            ],
+        ]
+    ],
+    'AdminUserGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}',
+        'summary' => 'Returns the admin user details',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+        ]
+
+    ],
+    'AdminUserJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}',
+        'summary' => 'Updates the admin user details.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+
+    ],
+    'AdminUserActivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/activate',
+        'summary' => 'Activates the admin user from link provided in email notification.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'confirm' => [
+                'location' => 'uri',
+                'type' => 'boolean',
+                'required' => false,
+                'description' => 'Send confirmation email'
+            ],
+        ]
+    ],
+    'AdminUserReactivateGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/reactivate',
+        'summary' => 'Request admin user reactivation.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ]
+        ]
+    ],
+    'AdminUserFeedGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/feed',
+        'summary' => 'Get admin user activity feed.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+        ]
+    ],
+    'AdminUserPasswordJsonPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}/password',
+        'summary' => 'Set admin user password.  See Usergrid documentation for JSON format of body.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'old_password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Old and new password'
+            ],
+            'new_password' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Old and new password'
+            ],
+        ]
+    ],
+    'AdminUserResetPasswordGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+        'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ]
+        ]
+    ],
+    'AdminUserResetPasswordFormPost' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+        'summary' => 'Complete a user password reset.  Handles form POST response.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'recaptcha_challenge_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Challenge Field'
+            ],
+            'recaptcha_response_field' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Recaptcha Response Field'
+            ]
+        ]
+    ],
+    'AdminUserOrgsGet' => [
+        'httpMethod' => 'GET',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Get organizations for admin user.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ]
+    ],
+    'AdminUserOrgsJsonPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Create new organization for admin user using JSON payload.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'organization' => [
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserOrgsFormPost' => [
+        'httpMethod' => 'POST',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+        'summary' => 'Create new organization for admin user using form parameters.',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Organization',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'organization' => [
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'postField'
+        ]
+    ],
+    'AdminUserOrgPut' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+        'summary' => 'Add admin users to organization.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+
+        ],
+        'additionalParameters' => [
+            'location' => 'json'
+        ]
+    ],
+    'AdminUserOrgDelete' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+        'summary' => 'Remove an admin user from organization.',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'location' => 'query',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'The OAuth2 access token'
+            ],
+            'user_username_email_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Admin username, email or uuid'
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+
+        ]
+    ]
+
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Manifest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Manifest.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Manifest.php
new file mode 100644
index 0000000..0a16a62
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Manifest.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'name' => 'Usergrid',
+    'apiVersion' => '1.0.0',
+    // 'baseUrl' => 'http://localhost:8080',
+    'baseUrl' => $baseURL,
+    'description' => 'Client to Usergrid application service',
+    'operations' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Notification.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Notification.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Notification.php
new file mode 100644
index 0000000..0606eb2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Notification.php
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+    'ToGroup' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
+        'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'group' => [
+                'description' => 'group name',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+
+        ]
+    ],
+    'ToDevice' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
+        'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'device_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'device name or uuid'
+            ],
+
+        ]
+    ],
+    'ToDevices' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
+        'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'ToUser' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
+        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'object',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'User name or uuid'
+            ],
+        ]
+    ]
+];
\ No newline at end of file


[29/45] incubator-usergrid git commit: Started on better examples and added to read me that the responses returned from Api calls are PHP Collections so they have all collection methods get(), hasKey(), hasValue(), fetch(), map(), merge(), splice(), etc.

Posted by ro...@apache.org.
Started on better examples and added to read me that the responses returned from Api calls are PHP Collections so they have all collection methods get(), hasKey(), hasValue(), fetch(), map(), merge(), splice(), etc. so not to mistake Usergrid collection (db table) with response collection which are all subclasses of the BaseCollection class.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ba63705d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ba63705d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ba63705d

Branch: refs/heads/master
Commit: ba63705d36311547ca9d655b1f6a7d979379cb4a
Parents: 9f25f36
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Sun Nov 2 18:07:05 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Sun Nov 2 18:07:05 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php              | 124 ++++++++++
 .../Examples/collections/data.php               |  38 +++
 .../Examples/collections/users.php              |  65 +++++
 sdks/php5/apache-usergrid/Examples/examples.php | 244 +++++++++++++++++++
 sdks/php5/apache-usergrid/README.md             |   6 +-
 sdks/php5/apache-usergrid/examples.php          | 244 -------------------
 .../src/Api/Models/GuzzleCommandTrait.php       |   2 +-
 7 files changed, 477 insertions(+), 246 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
new file mode 100644
index 0000000..83bc884
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -0,0 +1,124 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+/** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+//foreach($books_data as $book){
+//    Usergrid::application()->EntityJsonPost($book);
+//}
+
+
+$books = Usergrid::application()->EntityGet(['collection' => 'books', 'limit' => 25]);
+
+
+// get result count just call the Illuminate\Support\Collection  count method
+var_dump($books->count());
+
+
+// As responses are model object you can treat them like a assoc arrays
+var_dump($books[0]['uuid']);
+
+// if you like a more object orientated way then use the Collection Class methods
+
+// get all uuid
+var_dump($books->fetch('uuid'));
+
+// get first item in collection -- this is the first item in my response php collection not the Usergrid Collection (table).
+var_dump($books->first());
+
+// get last item in collection -- this is the last item in my response php collection not the Usergrid Collection (table).
+var_dump($books->last());
+
+
+
+// Illuminate\Support\Collection class support all advanced collection methods
+
+// pop last item off collection
+$book = $books->pop();
+
+// Converting methods
+$json_ = $books->toJson();
+
+//Convert the object into something JSON serializable.
+$books->jsonSerialize();
+
+// Get an iterator for the items in collection
+$iterator = $books->getIterator();
+
+
+
+/// Here are some more Methods that you can call on your responses .. To get the most out of this SDK please look at the Illuminate\Support\Collection class
+/// which is the supper class of Apache/Usergrid/Api/Models/BaseCollection class
+/**
+    $books->unique();
+    $books->transform();
+    $books->take();
+    $books->splice();
+    $books->sum($callback );
+    $books->values();
+    $books->sortByDesc($callback);
+    $books->sortBy();
+    $books->shuffle();
+    $books->chunk();
+ */
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/Examples/collections/data.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/data.php b/sdks/php5/apache-usergrid/Examples/collections/data.php
new file mode 100644
index 0000000..a926dbe
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/collections/data.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$books_data = [
+['collection' => 'books', 'title' => 'book one', 'name' => 'book_one', 'author' => 'author 1'],
+['collection' => 'books', 'title' => 'book two', 'name' => 'book_two', 'author' => 'author 2'],
+['collection' => 'books', 'title' => 'book three', 'name' => 'book_three', 'author' => 'author 3'],
+['collection' => 'books', 'title' => 'book four', 'name' => 'book_four', 'author' => 'author 4'],
+['collection' => 'books', 'title' => 'book five', 'name' => 'book_five', 'author' => 'author 5'],
+['collection' => 'books', 'title' => 'book six', 'name' => 'book_six', 'author' => 'author 6'],
+['collection' => 'books', 'title' => 'book seven', 'name' => 'book_seven', 'author' => 'author 7'],
+['collection' => 'books', 'title' => 'book eight', 'name' => 'book_eight', 'author' => 'author 8'],
+['collection' => 'books', 'title' => 'book nine', 'name' => 'book_nine', 'author' => 'author 9'],
+['collection' => 'books', 'title' => 'book ten', 'name' => 'book_ten', 'author' => 'author 10'],
+['collection' => 'books', 'title' => 'book eleven', 'name' => 'book_eleven', 'author' => 'author 11'],
+['collection' => 'books', 'title' => 'book twelve', 'name' => 'book_twelve', 'author' => 'author 12'],
+['collection' => 'books', 'title' => 'book thirteen', 'name' => 'book_thirteen', 'author' => 'author 13'],
+['collection' => 'books', 'title' => 'book fourteen', 'name' => 'book_fourteen', 'author' => 'author 14'],
+['collection' => 'books', 'title' => 'book fifteen', 'name' => 'book_fifteen', 'author' => 'author 15'],
+['collection' => 'books', 'title' => 'book sixteen', 'name' => 'book_sixteen', 'author' => 'author 16'],
+['collection' => 'books', 'title' => 'book seventeen', 'name' => 'book_seventeen', 'author' => 'author 17'],
+['collection' => 'books', 'title' => 'book eighteen', 'name' => 'book_eighteen', 'author' => 'author 18'],
+['collection' => 'books', 'title' => 'book nineteen', 'name' => 'book_nineteen', 'author' => 'author 19'],
+['collection' => 'books', 'title' => 'book twenty', 'name' => 'book_twenty', 'author' => 'author 20'],
+];

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
new file mode 100644
index 0000000..a789631
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+/** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/Examples/examples.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/examples.php b/sdks/php5/apache-usergrid/Examples/examples.php
new file mode 100644
index 0000000..f139808
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/examples.php
@@ -0,0 +1,244 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+include('vendor/autoload.php');
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => './src/Manifests', //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'application',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'password',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+/** Usergrid Facades Off */
+
+//call the bootstrap class that will create the api client then get the usergrid instance from the bootstrapper
+$bootstrapper = new UsergridBootstrapper($config);
+$usergrid = $bootstrapper->createUsergrid();
+
+/** Note: I'm using Users for the first lot of example's but you could do the same for all default collections eg: groups, devices, roles, notification etc*/
+
+//find users with query
+$user = $usergrid->users()->find(['ql' => 'select * where activated=true']);
+
+//var_dump($user->first());
+
+//request that throw exception in this case 404 not found
+try {
+
+    $user2 = $usergrid->users()->findById(['uuid' => 'uuid-number']);
+//    var_dump($user2->get('entities'));
+} catch (Apache\Usergrid\Api\Exception\NotFoundException $e) {
+
+//    var_dump($e->getResponse());
+}
+/**
+ * There a errors for all Usergrid response errors and http errors so you can create a catch all error class or plug it into your fav php frameworks error handling.
+ * Apache\Usergrid\Api\Exception\BadRequestException = http 400
+ * Apache\Usergrid\Api\Exception\UnauthorizedException = http 401
+ * Apache\Usergrid\Api\Exception\RequestFailedException = http 402
+ * Apache\Usergrid\Api\Exception\NotFoundException = http 404
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 500
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 502
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 503
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 504
+ */
+
+// collection Iterators no need to keep calling request with a cursor to get all entities in a collection
+// UserIterator(), DeviceIterator() GroupsIterator() , RolesIterator() etc.
+$user_iterator = $usergrid->usersIterator();
+
+foreach ($user_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$new_user = ['name' => 'jasonk', 'username' => 'JasonK', 'email' => 'jason@example.com', 'password' => 'some_password'];
+//$created_user = $usergrid->users()->create($new_user);
+//var_dump($created_user);
+
+//Update Users by name or uuid
+$new_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$updated_user = $usergrid->users()->update($new_email);
+//var_dump($updated_user);
+
+// delete a user
+//$deleted_user = $usergrid->users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($deleted_user);
+
+//get custom collection
+$custom_collection = $usergrid->application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->get('entities'));
+
+//get custom collection with query
+$custom_collection_query = $usergrid->application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('entities'));
+
+// Post custom collection as JSON data
+$custom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+//$created_entity = $usergrid->application()->EntityJsonPost($custom_entity);
+//var_dump($created_entity);
+
+// update custom Entity
+$custom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => '918a044a-618a-11e4-8c11-253e9c3723a9',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$edited_entity = $usergrid->application()->EntityPut($custom_entity_edit);
+
+
+/** Usergrid Facades On */
+
+//create a bootstrap instance and then call the static instance method on the Usergrid facade
+$bootstrapper2 = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper2);
+
+
+// find users with query
+$fUser = Usergrid::users()->find(['ql' => 'select * where activated=true']);
+
+$fUser_iterator = Usergrid::usersIterator();
+
+foreach ($fUser_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$fNew_user = [
+    'name' => 'jasonk',
+    'username' => 'JasonK2',
+    'email' => 'jaso2n@example.com',
+    'password' => 'some_password'
+];
+$fCreated_user = Usergrid::users()->create($fNew_user);
+//var_dump($fCreated_user);
+
+//Update Users by name or uuid
+$fNew_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$fUpdated_user = Usergrid::users()->update($fNew_email);
+//var_dump($fUpdated_user);
+
+// delete a user
+$fDeleted_user = Usergrid::users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($fDeleted_user);
+
+//get custom collection
+$fCustom_collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->get('entities'));
+
+//get custom collection with query
+$fCustom_collection_query = Usergrid::application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('entities'));
+
+// Post custom collection as JSON data
+$fCustom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name3',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+$fCreated_entity = Usergrid::applictions()->EntityJsonPost($custom_entity);
+//var_dump($fCreated_entity);
+
+// update entity
+$fCustom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => 'shop_name2',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$fEdited_entity = Usergrid::applications()->EntityPut($fCustom_entity_edit);
+//var_dump($fEdited_entity);
+
+
+
+/** Relationships */
+$related_data =[
+    'collection' => 'required',
+    'entity_id' => 'required',
+    'relationship' => 'required',
+    'ql' => 'optional'
+];
+$get_relationship = Usergrid::application()->GetRelationship($related_data);
+
+
+$create_relationship_data = [
+    'collection' => 'required',
+    'first_entity_id' => 'required',
+    'relationship' => 'required',
+    'second_entity_id' => 'required'
+];
+$new_relationship = Usergrid::application()->CreateRelationship($create_relationship_data);
+
+
+/** Groups  */
+
+//add user to group
+$fAdd_user_to_group_data = [
+    'entity_name_or_uuid' => 'group_name',
+    'user_name_or_uuid' => 'username'
+];
+$fAdded_user_to_group = Usergrid::groups()->addUser($fAdd_user_to_group_data);
+
+//delete user from group
+$fDeleted_user_from_group = Usergrid::groups()->deleteUser($fAdd_user_to_group_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index f4787d4..61e8869 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -92,7 +92,10 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
  and they are cached by the Usergrid web service client. Calls on the Usergrid client are like magic method in the sense that ```php Usergrid::Management()-> method``` call is not
  backed by a Management class or method its the Manifest that it being selected . Also by using Facades all method are like static method and fit in with newer PHP frameworks just like using the
  AWS PHP SDK when calling enableFacades() on the AWS factory method.
- 
+  
+ All responses are subclasses of Illuminate\Support\Collection class so all collection methods are available to call on your response model eg: first(), get(), map(), fetch(), hasKey(), hasValue(), etc.
+ this is not to mistake this with a Usergrid collection which is like your DB table they too are collection object but if you get a response of a single entiry then its a Collection with a count of 1.
+  
 ### Error Handling ### 
 All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
 
@@ -144,6 +147,7 @@ foreach($allDevices as $device) {
 // this will have all devices. 
 }
 ```
+
 ### HTTP headers and UserAgents ###
  When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
  can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/examples.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/examples.php b/sdks/php5/apache-usergrid/examples.php
deleted file mode 100644
index f139808..0000000
--- a/sdks/php5/apache-usergrid/examples.php
+++ /dev/null
@@ -1,244 +0,0 @@
-<?php
-/**
- * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-include('vendor/autoload.php');
-
-
-use Apache\Usergrid\Native\UsergridBootstrapper;
-use Apache\Usergrid\Native\Facades\Usergrid;
-
-/** Source your config from file I'm using array here just for ease of use.
- * When using Laravel Framework publish the package config file when using with
- * other modern PHP frameworks just use their default config system .
- */
-$config = [
-    'usergrid' => [
-        'url' => 'https://api.usergrid.com',
-        'version' => '1.0.1', // set manifest version
-        'orgName' => '',
-        'appName' => '',
-        'manifestPath' => './src/Manifests', //leave as default or change to your own custom folder
-        'clientId' => '',
-        'clientSecret' => '',
-        'username' => '',
-        'password' => '',
-        /**
-         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
-         * Token from.  You have two options here one is 'application' the other is 'organization'
-         *
-         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
-         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
-         */
-        'auth_type' => 'application',
-        /** The Grant Type to use
-         *
-         * This has to be set to one of the 2 grant types that Apache Usergrid
-         * supports which at the moment is client_credentials or password but at
-         * 2 level organization or application
-         */
-        'grant_type' => 'password',
-        /**
-         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
-         * */
-        'enable_oauth2_plugin' => true
-    ]
-];
-
-/** Usergrid Facades Off */
-
-//call the bootstrap class that will create the api client then get the usergrid instance from the bootstrapper
-$bootstrapper = new UsergridBootstrapper($config);
-$usergrid = $bootstrapper->createUsergrid();
-
-/** Note: I'm using Users for the first lot of example's but you could do the same for all default collections eg: groups, devices, roles, notification etc*/
-
-//find users with query
-$user = $usergrid->users()->find(['ql' => 'select * where activated=true']);
-
-//var_dump($user->first());
-
-//request that throw exception in this case 404 not found
-try {
-
-    $user2 = $usergrid->users()->findById(['uuid' => 'uuid-number']);
-//    var_dump($user2->get('entities'));
-} catch (Apache\Usergrid\Api\Exception\NotFoundException $e) {
-
-//    var_dump($e->getResponse());
-}
-/**
- * There a errors for all Usergrid response errors and http errors so you can create a catch all error class or plug it into your fav php frameworks error handling.
- * Apache\Usergrid\Api\Exception\BadRequestException = http 400
- * Apache\Usergrid\Api\Exception\UnauthorizedException = http 401
- * Apache\Usergrid\Api\Exception\RequestFailedException = http 402
- * Apache\Usergrid\Api\Exception\NotFoundException = http 404
- * Apache\Usergrid\Api\Exception\ServerErrorException = http 500
- * Apache\Usergrid\Api\Exception\ServerErrorException = http 502
- * Apache\Usergrid\Api\Exception\ServerErrorException = http 503
- * Apache\Usergrid\Api\Exception\ServerErrorException = http 504
- */
-
-// collection Iterators no need to keep calling request with a cursor to get all entities in a collection
-// UserIterator(), DeviceIterator() GroupsIterator() , RolesIterator() etc.
-$user_iterator = $usergrid->usersIterator();
-
-foreach ($user_iterator as $iUser) {
-    var_dump($iUser);
-    var_dump("---------------------------------------------------------------------------------");
-}
-
-// create new user
-$new_user = ['name' => 'jasonk', 'username' => 'JasonK', 'email' => 'jason@example.com', 'password' => 'some_password'];
-//$created_user = $usergrid->users()->create($new_user);
-//var_dump($created_user);
-
-//Update Users by name or uuid
-$new_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
-$updated_user = $usergrid->users()->update($new_email);
-//var_dump($updated_user);
-
-// delete a user
-//$deleted_user = $usergrid->users()->delete(['entity_name_or_uuid' => 'benn']);
-//var_dump($deleted_user);
-
-//get custom collection
-$custom_collection = $usergrid->application()->EntityGet(['collection' => 'shops']);
-//var_dump($custom_collection->get('entities'));
-
-//get custom collection with query
-$custom_collection_query = $usergrid->application()->EntityGet([
-    'collection' => 'shops',
-    'ql' => "select * where country='aus'"
-]);
-//var_dump($custom_collection_query->get('entities'));
-
-// Post custom collection as JSON data
-$custom_entity = [
-    'collection' => 'shops',
-    'name' => 'shop_name',
-    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
-    'type' => 'pet_shop'
-];
-//$created_entity = $usergrid->application()->EntityJsonPost($custom_entity);
-//var_dump($created_entity);
-
-// update custom Entity
-$custom_entity_edit = [
-    'collection' => 'shops',
-    'entity_name_or_uuid' => '918a044a-618a-11e4-8c11-253e9c3723a9',
-    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
-];
-$edited_entity = $usergrid->application()->EntityPut($custom_entity_edit);
-
-
-/** Usergrid Facades On */
-
-//create a bootstrap instance and then call the static instance method on the Usergrid facade
-$bootstrapper2 = new UsergridBootstrapper($config);
-Usergrid::instance($bootstrapper2);
-
-
-// find users with query
-$fUser = Usergrid::users()->find(['ql' => 'select * where activated=true']);
-
-$fUser_iterator = Usergrid::usersIterator();
-
-foreach ($fUser_iterator as $iUser) {
-    var_dump($iUser);
-    var_dump("---------------------------------------------------------------------------------");
-}
-
-// create new user
-$fNew_user = [
-    'name' => 'jasonk',
-    'username' => 'JasonK2',
-    'email' => 'jaso2n@example.com',
-    'password' => 'some_password'
-];
-$fCreated_user = Usergrid::users()->create($fNew_user);
-//var_dump($fCreated_user);
-
-//Update Users by name or uuid
-$fNew_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
-$fUpdated_user = Usergrid::users()->update($fNew_email);
-//var_dump($fUpdated_user);
-
-// delete a user
-$fDeleted_user = Usergrid::users()->delete(['entity_name_or_uuid' => 'benn']);
-//var_dump($fDeleted_user);
-
-//get custom collection
-$fCustom_collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
-//var_dump($custom_collection->get('entities'));
-
-//get custom collection with query
-$fCustom_collection_query = Usergrid::application()->EntityGet([
-    'collection' => 'shops',
-    'ql' => "select * where country='aus'"
-]);
-//var_dump($custom_collection_query->get('entities'));
-
-// Post custom collection as JSON data
-$fCustom_entity = [
-    'collection' => 'shops',
-    'name' => 'shop_name3',
-    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
-    'type' => 'pet_shop'
-];
-$fCreated_entity = Usergrid::applictions()->EntityJsonPost($custom_entity);
-//var_dump($fCreated_entity);
-
-// update entity
-$fCustom_entity_edit = [
-    'collection' => 'shops',
-    'entity_name_or_uuid' => 'shop_name2',
-    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
-];
-$fEdited_entity = Usergrid::applications()->EntityPut($fCustom_entity_edit);
-//var_dump($fEdited_entity);
-
-
-
-/** Relationships */
-$related_data =[
-    'collection' => 'required',
-    'entity_id' => 'required',
-    'relationship' => 'required',
-    'ql' => 'optional'
-];
-$get_relationship = Usergrid::application()->GetRelationship($related_data);
-
-
-$create_relationship_data = [
-    'collection' => 'required',
-    'first_entity_id' => 'required',
-    'relationship' => 'required',
-    'second_entity_id' => 'required'
-];
-$new_relationship = Usergrid::application()->CreateRelationship($create_relationship_data);
-
-
-/** Groups  */
-
-//add user to group
-$fAdd_user_to_group_data = [
-    'entity_name_or_uuid' => 'group_name',
-    'user_name_or_uuid' => 'username'
-];
-$fAdded_user_to_group = Usergrid::groups()->addUser($fAdd_user_to_group_data);
-
-//delete user from group
-$fDeleted_user_from_group = Usergrid::groups()->deleteUser($fAdd_user_to_group_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba63705d/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
index f8bd6fa..5a6c57a 100644
--- a/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
+++ b/sdks/php5/apache-usergrid/src/Api/Models/GuzzleCommandTrait.php
@@ -39,7 +39,7 @@ trait GuzzleCommandTrait
     public static function fromCommand(OperationCommand $command)
     {
         // Initialize the collection
-        $collection = new self($command->getResponse()->json());
+        $collection = new self($command->getResponse()->json()['entities']);
 
         // Set the Usergrid API client on the collection
         $collection->setApiClient($command->getClient()->getApiClient());


[41/45] incubator-usergrid git commit: update read me for resource iterators , resource iterators as lazy loaded.

Posted by ro...@apache.org.
update read me for resource iterators , resource iterators as lazy loaded.

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/08ad23a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/08ad23a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/08ad23a0

Branch: refs/heads/master
Commit: 08ad23a0e0d0c2f1559b1983dbd85c84b865e5a8
Parents: 60b1c6c
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Nov 10 14:02:07 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Nov 10 14:02:07 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/README.md | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08ad23a0/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index 66adf00..cd22247 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -137,9 +137,7 @@ the ```'auth_type' => 'application' ``` controls the level you get Organization
 which type of credentials you use which can be either client_id & client_secret or username & password.
 
 ### Result Iteration
-Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
-a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
-that will return all entities for you in one request. So again let the SDK do the hard work for you.
+Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator that will return all entities for you in one request. So again let the SDK do the hard work for you. Resource Iterators as lazy loaded so they only make the api call if the data is needed for example when you first make the call no data is requested from the network but as soon as you dereference the data then the first page is requested and the 2nd page is not requested till you request the data for example if I used it in a foreach loop it will make a network request for the next page of data only after the loop has gone through the current page count and if you cancel the foreach loop then it wont request any more data the default page size is 20 for resou
 rce iterators.
 
 The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
 ```
@@ -189,4 +187,4 @@ of it as a helper as some times it good to have access to both world server side
 * Writing tests
 * Code review
 * Code
-* Manifest files
\ No newline at end of file
+* Manifest files


[35/45] incubator-usergrid git commit: changed the access_token from required True to false as the SDK puts the token in the header on uri

Posted by ro...@apache.org.
changed the access_token from required True to false as the SDK puts the token in the header on uri

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/0f8ffee5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/0f8ffee5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/0f8ffee5

Branch: refs/heads/master
Commit: 0f8ffee5b06c7873b2c3ba933ff42a9082a4a069
Parents: 916c0d2
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sat Nov 8 18:34:08 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sat Nov 8 18:34:08 2014 +1000

----------------------------------------------------------------------
 .../src/Manifests/1.0.1/Management.php          | 58 ++++++++++----------
 1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f8ffee5/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index e59154d..ea7c8ad 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -154,7 +154,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -179,10 +179,10 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
-            'token' => [
+            'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'confirm' => [
@@ -221,7 +221,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -243,7 +243,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -265,7 +265,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -287,7 +287,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -309,7 +309,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -358,7 +358,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -407,7 +407,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -435,7 +435,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -461,10 +461,10 @@ return [
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
+                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
-                'description' => 'The OAuth2 access token'
+                'required' => false,
             ],
             'org_name_or_uuid' => [
                 'location' => 'uri',
@@ -485,7 +485,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -516,7 +516,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -547,7 +547,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -575,7 +575,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -603,7 +603,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -742,7 +742,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -765,7 +765,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -791,7 +791,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -841,7 +841,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
         ]
@@ -863,7 +863,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'old_password' => [
@@ -935,7 +935,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -958,7 +958,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -990,7 +990,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1022,7 +1022,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1054,7 +1054,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1073,4 +1073,4 @@ return [
         ]
     ]
 
-];
\ No newline at end of file
+];


[31/45] incubator-usergrid git commit: updated read me. Updated manifest files to include notifications and messages. Updated tests to add @group annotation to tests that require internet and usergrid install so tests can be excluded when testing without

Posted by ro...@apache.org.
updated read me.
Updated manifest files to include notifications and messages.
Updated tests to add @group annotation to tests that require internet and usergrid install so tests can be excluded when testing without usergrid install.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b86966ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b86966ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b86966ed

Branch: refs/heads/master
Commit: b86966ed29c2ec3ee1e5749992feabcadcce4f16
Parents: 45cf125
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Fri Nov 7 14:26:41 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Fri Nov 7 14:26:41 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php              |  18 +-
 sdks/php5/apache-usergrid/Examples/examples.md  |  17 ++
 sdks/php5/apache-usergrid/Examples/examples.php |  24 +--
 .../Examples/management/management.php          |  91 ++++++++++
 .../apache-usergrid/Examples/messages/data.php  |  17 ++
 .../Examples/messages/messages.php              |  62 +++++++
 .../Examples/notifications/data.php             |  17 ++
 .../Examples/notifications/notifications.php    |  62 +++++++
 sdks/php5/apache-usergrid/README.md             |  41 +++--
 .../src/Manifests/1.0.1/Messages.php            |  19 +++
 .../src/Manifests/1.0.1/Notification.php        | 154 -----------------
 .../src/Manifests/1.0.1/Notifications.php       | 169 ++++++++++++++++++-
 .../apache-usergrid/tests/Api/UsergridTest.php  |   2 +-
 .../apache-usergrid/tests/Api/test_config.php   |   6 +-
 14 files changed, 503 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
index 922b24d..e5dec7b 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/books.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -72,7 +72,7 @@ $books = Usergrid::application()->EntityGet(['collection' => 'books', 'limit' =>
 
 
 // get result count just call the Illuminate\Support\Collection  count method
-var_dump($books->count());
+var_dump($books->entities->count());
 
 
 // As responses are model object you can treat them like a assoc arrays
@@ -81,32 +81,32 @@ var_dump($books[0]['uuid']);
 // if you like a more object orientated way then use the Collection Class methods
 
 // get all uuid
-var_dump($books->fetch('uuid'));
+var_dump($books->entities->fetch('uuid'));
 
 // get first item in collection -- this is the first item in my response php collection not the Usergrid Collection (table).
-var_dump($books->first());
+var_dump($books->entities->first());
 
 // get last item in collection -- this is the last item in my response php collection not the Usergrid Collection (table).
-var_dump($books->last());
+var_dump($books->entities->last());
 
 
 
 // Illuminate\Support\Collection class support all advanced collection methods
 
 // pop last item off collection
-$book = $books->pop();
+$book = $books->entities->pop();
 
 // Converting methods
-$json_ = $books->toJson();
+$json_ = $books->entities->toJson();
 
 //Convert the object into something JSON serializable.
-$books->jsonSerialize();
+$books->entities->jsonSerialize();
 
 // Get an iterator for the items in collection
-$iterator = $books->getIterator();
+$iterator = $books->entities->getIterator();
 
 //Get a CachingIterator instance
-$caching_iterator = $books->getCachingIterator();
+$caching_iterator = $books->entities->getCachingIterator();
 
 /// Here are some more Methods that you can call on your responses .. To get the most out of this SDK please look at the Illuminate\Support\Collection class
 /// which is the supper class of Apache/Usergrid/Api/Models/BaseCollection class

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/examples.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/examples.md b/sdks/php5/apache-usergrid/Examples/examples.md
new file mode 100644
index 0000000..0266743
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/examples.md
@@ -0,0 +1,17 @@
+## Examples Read Me ##
+
+I don't show every method that you can call in the examples but I show you the most common api calls you will make but to get the most out of this api 
+you really should spend around 10 to 15 minutes to read all the guzzle web service descriptors files in the Manifest folders that are versioned the most 
+up to date version is 1.0.1 folder.
+
+### Manifest files ###
+Guzzle web service descriptors.
+
+You can use the files included with the sdk but you are able to create your own , so you can pass the path the the manifest folder in the config to the sdk. 
+The reason you might create you own is to support you own custom collections. So the way to do that is to copy the manifest folder to the location you want
+then there is a file called custom that you need to copy and edit so for example if I had a custom Collection called Books and I want to be able to call
+the sdk like ```Usergrid::books()->findById(['uuid'=> '12121']); ``` . All I have to do is copy the manifest file called custom and name it books and then 
+in the file replace the ```$custom``` with the word ```'books'``` .
+From that point on I can make api calls to my custom collection just like any of the default collection usergrid give you its a easy as that Ive designed this
+SDK to be extened so you can get the most out of your usergrid install .
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/examples.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/examples.php b/sdks/php5/apache-usergrid/Examples/examples.php
index f139808..b896ec7 100644
--- a/sdks/php5/apache-usergrid/Examples/examples.php
+++ b/sdks/php5/apache-usergrid/Examples/examples.php
@@ -65,10 +65,12 @@ $usergrid = $bootstrapper->createUsergrid();
 
 /** Note: I'm using Users for the first lot of example's but you could do the same for all default collections eg: groups, devices, roles, notification etc*/
 
+// All responses are model objects that subclass the baseCollection class so all collection methods are available eg: first(), map(), fetch(), hasValue(), hasKey() etc.
+
 //find users with query
 $user = $usergrid->users()->find(['ql' => 'select * where activated=true']);
 
-//var_dump($user->first());
+//var_dump($user->entities->first());
 
 //request that throw exception in this case 404 not found
 try {
@@ -103,12 +105,12 @@ foreach ($user_iterator as $iUser) {
 // create new user
 $new_user = ['name' => 'jasonk', 'username' => 'JasonK', 'email' => 'jason@example.com', 'password' => 'some_password'];
 //$created_user = $usergrid->users()->create($new_user);
-//var_dump($created_user);
+//var_dump($created_user->entities);
 
 //Update Users by name or uuid
 $new_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
 $updated_user = $usergrid->users()->update($new_email);
-//var_dump($updated_user);
+//var_dump($updated_user->entities);
 
 // delete a user
 //$deleted_user = $usergrid->users()->delete(['entity_name_or_uuid' => 'benn']);
@@ -116,7 +118,7 @@ $updated_user = $usergrid->users()->update($new_email);
 
 //get custom collection
 $custom_collection = $usergrid->application()->EntityGet(['collection' => 'shops']);
-//var_dump($custom_collection->get('entities'));
+//var_dump($custom_collection->entities->get('name'));
 
 //get custom collection with query
 $custom_collection_query = $usergrid->application()->EntityGet([
@@ -133,7 +135,7 @@ $custom_entity = [
     'type' => 'pet_shop'
 ];
 //$created_entity = $usergrid->application()->EntityJsonPost($custom_entity);
-//var_dump($created_entity);
+//var_dump($created_entity->entities);
 
 // update custom Entity
 $custom_entity_edit = [
@@ -169,16 +171,16 @@ $fNew_user = [
     'password' => 'some_password'
 ];
 $fCreated_user = Usergrid::users()->create($fNew_user);
-//var_dump($fCreated_user);
+//var_dump($fCreated_user->entities);
 
 //Update Users by name or uuid
 $fNew_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
 $fUpdated_user = Usergrid::users()->update($fNew_email);
-//var_dump($fUpdated_user);
+//var_dump($fUpdated_user->entities);
 
 // delete a user
 $fDeleted_user = Usergrid::users()->delete(['entity_name_or_uuid' => 'benn']);
-//var_dump($fDeleted_user);
+//var_dump($fDeleted_user->entities);
 
 //get custom collection
 $fCustom_collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
@@ -189,7 +191,7 @@ $fCustom_collection_query = Usergrid::application()->EntityGet([
     'collection' => 'shops',
     'ql' => "select * where country='aus'"
 ]);
-//var_dump($custom_collection_query->get('entities'));
+//var_dump($custom_collection_query->get('name'));
 
 // Post custom collection as JSON data
 $fCustom_entity = [
@@ -199,7 +201,7 @@ $fCustom_entity = [
     'type' => 'pet_shop'
 ];
 $fCreated_entity = Usergrid::applictions()->EntityJsonPost($custom_entity);
-//var_dump($fCreated_entity);
+//var_dump($fCreated_entity->entities);
 
 // update entity
 $fCustom_entity_edit = [
@@ -208,7 +210,7 @@ $fCustom_entity_edit = [
     ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
 ];
 $fEdited_entity = Usergrid::applications()->EntityPut($fCustom_entity_edit);
-//var_dump($fEdited_entity);
+//var_dump($fEdited_entity->entities);
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/management/management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/management/management.php b/sdks/php5/apache-usergrid/Examples/management/management.php
new file mode 100644
index 0000000..5808a6c
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/management/management.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+/**
+ * When working with the management api any calls that require a application to target will use the default app name set in the config but some times you may want to
+ * make a api call to a different application which is possible when the url requires a application name it taken from the config but if you pass in a different application
+ * name in the method arguments it will override the default application name just for that api call so If I wanted to add a user to two application I could make the same call
+ * twice but pass in a application name only for the 2nd call.
+ */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+// Get organization activity
+$activity_feed = Usergrid::management()->OrgFeedGet();
+
+// get org details
+$organization_details = Usergrid::management()->OrgGet();
+
+//get organizations application
+$organization_applications  = Usergrid::management()->OrgAppsGet();
+
+//create application
+$app = ['name' => 'app name -- required'];
+$new_application = Usergrid::management()->OrgAppsJsonPost($app);
+
+// delete application
+$deleted_application = Usergrid::management()->OrgAppDelete($app);
+
+//get irg admin users
+$organization_admin_users = Usergrid::management()->OrgUsersGet();
+
+/** There are many more api calls just look at the management manifest file to get the method name's and arguments to pass .
+ * The management manifest file is a copy of the swagger file for usergrid so you can also run the swagger UI tool on your usergrid install as well.
+ */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/messages/data.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/messages/data.php b/sdks/php5/apache-usergrid/Examples/messages/data.php
new file mode 100644
index 0000000..5d00ec4
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/messages/data.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$message = [];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/messages/messages.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/messages/messages.php b/sdks/php5/apache-usergrid/Examples/messages/messages.php
new file mode 100644
index 0000000..3cac534
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/messages/messages.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/notifications/data.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/data.php b/sdks/php5/apache-usergrid/Examples/notifications/data.php
new file mode 100644
index 0000000..0efdf85
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/notifications/data.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$notification = [];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/notifications.php b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
new file mode 100644
index 0000000..3cac534
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index 61e8869..eb4c730 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -3,6 +3,7 @@
 This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
 
 ## Getting Started ##
+
 install as composer package by adding this to your composer.json file.
 
 ``` 
@@ -23,9 +24,10 @@ import the classes ``` include autoload.php ``` then create a new instance of th
 For native use just create a config file.
 
 ```
-use Apache\Usergrid\UsergridBootstrapper;
+    use Apache\Usergrid\UsergridBootstrapper;
 
-    $config = [    'usergrid' => [
+    $config = [    
+    'usergrid' => [
                        'url' => 'https://api.usergrid.com',
                        'version' => '1.0.0',
                        'orgName' => '',
@@ -53,7 +55,8 @@ use Apache\Usergrid\UsergridBootstrapper;
                         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
                         * */
                        'enable_oauth2_plugin' => true
-                   ]];
+                   ]
+             ];
                    
                    $bootstrap = new UsergridBootstrapper($config);
                    $usergrid = $bootstrap->createUsergrid();
@@ -64,16 +67,16 @@ use Apache\Usergrid\UsergridBootstrapper;
 Or if you like Static Facades
 
 ```
-use Apache\Usergrid\Native\Facades\Usergrid;
-
-$bootstrap = new UsergridBootstrapper($config);
-Usergrid::instance($boostraper);
-$res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+    use Apache\Usergrid\Native\Facades\Usergrid;
+    $bootstrap = new UsergridBootstrapper($config);
+    Usergrid::instance($boostraper);
+    $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
 
 ```
 
 
 ### Laravel ###
+
 In Laravel once you have install the composer package you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
 then add your client_id and secret to the config file the set the service provider in the app/config.php providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
 the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade. Example for Laravel
@@ -92,11 +95,14 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
  and they are cached by the Usergrid web service client. Calls on the Usergrid client are like magic method in the sense that ```php Usergrid::Management()-> method``` call is not
  backed by a Management class or method its the Manifest that it being selected . Also by using Facades all method are like static method and fit in with newer PHP frameworks just like using the
  AWS PHP SDK when calling enableFacades() on the AWS factory method.
-  
+ 
  All responses are subclasses of Illuminate\Support\Collection class so all collection methods are available to call on your response model eg: first(), get(), map(), fetch(), hasKey(), hasValue(), etc.
  this is not to mistake this with a Usergrid collection which is like your DB table they too are collection object but if you get a response of a single entiry then its a Collection with a count of 1.
-  
+ 
+ 
+ 
 ### Error Handling ### 
+
 All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
 
 ```
@@ -109,13 +115,14 @@ try {
 ```
  
 ### Authentication ###
+
   You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api or get the token from elsewhere and then set the token on the usergrid instance.
   By default this will manage Oauth2 flow for you and I recommend that you leave it set to true. But if you want to do it yourself set the config setting to false and then do something like this.
   
 ```
  $res  =  Usergrid::management()->authPasswordGet($array);
  $token = $res->get('access_token');
- Usergrid::setToken($token);
+ Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
  
 ```
  
@@ -147,19 +154,23 @@ foreach($allDevices as $device) {
 // this will have all devices. 
 }
 ```
-
 ### HTTP headers and UserAgents ###
+
  When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
  can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 
  have some customer analytics set up on your version of usergrid server then just pass the headers you like in a fluent way eg:
  ``` Usergrid::setHeaders(['BAAS-PLATFORM-ANALYTICS' => 'user001'])->users()->findById(['uuid' => '12343']); ```
  
+
+
 ## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
+
 All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
 the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.
 Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
 
 ## designs guidelines ##
+
 The design of this is to make it easy to add to existing project and be able to map Model objects in your project 
 to response models for example in my project I have a organization object that is saved in a mysql database and I can
 call a Usergrid Api call on that model object just like using the Usergrid api class eg:
@@ -167,8 +178,12 @@ call a Usergrid Api call on that model object just like using the Usergrid api c
 ``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
 Gateway Objects using php Traits
 
+## PHPUnit Tests ##
+Some unit tests require a internet connection and a usergrid install so they have been marked with a phpunit @group annotation so to run the tests without a usergrid install just pass the ```--exclude-group internet``` as a option on the command line or IDE setting
+that will exclude the few tests that require access to usergrid which I've limited to only a few unit tests like testing if it can get a oauth2 access_token. 
 
 ## Javascript ##
+
 There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
 to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
 the javascript file in your page  It's set to works with Laravel as it posts the token to a route but it would not be hard to use else where just create uri it can post the token too. Its not part of this SDK so think
@@ -180,4 +195,4 @@ of it as a helper as some times it good to have access to both world server side
 * Writing tests
 * Code review
 * Code
-* Manifest files
+* Manifest files
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Messages.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Messages.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Messages.php
new file mode 100644
index 0000000..638ad24
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Messages.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
deleted file mode 100644
index 7f65626..0000000
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notification.php
+++ /dev/null
@@ -1,154 +0,0 @@
-<?php
-/**
- * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-return [
-    'ToGroup' => [
-        'httpMethod' => 'POST',
-        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
-        'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create new app notification',
-        'responseClass' => '',
-        'responseType' => 'model',
-        'errorResponses' => $errors,
-        'parameters' => [
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
-                'location' => 'query',
-                'type' => 'string',
-                'required' => false,
-            ],
-            'app_name_or_uuid' => [
-                'description' => 'app name or uuid',
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-            ],
-            'org_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Organization name or uuid'
-            ],
-            'group' => [
-                'description' => 'group name',
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-            ],
-
-        ]
-    ],
-    'ToDevice' => [
-        'httpMethod' => 'POST',
-        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
-        'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create new app notification',
-        'responseClass' => '',
-        'responseType' => 'model',
-        'errorResponses' => $errors,
-        'parameters' => [
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
-                'location' => 'query',
-                'type' => 'string',
-                'required' => false,
-            ],
-            'app_name_or_uuid' => [
-                'description' => 'app name or uuid',
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-            ],
-            'org_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Organization name or uuid'
-            ],
-            'device_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'device name or uuid'
-            ],
-
-        ]
-    ],
-    'ToDevices' => [
-        'httpMethod' => 'POST',
-        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
-        'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create new app notification',
-        'responseClass' => '',
-        'responseType' => 'model',
-        'errorResponses' => $errors,
-        'parameters' => [
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
-                'location' => 'query',
-                'type' => 'string',
-                'required' => false,
-            ],
-            'app_name_or_uuid' => [
-                'description' => 'app name or uuid',
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-            ],
-            'org_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Organization name or uuid'
-            ]
-        ]
-    ],
-    'ToUser' => [
-        'httpMethod' => 'POST',
-        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
-        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
-        'summary' => 'Create new app notification',
-        'responseClass' => '',
-        'responseType' => 'model',
-        'errorResponses' => $errors,
-        'parameters' => [
-            'access_token' => [
-                'description' => 'The OAuth2 access token',
-                'location' => 'query',
-                'type' => 'string',
-                'required' => false,
-            ],
-            'app_name_or_uuid' => [
-                'description' => 'app name or uuid',
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-            ],
-            'org_name_or_uuid' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'Organization name or uuid'
-            ],
-            'user_name' => [
-                'location' => 'uri',
-                'type' => 'string',
-                'required' => true,
-                'description' => 'User name or uuid'
-            ],
-        ]
-    ]
-];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
index a51055f..18c754d 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
@@ -15,10 +15,169 @@
  */
 
 return [
+    'ToGroup' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
+        'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'group' => [
+                'description' => 'group name',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
 
-    'all' => [],
-    'find' => [],
-    'create' => [],
-    'destroy' => [],
-    'update' => []
+        ]
+    ],
+    'ToGroups' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/*/notifications',
+        'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+        ]
+    ],
+    'ToDevice' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
+        'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'device_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'device name or uuid'
+            ],
+
+        ]
+    ],
+    'ToDevices' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
+        'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'ToUser' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
+        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'User name or uuid'
+            ],
+        ]
+    ]
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
index 5fab892..ab68633 100644
--- a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
@@ -95,7 +95,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     public function it_can_retrieve_the_manifest_path()
     {
 
-        $this->assertEquals('/Users/admin/PhpstormProjects/Apache-Usergrid/src/Manifests', $this->usergrid->getManifestPath());
+        $this->assertEquals('./src/Manifests', $this->usergrid->getManifestPath());
     }
 
     /** @test */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b86966ed/sdks/php5/apache-usergrid/tests/Api/test_config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/test_config.php b/sdks/php5/apache-usergrid/tests/Api/test_config.php
index da46e40..0959405 100644
--- a/sdks/php5/apache-usergrid/tests/Api/test_config.php
+++ b/sdks/php5/apache-usergrid/tests/Api/test_config.php
@@ -20,13 +20,13 @@ return [
 
         'url' => 'https://api.usergrid.com',
 
-        'version' => '1.0.1',
+        'version' => '1.0.0',
 
         'orgName' => "",
 
         'appName' => "",
 
-        'manifestPath' => null,
+        'manifestPath' => './src/Manifests',
 
         //its better not to set the real values here if using laravel set them in a .env file or
         // if your not using Laravel set them as environment variable and include them here using $_ENV global.
@@ -62,4 +62,4 @@ return [
          * */
         'enable_oauth2_plugin' => true
     ]
-];
+];
\ No newline at end of file


[06/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/Application.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/Application.php b/sdks/php5/apache-usergrid/src/Manifests/Application.php
new file mode 100644
index 0000000..06dc86c
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/Application.php
@@ -0,0 +1,985 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'name' => 'Application',
+    'apiVersion' => '1.1',
+    'baseUrl' => 'http://baas-platform.com',
+    'description' => 'Client to Usergrid application service',
+    'operations' => [
+        'AuthPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/token',
+            'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+            'summary' => 'Get app access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthPasswordPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/token',
+            'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+            'summary' => 'Get app access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizeGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/authorize',
+            'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+            'summary' => 'Authorize app client',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'response_type' => [
+                    'description' => 'Response type',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                    'default' => 'token'
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizePost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/authorize',
+            'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+            'summary' => 'Authorize app client',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'response_type' => [
+                    'description' => 'Response type',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                    'default' => 'token'
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'CredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/credentials',
+            'notes' => 'Get the app client credentials.',
+            'summary' => 'Get app client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'CredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/credentials',
+            'notes' => 'Generate new app client credentials',
+            'summary' => 'Generate app client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'UserJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users',
+            'notes' => 'Create new app user',
+            'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ]
+        ],
+        'UserFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users',
+            'notes' => 'Create new app user',
+            'summary' => 'Create new app user using form post parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ]
+        ],
+        'UserPasswordRestGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/resetpw',
+            'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'summary' => 'Initiate a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users/resetpw',
+            'notes' => 'Complete a user password reset.  Handles form POST response.',
+            'summary' => 'Complete a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'email' => [
+                    'description' => 'User Email',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_challenge_field' => [
+                    'description' => 'Recaptcha Challenge Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_response_field' => [
+                    'description' => 'Recaptcha Response Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'notes' => 'Returns the app user details.',
+            'summary' => 'Returns the app user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'notes' => 'Updates the app user details.',
+            'summary' => 'Updates the app user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'UserActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/activate',
+            'notes' => 'Activates the app user from link provided in email notification.',
+            'summary' => 'Activates the app user',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'token' => [
+                    'description' => 'Activation Token (supplied via email)',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'confirm' => [
+                    'description' => 'Send confirmation email',
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => true,
+                ],
+            ]
+        ],
+        'UserReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/reactivate',
+            'notes' => 'Request app user reactivation.',
+            'summary' => 'Reactivates the app user',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/feed',
+            'notes' => 'Get app user activity feed.',
+            'summary' => 'Get app user activity feed',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserPasswordJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/password',
+            'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
+            'summary' => 'Set app user password',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Old and new password",
+                'location' => 'json'
+            ]
+        ],
+        'UserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+            'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'summary' => 'Initiate a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserResetPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+            'notes' => 'Complete a user password reset.  Handles form POST response.',
+            'summary' => 'Complete a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_challenge_field' => [
+                    'description' => 'Recaptcha Challenge Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_response_field' => [
+                    'description' => 'Recaptcha Response Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'EntityGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}',
+            'notes' => 'Query an app collection.',
+            'summary' => 'Query an app collection',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'ql' => [
+                    'description' => 'a query in the query language',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'reversed' => [
+                    'description' => 'return results in reverse order',
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => false,
+                ],
+                'start' => [
+                    'description' => 'the first entity UUID to return',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'cursor' => [
+                    'description' => 'an encoded representation of the query position for paging',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'limit' => [
+                    'description' => 'an encoded representation of the query position for paging',
+                    'location' => 'query',
+                    'type' => 'integer',
+                    'required' => false,
+                ],
+                'filter' => [
+                    'description' => 'a condition to filter on',
+                    'location' => 'query',
+                    'type' => 'integer',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'EntityJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}',
+            'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+            'summary' => 'Create new app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Entity data",
+                'location' => 'json'
+            ]
+        ],
+        'EntityPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+            'notes' => 'Update an app entity in a collection.',
+            'summary' => 'Update an app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'entity_name_or_uuid' => [
+                    'description' => 'entity name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Entity data",
+                'location' => 'json'
+            ]
+        ],
+        'EntityDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+            'notes' => 'Delete an app entity.',
+            'summary' => 'Delete an app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'entity_name_or_uuid' => [
+                    'description' => 'entity name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+
+    ]
+];
\ No newline at end of file


[02/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/management.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/management.json b/sdks/php5/apache-usergrid/src/Manifests/management.json
new file mode 100644
index 0000000..f90e588
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/management.json
@@ -0,0 +1,1905 @@
+{
+    "basePath": "${basePath}",
+    "swaggerVersion": "1.1-SHAPSHOT.121026",
+    "apiVersion": "0.1",
+    "apis": [
+        {
+            "path": "/management/token",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_auth_password_get",
+                    "summary": "Get management access token",
+                    "notes": "Get the management access token.  See the OAuth2 specification for details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "grant_type",
+                            "dataType": "string",
+                            "description": "Grant type",
+                            "defaultValue": "password",
+                            "allowableValues": {
+                                "values": [
+                                    "password",
+                                    "client_credentials",
+                                    "refresh_token",
+                                    "authorization_code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_secret",
+                            "dataType": "string",
+                            "description": "Client Secret (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_auth_password_post",
+                    "summary": "Get management access token",
+                    "notes": "Get the management access token.  See the OAuth2 specification for details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "grant_type",
+                            "dataType": "string",
+                            "description": "Grant type",
+                            "defaultValue": "password",
+                            "allowableValues": {
+                                "values": [
+                                    "password",
+                                    "client_credentials",
+                                    "refresh_token",
+                                    "authorization_code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password (for grant_type=password)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "client_secret",
+                            "dataType": "string",
+                            "description": "Client Secret (for grant_type=client_credentials)",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/authorize",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_authorize_get",
+                    "summary": "Authorize client",
+                    "notes": "Authorize the client.  See the OAuth2 specification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "response_type",
+                            "dataType": "string",
+                            "description": "Response type",
+                            "defaultValue": "token",
+                            "allowableValues": {
+                                "values": [
+                                    "token",
+                                    "code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "redirect_uri",
+                            "dataType": "string",
+                            "description": "Redirect URI",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "scope",
+                            "dataType": "string",
+                            "description": "Access Token Scope",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "state",
+                            "dataType": "string",
+                            "description": "Client State",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_authorize_post",
+                    "summary": "Authorize client",
+                    "notes": "Authorize the client.  See the OAuth2 specification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "response_type",
+                            "dataType": "string",
+                            "description": "Response type",
+                            "defaultValue": "token",
+                            "allowableValues": {
+                                "values": [
+                                    "token",
+                                    "code"
+                                ],
+                                "valueType": "LIST"
+                            },
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "client_id",
+                            "dataType": "string",
+                            "description": "Client ID",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "redirect_uri",
+                            "dataType": "string",
+                            "description": "Redirect URI",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "scope",
+                            "dataType": "string",
+                            "description": "Access Token Scope",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "state",
+                            "dataType": "string",
+                            "description": "Client State",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Username",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Password",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_json_post",
+                    "summary": "Create new organization",
+                    "notes": "Create new organization.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Organization to post",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_form_post",
+                    "summary": "Create new organization",
+                    "notes": "Create new organization using form post parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "organization",
+                            "dataType": "string",
+                            "description": "Organization",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Admin Username",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "name",
+                            "dataType": "string",
+                            "description": "Admin Name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "Admin Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Admin Password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_get",
+                    "summary": "Find organization by name or UUID",
+                    "notes": "Returns the organization details",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/activate",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_activate_get",
+                    "summary": "Activates the organization",
+                    "notes": "Activates the organization from link provided in email notification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "token",
+                            "dataType": "string",
+                            "description": "Activation Token (supplied via email)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "confirm",
+                            "dataType": "boolean",
+                            "description": "Send confirmation email",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/reactivate",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_reactivate_get",
+                    "summary": "Reactivates the organization",
+                    "notes": "Request organization reactivation.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/feed",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_feed_get",
+                    "summary": "Get organization activity feed",
+                    "notes": "Get organization activity feed.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/credentials",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_credentials_get",
+                    "summary": "Get organization client credentials",
+                    "notes": "Get the organization client credentials.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_credentials_post",
+                    "summary": "Generate organization client credentials",
+                    "notes": "Generate new organization client credentials.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/users",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_users_get",
+                    "summary": "Get admin users for organization",
+                    "notes": "Get admin users for organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_users_json_post",
+                    "summary": "Create new admin user for organization",
+                    "notes": "Create new admin user for organization using JSON payload.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Admin user to create",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_users_form_post",
+                    "summary": "Create new admin user for organization",
+                    "notes": "Create new admin user for organization using form parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Admin Username",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "name",
+                            "dataType": "string",
+                            "description": "Admin Name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "Admin Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Admin Password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "mgt_org_user_put",
+                    "summary": "Add admin users to organization",
+                    "notes": "Adds existing admin users for organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin user username, email, or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "DELETE",
+                    "nickname": "mgt_org_user_delete",
+                    "summary": "Remove admin user from organization",
+                    "notes": "Remove an admin user from organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin user username, email, or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/apps",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_apps_get",
+                    "summary": "Get apps for organization",
+                    "notes": "Get apps for organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_apps_json_post",
+                    "summary": "Create new applicationfor organization",
+                    "notes": "Create new application for organization using JSON payload.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Application to create",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_apps_form_post",
+                    "summary": "Create new application for organization",
+                    "notes": "Create new application for organization using form parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "name",
+                            "dataType": "string",
+                            "description": "Application Name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "DELETE",
+                    "nickname": "mgt_org_app_delete",
+                    "summary": "Delete an application in an organization",
+                    "notes": "Delete an application in an organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Application name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_app_credentials_get",
+                    "summary": "Get application keys",
+                    "notes": "Get application keys.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Application name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_app_credentials_post",
+                    "summary": "Generate application keys",
+                    "notes": "Generate application keys.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "app_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Application name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Application not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_user_json_post",
+                    "summary": "Create new admin user",
+                    "notes": "Create new admin user.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Admin user to post",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_user_form_post",
+                    "summary": "Create new organization",
+                    "notes": "Create new admin using form post parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "username",
+                            "dataType": "string",
+                            "description": "Admin Username",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "name",
+                            "dataType": "string",
+                            "description": "Admin Name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "Admin Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "password",
+                            "dataType": "string",
+                            "description": "Admin Password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/resetpw",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_org_user_reset_password_get",
+                    "summary": "Initiate a user password reset",
+                    "notes": "Initiate a user password reset.  Returns browser-viewable HTML page.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_org_user_reset_password_form_post",
+                    "summary": "Complete a user password reset",
+                    "notes": "Complete a user password reset.  Handles form POST response.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "email",
+                            "dataType": "string",
+                            "description": "Admin Email",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_challenge_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Challenge Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_response_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Response Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_get",
+                    "summary": "Returns the admin user details",
+                    "notes": "Returns the admin user details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "mgt_admin_user_json_put",
+                    "summary": "Updates the admin user details",
+                    "notes": "Updates the admin user details.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Admin user details",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/activate",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_activate_get",
+                    "summary": "Activates the admin user",
+                    "notes": "Activates the admin user from link provided in email notification.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "token",
+                            "dataType": "string",
+                            "description": "Activation Token (supplied via email)",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "confirm",
+                            "dataType": "boolean",
+                            "description": "Send confirmation email",
+                            "required": false,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/reactivate",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_reactivate_get",
+                    "summary": "Reactivates the admin user",
+                    "notes": "Request admin user reactivation.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/feed",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_feed_get",
+                    "summary": "Get admin user activity feed",
+                    "notes": "Get admin user activity feed.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/password",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "mgt_admin_user_password_json_put",
+                    "summary": "Set admin user password",
+                    "notes": "Set admin user password.  See Usergrid documentation for JSON format of body.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Old and new password",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/resetpw",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_reset_password_get",
+                    "summary": "Initiate a user password reset",
+                    "notes": "Initiate a user password reset.  Returns browser-viewable HTML page.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_admin_user_reset_password_form_post",
+                    "summary": "Complete a user password reset",
+                    "notes": "Complete a user password reset.  Handles form POST response.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "recaptcha_challenge_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Challenge Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "recaptcha_response_field",
+                            "dataType": "string",
+                            "description": "Recaptcha Response Field",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "Organization not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/orgs",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "GET",
+                    "nickname": "mgt_admin_user_orgs_get",
+                    "summary": "Get organizations for admin user",
+                    "notes": "Get organizations for admin user.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_admin_user_orgs_json_post",
+                    "summary": "Create new organization for admn user",
+                    "notes": "Create new organization for admin user using JSON payload.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "json",
+                            "dataType": "string",
+                            "description": "Organization to create",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "body"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "POST",
+                    "nickname": "mgt_admin_user_orgs_form_post",
+                    "summary": "Create new organization for admin user",
+                    "notes": "Create new organization for admin user using form parameters.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin username, email or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "organization",
+                            "dataType": "string",
+                            "description": "Organization name",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "post"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "path": "/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}",
+            "description": "Management",
+            "operations": [
+                {
+                    "httpMethod": "PUT",
+                    "nickname": "mgt_admin_user_org_put",
+                    "summary": "Add admin user to organization",
+                    "notes": "Add admin users to organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin user username, email, or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                },
+                {
+                    "httpMethod": "DELETE",
+                    "nickname": "mgt_admin_user_org_delete",
+                    "summary": "Remove admin user from organization",
+                    "notes": "Remove an admin user from organization.",
+                    "responseTypeInternal": "",
+                    "responseClass": "response",
+                    "parameters": [
+                        {
+                            "name": "access_token",
+                            "dataType": "string",
+                            "description": "The OAuth2 access token",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "query"
+                        },
+                        {
+                            "name": "user_username_email_or_uuid",
+                            "dataType": "string",
+                            "description": "Admin user username, email, or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        },
+                        {
+                            "name": "org_name_or_uuid",
+                            "dataType": "string",
+                            "description": "Organization name or uuid",
+                            "required": true,
+                            "allowMultiple": false,
+                            "paramType": "path"
+                        }
+                    ],
+                    "errorResponses": [
+                        {
+                            "reason": "Invalid ID supplied",
+                            "code": 400
+                        },
+                        {
+                            "reason": "User not found",
+                            "code": 404
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "models": {
+        "response": {
+            "properties": {
+                "id": {
+                    "type": "long"
+                },
+                "name": {
+                    "type": "string"
+                }
+            },
+            "id": "response"
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/resources.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/resources.json b/sdks/php5/apache-usergrid/src/Manifests/resources.json
new file mode 100644
index 0000000..8a6ffad
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/resources.json
@@ -0,0 +1,15 @@
+{
+    "basePath": "${basePath}",
+    "swaggerVersion": "1.1-SHAPSHOT.121026",
+    "apiVersion": "0.1",
+    "apis": [
+        {
+            "path": "/applications.{format}",
+            "description": "Applications"
+        },
+        {
+            "path": "/management.{format}",
+            "description": "Management"
+        }
+    ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Native/ConfigRepository.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Native/ConfigRepository.php b/sdks/php5/apache-usergrid/src/Native/ConfigRepository.php
new file mode 100644
index 0000000..b6febf0
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Native/ConfigRepository.php
@@ -0,0 +1,102 @@
+<?php namespace Apache\Usergrid\Native;
+
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+use ArrayAccess;
+
+/**
+ * Class ConfigRepository
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ConfigRepository implements ArrayAccess
+{
+
+    /**
+     * The config file path.
+     *
+     * @var string
+     */
+    protected $file;
+
+    /**
+     * The config data.
+     *
+     * @var array
+     */
+    protected $config = [];
+
+    /**
+     * Constructor.
+     *
+     * @param  string $file
+     * @return \Apache\Usergrid\Native\ConfigRepository
+     */
+    public function __construct($file)
+    {
+        $this->file = $file;
+
+        $this->load();
+    }
+
+    /**
+     * Load the configuration file.
+     *
+     * @return void
+     */
+    protected function load()
+    {
+        $this->config = require $this->file;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function offsetExists($key)
+    {
+        return isset($this->config[$key]);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function offsetGet($key)
+    {
+        return $this->config[$key];
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function offsetSet($key, $value)
+    {
+        $this->config[$key] = $value;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function offsetUnset($key)
+    {
+        unset($this->config[$key]);
+    }
+
+}


[18/45] incubator-usergrid git commit: fixed issue with manifest folder path so manifest files could be found when installed via php composer.

Posted by ro...@apache.org.
fixed issue with manifest folder path so manifest files could be found when installed via php composer.

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7b452da0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7b452da0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7b452da0

Branch: refs/heads/master
Commit: 7b452da04ad005e39ad4fe326313a37b559d7c19
Parents: 83ca146
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Oct 27 12:41:03 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Oct 27 12:41:03 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/Usergrid.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7b452da0/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
index 5346b2d..392c85a 100644
--- a/sdks/php5/apache-usergrid/src/Api/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -123,7 +123,7 @@ class Usergrid
     function __construct($orgName = null, $appName = null, $manifestPath, $version, $baseUrl, Oauth2Plugin $oauth2_plugin = null)
     {
         //Set Version so its added to header
-        $this->setVersion($version); //TODO: move to constructor param
+        $this->setVersion($version ?: $this-version); 
 
         $this->baseUrl = $baseUrl;
 
@@ -136,7 +136,7 @@ class Usergrid
         }
 
         // Set the manifest path
-        $this->setManifestPath($manifestPath ?: __DIR__.'/Manifests');
+       $this->setManifestPath($manifestPath ?: dirname(dirname(__FILE__)).'/Manifests');
     }
 
     /**
@@ -450,4 +450,4 @@ class Usergrid
     protected function fetchToken(){
 
     }
-} 
\ No newline at end of file
+} 


[11/45] incubator-usergrid git commit: Updated the README.md file and added the version 1.0.1 manifest files

Posted by ro...@apache.org.
Updated the README.md file and added the version 1.0.1 manifest files


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bf7aaba0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bf7aaba0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bf7aaba0

Branch: refs/heads/master
Commit: bf7aaba0dc53545b30e4e12dcb65e0344803ab8a
Parents: 1f8a492
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Sun Oct 26 15:53:26 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Sun Oct 26 15:53:26 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/README.md             |  38 +-
 .../src/Manifests/1.0.1/Activities.php          |  24 ++
 .../src/Manifests/1.0.1/Assets.php              |  24 ++
 .../src/Manifests/1.0.1/Devices.php             | 381 +++++++++++++++++++
 .../src/Manifests/1.0.1/Events.php              |  24 ++
 .../src/Manifests/1.0.1/Groups.php              | 381 +++++++++++++++++++
 .../src/Manifests/1.0.1/Notifications.php       |  24 ++
 .../src/Manifests/1.0.1/Notifiers.php           |  24 ++
 .../src/Manifests/1.0.1/Receipts.php            |  24 ++
 .../src/Manifests/1.0.1/Roles.php               | 381 +++++++++++++++++++
 .../src/Manifests/1.0.1/Users.php               | 381 +++++++++++++++++++
 11 files changed, 1693 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index fe436e2..424e895 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -74,10 +74,9 @@ $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
 
 
 ### Laravel ###
-In Laravel you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
-then add your client_id and secret to the config file and setup the service provider to app/config providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
-the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade
-example for Laravel
+In Laravel once you have install the composer package you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
+then add your client_id and secret to the config file the set the service provider in the app/config.php providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
+the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade. Example for Laravel
 
 ```
     $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
@@ -95,7 +94,7 @@ example for Laravel
  AWS PHP SDK when calling enableFacades() on the AWS factory method.
  
 ### Error Handling ### 
-All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want to just catch the correct exception eg. resource not found.
+All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
 
 ```
 try {
@@ -107,8 +106,8 @@ try {
 ```
  
 ### Authentication ###
-  You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api and then set the token on the usergrid instance
-  by default this will manage Oauth2 for you but if you want to do it your self set the config setting to false and then do some like this.
+  You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api or get the token from elsewhere and then set the token on the usergrid instance.
+  By default this will manage Oauth2 flow for you and I recommend that you leave it set to true. But if you want to do it yourself set the config setting to false and then do something like this.
   
 ```
  $res  =  Usergrid::management()->authPasswordGet($array);
@@ -123,15 +122,28 @@ try {
  * Application Token -- Per Application token that is for the application
  * Application User Token -- User level access this token is for a logged in user.
  
- The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to each resource
- the Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
+ The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to all resources.
+ The Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
  resources. The Admin user token is the organization admin user so it too has access to all Applications and Organizations and the last level which is a User
- Token that is a per application users and will have access to all resources that roles attached to that user can access.
+ Token that is a per application user and will have access to all resources that roles attached to that user can access.
  
 So there are two settings in the config that controls which type of token you get.
 the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
-which type of credentials you use which can be either client_id & client_secret or username & password
+which type of credentials you use which can be either client_id & client_secret or username & password.
 
+### Result Iteration ###
+Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
+a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
+that will return all entities for you in one request. So again let the SDK do the hard work for you.
+
+``` 
+//The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
+$allDevices = Usergrid::DevicesIterator();
+
+foreach($allDevices as $device) {
+// this will have all devices. 
+}
+```
 
 ## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
 All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
@@ -139,10 +151,10 @@ the real files are in the manifest/1.0.0 folder so as usergrid is updated new ve
 Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
 
 ## designs guidelines ##
-The design of this is to make it easy to add to existing project and be able to map Model objects in yor project 
+The design of this is to make it easy to add to existing project and be able to map Model objects in your project 
 to response models for example in my project I have a organization object that is saved in a mysql database and I can
 call a Usergrid Api call on that model object just like using the Usergrid api class eg:
-``` Usergrid::Mangement->putOrganization($data_array) ``` is the same as
+``` Usergrid::Management->putOrganization($data_array) ``` is the same as
 ``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
 Gateway Objects using php Traits
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Activities.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Activities.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Activities.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Activities.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Assets.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Assets.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Assets.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Assets.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
new file mode 100644
index 0000000..b688575
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Devices.php
@@ -0,0 +1,381 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Get All devices.',
+        'summary' => 'Get all Device collection limit 10000',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+                'default' => 10000
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'find' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query Devices.',
+        'summary' => 'Query the devices collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'findById' => ['httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
+        'notes' => 'Find Device by uuid.',
+        'summary' => 'Find device by uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'uuid' => [
+                'description' => 'Group UUID (entity uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'create' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new Device.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new Device entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'destroy' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete a Device entity.',
+        'summary' => 'Delete a Device entity by name or uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'update' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update a Device entity.',
+        'summary' => 'Update a Device entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'devices'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Events.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Events.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Events.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Events.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
new file mode 100644
index 0000000..e874ce9
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Groups.php
@@ -0,0 +1,381 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+                'default' => 10000
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'find' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query Groups.',
+        'summary' => 'Query the groups collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'findById' => ['httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
+        'notes' => 'Find group by uuid.',
+        'summary' => 'Find group by uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'uuid' => [
+                'description' => 'Group UUID (entity uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'create' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new Group.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new Group entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'destroy' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete a Group entity.',
+        'summary' => 'Delete a Group entity by name or uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'update' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update a Group entity.',
+        'summary' => 'Update a Group entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'groups'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Receipts.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Receipts.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Receipts.php
new file mode 100644
index 0000000..a51055f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Receipts.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [],
+    'find' => [],
+    'create' => [],
+    'destroy' => [],
+    'update' => []
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
new file mode 100644
index 0000000..a0f7c43
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Roles.php
@@ -0,0 +1,381 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+                'default' => 10000
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'find' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query Roles.',
+        'summary' => 'Query the roles collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'findById' => ['httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
+        'notes' => 'Find Role by uuid.',
+        'summary' => 'Find role by uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'uuid' => [
+                'description' => 'Group UUID (entity uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'create' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new Role.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new Role entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'destroy' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete a Role entity.',
+        'summary' => 'Delete a Role entity by name or uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'update' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update a Role entity.',
+        'summary' => 'Update a Roles entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Entity',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'roles'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
+];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bf7aaba0/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
new file mode 100644
index 0000000..2b8e199
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -0,0 +1,381 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+return [
+
+    'all' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query an app collection.',
+        'summary' => 'Query an app collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+                'default' => 10000
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'find' => [
+        'httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Query Users.',
+        'summary' => 'Query the users collection',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'findById' => ['httpMethod' => 'GET',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{uuid}',
+        'notes' => 'Find User by uuid.',
+        'summary' => 'Find user by uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'uuid' => [
+                'description' => 'User UUID (entity uuid)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'ql' => [
+                'description' => 'a query in the query language',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'reversed' => [
+                'description' => 'return results in reverse order',
+                'location' => 'query',
+                'type' => 'boolean',
+                'required' => false,
+            ],
+            'start' => [
+                'description' => 'the first entity UUID to return',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'cursor' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'limit' => [
+                'description' => 'an encoded representation of the query position for paging',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ],
+            'filter' => [
+                'description' => 'a condition to filter on',
+                'location' => 'query',
+                'type' => 'integer',
+                'required' => false,
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'query'
+        ]
+    ],
+    'create' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}',
+        'notes' => 'Create new User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new User entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ],
+    'destroy' => [
+        'httpMethod' => 'DELETE',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Delete a User entity.',
+        'summary' => 'Delete a User entity by name or uuid',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ]
+    ],
+    'update' => [
+        'httpMethod' => 'PUT',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+        'notes' => 'Update a User entity.',
+        'summary' => 'Update a User entity by name or uuid and using JSON data',
+        'responseClass' => 'Apache\Usergrid\Api\Models\User',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'entity_name_or_uuid' => [
+                'description' => 'entity name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'collection' => [
+                'description' => 'collection name (entity type)',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
+];
\ No newline at end of file


[24/45] incubator-usergrid git commit: change $lastItem for $result as it was left when I copied this from my Facebook client.

Posted by ro...@apache.org.
change $lastItem for $result as it was left when I copied this from my Facebook client.

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/fbc81683
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/fbc81683
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/fbc81683

Branch: refs/heads/master
Commit: fbc816835ef86907b70cd5269de25357f70bf69b
Parents: 84fdf01
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Oct 31 16:06:02 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Oct 31 16:06:02 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Api/ResourceIterator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fbc81683/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index 5bb5432..be3d79c 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -61,7 +61,7 @@ class ResourceIterator extends BaseIterator
 
         $lastItem = end($data);
 
-        $this->nextToken = $result['cursor'] ? $lastItem['cursor'] : false;
+        $this->nextToken = $result['cursor'] ? $result['cursor'] : false;
 
         return $data;
     }


[23/45] incubator-usergrid git commit: remove space

Posted by ro...@apache.org.
remove space

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/84fdf013
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/84fdf013
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/84fdf013

Branch: refs/heads/master
Commit: 84fdf013a7d586ecdf887854ebb4fa55b96221d9
Parents: 4de1a9c
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Oct 31 14:45:09 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Oct 31 14:45:09 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/84fdf013/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
index aadb172..499ac99 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.0/Errors.php
@@ -33,7 +33,7 @@ return [
 	],
 
 	[
-		'class' => ' Apache\Usergrid\Api\Exception\NotFoundException',
+		'class' => 'Apache\Usergrid\Api\Exception\NotFoundException',
 		'code'  => 404,
 	],
 


[15/45] incubator-usergrid git commit: fixed some typos

Posted by ro...@apache.org.
fixed some typos

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/90cac4ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/90cac4ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/90cac4ad

Branch: refs/heads/master
Commit: 90cac4adaf0063a8509dc862484418ad52ea5bf4
Parents: 21e3aaf
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sun Oct 26 17:16:13 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sun Oct 26 17:16:13 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/90cac4ad/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index 424e895..b0ca6d4 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -162,8 +162,8 @@ Gateway Objects using php Traits
 ## Javascript ##
 There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
 to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
-the javascript file in you page but It only works with Laravel as it posts the token to a route bu it would not be hard to use else where its not part of this SDK so think
-of it as a helper as some times it good to have access to both world server side calls for and Ajax calls using the one login token.
+the javascript file in your page  It's set to works with Laravel as it posts the token to a route but it would not be hard to use else where just create uri it can post the token too. Its not part of this SDK so think
+of it as a helper as some times it good to have access to both world server side calls for long running or large result sets and Ajax calls to update UI using the one login token for both type of calls.
 
 
 ### Contribution guidelines ###
@@ -171,4 +171,4 @@ of it as a helper as some times it good to have access to both world server side
 * Writing tests
 * Code review
 * Code
-* Manifest files
\ No newline at end of file
+* Manifest files


[16/45] incubator-usergrid git commit: added missing use statement

Posted by ro...@apache.org.
added missing use statement

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/143a0253
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/143a0253
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/143a0253

Branch: refs/heads/master
Commit: 143a0253e599b7767a7a7387f139ab1f4a9ccd1b
Parents: 90cac4a
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sun Oct 26 18:03:08 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sun Oct 26 18:03:08 2014 +1000

----------------------------------------------------------------------
 .../src/Laravel/ApacheUsergridServiceProvider.php                | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/143a0253/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
index 5bb4115..d24ad40 100644
--- a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -15,7 +15,7 @@
  */
 namespace Apache\Usergrid\Laravel;
 
-
+use Apache\Usergrid\Api\Usergrid;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\PasswordCredentials;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\RefreshToken;
@@ -139,4 +139,4 @@ class ApacheUsergridServiceProvider extends ServiceProvider
 
     }
 
-} 
\ No newline at end of file
+} 


[34/45] incubator-usergrid git commit: typo

Posted by ro...@apache.org.
typo

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/916c0d2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/916c0d2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/916c0d2a

Branch: refs/heads/master
Commit: 916c0d2a2b15df5581f2ceda9f4c206b31528178
Parents: a4d14a5
Author: Apps4u <ja...@apps4u.com.au>
Authored: Fri Nov 7 17:54:08 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Fri Nov 7 17:54:08 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/Examples/collections/users.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/916c0d2a/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index d39331f..a6791d9 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -89,7 +89,7 @@ var_dump($find_user_by_uuid->entities);
 $user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
 echo $user_addr->entities->fetch('adr.addr1');
 //or
-echo $user_addr->entities->fetch('adr.street');
+echo $user_addr->entities->fetch('adr.addr1');
 
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);


[04/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Manifests/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/Usergrid.php b/sdks/php5/apache-usergrid/src/Manifests/Usergrid.php
new file mode 100644
index 0000000..f4522bb
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/Usergrid.php
@@ -0,0 +1,4689 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+return [
+
+    'name' => 'Management',
+    'apiVersion' => '1.1',
+    'baseUrl' => 'http://baas-platform.com',
+    'description' => 'Client to Usergrid management service',
+    'operations' => [
+
+        'AuthPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/token',
+            'summary' => 'Get management access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizeGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/authorize',
+            'summary' => 'Authorize the client.  See the OAuth2 specification.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'response_type' => [
+                    'description' => 'Response type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'token',
+                    'required' => true,
+                    'allowableValues' => ['code', 'token']
+                ],
+                'client_id' => [
+                    'description' => 'Client ID.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+
+        ],
+        'OrgJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs',
+            'summary' => 'Create new organization.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'organization' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization Name'
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}',
+            'summary' => 'Find organization by name or UUID',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied or Name",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/activate',
+            'summary' => 'Activates the organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied or Name",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'confirm' => [
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => false,
+                    'description' => 'Send confirmation email'
+                ]
+
+            ]
+        ],
+        'OrgReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/reactivate',
+            'summary' => 'Reactivates the organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+            ]
+        ],
+        'OrgFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/feed',
+            'summary' => 'Get organization activity feed',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgCredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+            'summary' => 'Get organization client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgCredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/credentials',
+            'summary' => 'Generate organization client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgUsersGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Get admin users for organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgUsersJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Create new admin user for organization using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgUsersFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users',
+            'summary' => 'Create new admin user for organization using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'OrgUserPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'summary' => 'Adds existing admin users for organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin user username, email, or uuid'
+                ]
+            ]
+        ],
+        'OrgUserDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/orgs/{org_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'summary' => 'Remove an admin user from organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin user username, email, or uuid'
+                ]
+            ]
+        ],
+        'OrgAppsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Get apps for organization',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppsJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Create new application for organization using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application Name'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgAppsFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps',
+            'summary' => 'Create new application for organization using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application Name'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'OrgAppDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}',
+            'summary' => 'Delete an application in an organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppCredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+            'summary' => 'Get application keys.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgAppCredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/orgs/{org_name_or_uuid}/apps/{app_name_or_uuid}/credentials',
+            'summary' => 'Generate application keys.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+                'app_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Application name or uuid'
+                ]
+            ]
+        ],
+        'OrgUserJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users',
+            'summary' => 'Create new admin user.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'OrgUserFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users',
+            'summary' => 'Create new admin using form post parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+
+        ],
+        'OrgUserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/resetpw',
+            'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+        ],
+        'OrgUserResetPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/resetpw',
+            'summary' => 'Complete a user password reset.  Handles form POST response.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'recaptcha_challenge_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Challenge Field'
+                ],
+                'recaptcha_response_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Response Field'
+                ],
+            ]
+        ],
+        'AdminUserGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}',
+            'summary' => 'Returns the admin user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+            ]
+
+        ],
+        'AdminUserJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}',
+            'summary' => 'Updates the admin user details.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+
+        ],
+        'AdminUserActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/activate',
+            'summary' => 'Activates the admin user from link provided in email notification.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'confirm' => [
+                    'location' => 'uri',
+                    'type' => 'boolean',
+                    'required' => false,
+                    'description' => 'Send confirmation email'
+                ],
+            ]
+        ],
+        'AdminUserReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/reactivate',
+            'summary' => 'Request admin user reactivation.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ]
+            ]
+        ],
+        'AdminUserFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/feed',
+            'summary' => 'Get admin user activity feed.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'AdminUserPasswordJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}/password',
+            'summary' => 'Set admin user password.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'old_password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Old and new password'
+                ],
+                'new_password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Old and new password'
+                ],
+            ]
+        ],
+        'AdminUserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+            'summary' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ]
+            ]
+        ],
+        'AdminUserResetPasswordFormPost' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/resetpw',
+            'summary' => 'Complete a user password reset.  Handles form POST response.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Organization not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'recaptcha_challenge_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Challenge Field'
+                ],
+                'recaptcha_response_field' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Recaptcha Response Field'
+                ]
+            ]
+        ],
+        'AdminUserOrgsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Get organizations for admin user.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ]
+        ],
+        'AdminUserOrgsJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Create new organization for admin user using JSON payload.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'organization' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'AdminUserOrgsFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs',
+            'summary' => 'Create new organization for admin user using form parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'organization' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'postField'
+            ]
+        ],
+        'AdminUserOrgPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+            'summary' => 'Add admin users to organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'AdminUserOrgDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/management/users/{user_username_email_or_uuid}/orgs/{org_name_or_uuid}',
+            'summary' => 'Remove an admin user from organization.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid UUID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+                'user_username_email_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin username, email or uuid'
+                ],
+                'org_name_or_uuid' => [
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Organization name or uuid'
+                ],
+
+            ]
+        ]
+
+
+    ]
+
+];
+
+return [
+
+    'name' => 'Application',
+    'apiVersion' => '1.1',
+    'baseUrl' => 'http://baas-platform.com',
+    'description' => 'Client to Usergrid application service',
+    'operations' => [
+        'AuthPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/token',
+            'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+            'summary' => 'Get app access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthPasswordPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/token',
+            'notes' => 'Get the app access token.  See the OAuth2 specification for details.',
+            'summary' => 'Get app access token',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'grant_type' => [
+                    'description' => 'Grant type.',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'defaultValue' => 'password',
+                    'required' => true,
+                ],
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'username' => [
+                    'description' => 'Username (for grant_type=password).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'password' => [
+                    'description' => 'Password (for grant_type=password).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID (for grant_type=client_credentials).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_secret' => [
+                    'description' => 'Client Secret (for grant_type=client_credentials).',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizeGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/authorize',
+            'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+            'summary' => 'Authorize app client',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'response_type' => [
+                    'description' => 'Response type',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                    'default' => 'token'
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'AuthorizePost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/authorize',
+            'notes' => 'Authorize the app client.  See the OAuth2 specification.',
+            'summary' => 'Authorize app client',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'response_type' => [
+                    'description' => 'Response type',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                    'default' => 'token'
+                ],
+                'redirect_uri' => [
+                    'description' => 'Redirect URI',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'client_id' => [
+                    'description' => 'Client ID',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'scope' => [
+                    'description' => 'Access Token Scope.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'state' => [
+                    'description' => 'Client State.',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'CredentialsGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/credentials',
+            'notes' => 'Get the app client credentials.',
+            'summary' => 'Get app client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'CredentialsPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/credentials',
+            'notes' => 'Generate new app client credentials',
+            'summary' => 'Generate app client credentials',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'access_token' => [
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'The OAuth2 access token'
+                ],
+            ]
+        ],
+        'UserJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users',
+            'notes' => 'Create new app user',
+            'summary' => 'Create new app user.  See Usergrid documentation for JSON format of body.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'username' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'json',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ]
+        ],
+        'UserFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users',
+            'notes' => 'Create new app user',
+            'summary' => 'Create new app user using form post parameters.',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'username' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Username'
+                ],
+                'name' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Name'
+                ],
+                'email' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Email'
+                ],
+                'password' => [
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                    'description' => 'Admin Password'
+                ]
+            ]
+        ],
+        'UserPasswordRestGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/resetpw',
+            'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'summary' => 'Initiate a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users/resetpw',
+            'notes' => 'Complete a user password reset.  Handles form POST response.',
+            'summary' => 'Complete a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'email' => [
+                    'description' => 'User Email',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_challenge_field' => [
+                    'description' => 'Recaptcha Challenge Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_response_field' => [
+                    'description' => 'Recaptcha Response Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'notes' => 'Returns the app user details.',
+            'summary' => 'Returns the app user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}',
+            'notes' => 'Updates the app user details.',
+            'summary' => 'Updates the app user details',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ],
+            'additionalParameters' => [
+                'location' => 'json'
+            ]
+        ],
+        'UserActivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/activate',
+            'notes' => 'Activates the app user from link provided in email notification.',
+            'summary' => 'Activates the app user',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'token' => [
+                    'description' => 'Activation Token (supplied via email)',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'confirm' => [
+                    'description' => 'Send confirmation email',
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => true,
+                ],
+            ]
+        ],
+        'UserReactivateGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/reactivate',
+            'notes' => 'Request app user reactivation.',
+            'summary' => 'Reactivates the app user',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserFeedGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/feed',
+            'notes' => 'Get app user activity feed.',
+            'summary' => 'Get app user activity feed',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserPasswordJsonPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/password',
+            'notes' => 'Set app user password.  See Usergrid documentation for JSON format of body.',
+            'summary' => 'Set app user password',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Old and new password",
+                'location' => 'json'
+            ]
+        ],
+        'UserResetPasswordGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+            'notes' => 'Initiate a user password reset.  Returns browser-viewable HTML page.',
+            'summary' => 'Initiate a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'UserResetPasswordFormPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/users/{user_username_email_or_uuid}/resetpw',
+            'notes' => 'Complete a user password reset.  Handles form POST response.',
+            'summary' => 'Complete a user password reset',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "User not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'user_username_email_or_uuid' => [
+                    'description' => 'User username, email or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_challenge_field' => [
+                    'description' => 'Recaptcha Challenge Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'recaptcha_response_field' => [
+                    'description' => 'Recaptcha Response Field',
+                    'location' => 'postField',
+                    'type' => 'string',
+                    'required' => true,
+                ]
+            ]
+        ],
+        'EntityGet' => [
+            'httpMethod' => 'GET',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}',
+            'notes' => 'Query an app collection.',
+            'summary' => 'Query an app collection',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'ql' => [
+                    'description' => 'a query in the query language',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'reversed' => [
+                    'description' => 'return results in reverse order',
+                    'location' => 'query',
+                    'type' => 'boolean',
+                    'required' => false,
+                ],
+                'start' => [
+                    'description' => 'the first entity UUID to return',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'cursor' => [
+                    'description' => 'an encoded representation of the query position for paging',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ],
+                'limit' => [
+                    'description' => 'an encoded representation of the query position for paging',
+                    'location' => 'query',
+                    'type' => 'integer',
+                    'required' => false,
+                ],
+                'filter' => [
+                    'description' => 'a condition to filter on',
+                    'location' => 'query',
+                    'type' => 'integer',
+                    'required' => false,
+                ]
+            ]
+        ],
+        'EntityJsonPost' => [
+            'httpMethod' => 'POST',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}',
+            'notes' => 'Create new app entity.  See Usergrid documentation for JSON format of body.',
+            'summary' => 'Create new app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Entity data",
+                'location' => 'json'
+            ]
+        ],
+        'EntityPut' => [
+            'httpMethod' => 'PUT',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+            'notes' => 'Update an app entity in a collection.',
+            'summary' => 'Update an app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'entity_name_or_uuid' => [
+                    'description' => 'entity name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'collection' => [
+                    'description' => 'collection name (entity type)',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'access_token' => [
+                    'description' => 'The OAuth2 access token',
+                    'location' => 'query',
+                    'type' => 'string',
+                    'required' => false,
+                ]
+            ],
+            'additionalParameters' => [
+                "description" => "Entity data",
+                'location' => 'json'
+            ]
+        ],
+        'EntityDelete' => [
+            'httpMethod' => 'DELETE',
+            'uri' => '/apps/{app_name_or_uuid}/{collection}/{entity_name_or_uuid}',
+            'notes' => 'Delete an app entity.',
+            'summary' => 'Delete an app entity',
+            'responseClass' => 'Response',
+            'errorResponses' => [
+                [
+                    "reason" => "Invalid ID supplied",
+                    "code" => 400
+                ],
+                [
+                    "reason" => "Application not found",
+                    "code" => 404
+                ]
+            ],
+            'parameters' => [
+                'app_name_or_uuid' => [
+                    'description' => 'app name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],
+                'entity_name_or_uuid' => [
+                    'description' => 'entity name or uuid',
+                    'location' => 'uri',
+                    'type' => 'string',
+                    'required' => true,
+                ],

<TRUNCATED>

[28/45] incubator-usergrid git commit: change to version 1.0.1 of manifest files

Posted by ro...@apache.org.
change to version 1.0.1 of manifest files

Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9f25f36b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9f25f36b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9f25f36b

Branch: refs/heads/master
Commit: 9f25f36b0c2cf6a4925e1c35449a6823e795814f
Parents: 3c6ebe8
Author: Apps4u <ja...@apps4u.com.au>
Authored: Sat Nov 1 16:39:26 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Sat Nov 1 16:39:26 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/tests/Api/test_config.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9f25f36b/sdks/php5/apache-usergrid/tests/Api/test_config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/test_config.php b/sdks/php5/apache-usergrid/tests/Api/test_config.php
index cd1df43..da46e40 100644
--- a/sdks/php5/apache-usergrid/tests/Api/test_config.php
+++ b/sdks/php5/apache-usergrid/tests/Api/test_config.php
@@ -20,7 +20,7 @@ return [
 
         'url' => 'https://api.usergrid.com',
 
-        'version' => '1.0.0',
+        'version' => '1.0.1',
 
         'orgName' => "",
 
@@ -62,4 +62,4 @@ return [
          * */
         'enable_oauth2_plugin' => true
     ]
-];
\ No newline at end of file
+];


[42/45] incubator-usergrid git commit: fixed read me as it had some method calls that were changed . added a few more examples just to show that the results as PHP collections and that all collection type methods can be called in a fluent way e.g.: $user

Posted by ro...@apache.org.
fixed read me as it had some method calls that were changed .
added a few more examples just to show that the results as PHP collections and that all collection type methods can be called in a fluent way e.g.:
$users =  Usergrid::users()-all();
$user->entities->fetch('uuid')->first();


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a9fbc734
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a9fbc734
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a9fbc734

Branch: refs/heads/master
Commit: a9fbc73407933694c8b3527ed9d710f47419a149
Parents: 08ad23a
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Tue Nov 11 12:32:31 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Tue Nov 11 12:32:31 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php               |  7 ++++++-
 .../Examples/collections/users.php               |  6 +++---
 sdks/php5/apache-usergrid/README.md              | 19 ++++++++++++-------
 3 files changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a9fbc734/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
index 34ee501..e2d31ae 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/books.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -19,6 +19,7 @@ include('data.php');
 
 use Apache\Usergrid\Native\UsergridBootstrapper;
 use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Api\Filters\Date;
 
 /** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
 
@@ -83,13 +84,17 @@ var_dump($books->entities[0]['uuid']);
 // get all uuid
 var_dump($books->entities->fetch('uuid'));
 
+//get first uuid
+var_dump($books->entities->fetch('uuid')->first());
+
 // get first item in collection -- this is the first item in my response php collection not the Usergrid Collection (table).
 var_dump($books->entities->first());
 
 // get last item in collection -- this is the last item in my response php collection not the Usergrid Collection (table).
 var_dump($books->entities->last());
 
-
+// convert created date to string
+var_dump(Date::convert($books->entities->fetch('created')->first()));
 
 // Illuminate\Support\Collection class support all advanced collection methods
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a9fbc734/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index eb99fdd..34a897d 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -81,15 +81,15 @@ foreach($all_users as $user) {
 $find_user_by_query = Usergrid::users()->find(['ql' => "select * where email='jason@apps4u.com.au'"]);
 var_dump($find_user_by_query->entities->fetch('uuid'));
 
-$find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query->entities->fetch('uuid')[0]]);
+$find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query->entities->fetch('uuid')->first()]);
 var_dump($find_user_by_uuid->entities);
 
 
-// AS all results as PHP Collections and the entities propery is always returned as a PHP Collection you can fetch nested records
+// AS all results as PHP Collections and the entities property is always returned as a PHP Collection you can fetch nested records
 $user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
 echo $user_addr->entities->fetch('adr.addr1');
 //or
-echo $user_addr->entities->fetch('adr.street');
+echo $user_addr->entities->fetch('adr.city');
 
 // add user to group
 //$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a9fbc734/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index cd22247..54d4e8f 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -78,22 +78,22 @@ then add your client_id and secret to the config file the set the service provid
 the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade. Example for Laravel
 
 ```
-    $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
+    $collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
 ```
 
 ## how it works
 
  You have one main client called Usergrid so if I wanted to call the Management Api and I have Facades enabled then
- I would call like this ```Usergrid::Management->getApps();``` or ```Usergrid::Application->getEntity();```
+ I would call like this ```Usergrid::Management->OrgAppsGet();``` or ```Usergrid::Application->EntityGet();```
  
  There is one top level manifest file called Manifest.php and contain only top level Guzzle service descriptor properties and a empty operations array so 
- when calling ```php Usergrid::Management()->getEntity() ```  the Main Manifest file has the operation array filled in by the Management Manifest files operations array
+ when calling ```php Usergrid::Management()->OrgAppsGet() ```  the Main Manifest file has the operation array filled in by the Management Manifest files operations array
  and they are cached by the Usergrid web service client. Calls on the Usergrid client are like magic method in the sense that ```php Usergrid::Management()-> method``` call is not
  backed by a Management class or method its the Manifest that it being selected . Also by using Facades all method are like static method and fit in with newer PHP frameworks just like using the
  AWS PHP SDK when calling enableFacades() on the AWS factory method.
  
  All responses are subclasses of Illuminate\Support\Collection class so all collection methods are available to call on your response model eg: first(), get(), map(), fetch(), hasKey(), hasValue(), etc.
- this is not to mistake this with a Usergrid collection which is like your DB table they too are collection object but if you get a response of a single entiry then its a Collection with a count of 1.
+ this is not to mistake this with a Usergrid collection which is like your DB table they too are collection object but if you get a response of a single entity then its a Collection with a count of 1.
  
  
  
@@ -134,10 +134,15 @@ All HTTP and Server error returned by the Usergrid API have error classes attach
  
 So there are two settings in the config that controls which type of token you get.
 the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
-which type of credentials you use which can be either client_id & client_secret or username & password.
+which type of credentials you use which can be either `client_credentials` or `password` using client_id & client_secret or username & password.
 
 ### Result Iteration
-Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator that will return all entities for you in one request. So again let the SDK do the hard work for you. Resource Iterators as lazy loaded so they only make the api call if the data is needed for example when you first make the call no data is requested from the network but as soon as you dereference the data then the first page is requested and the 2nd page is not requested till you request the data for example if I used it in a foreach loop it will make a network request for the next page of data only after the loop has gone through the current page count and if you cancel the foreach loop then it wont request any more data the default page size is 20 for resou
 rce iterators.
+Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
+a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
+that will return all entities for you in one request. So again let the SDK do the hard work for you. Resource Iterators as lazy loaded so they only make the api call if the data is needed 
+for example when you first make the call no data is requested from the network but as soon as you dereference the data then the first page is requested and the 2nd page is not requested till
+you request the data for example if I used it in a foreach loop it will make a network request for the next page of data only after the loop has gone through the current page count and if you cancel the 
+foreach loop then it wont request any more data the default page size is 20 for resource iterators.
 
 The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
 ```
@@ -187,4 +192,4 @@ of it as a helper as some times it good to have access to both world server side
 * Writing tests
 * Code review
 * Code
-* Manifest files
+* Manifest files
\ No newline at end of file