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/12/11 02:50:48 UTC
[03/11] incubator-usergrid git commit: Create Attributes . So now
when I have a User entity I don't need to call the api a 2nd time for the
device relationship I can get access the device property on the User model
e.g.: $user->device; and the SDK will t
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ffe2b0d/sdks/php5/apache-usergrid/src/Manifests/swagger-json/management.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/swagger-json/management.json b/sdks/php5/apache-usergrid/src/Manifests/swagger-json/management.json
new file mode 100644
index 0000000..8323222
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/swagger-json/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 application for 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 admin 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/9ffe2b0d/sdks/php5/apache-usergrid/src/Manifests/swagger-json/resources.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/swagger-json/resources.json b/sdks/php5/apache-usergrid/src/Manifests/swagger-json/resources.json
new file mode 100644
index 0000000..8a6ffad
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Manifests/swagger-json/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/9ffe2b0d/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
index 09fa040..fbfcffe 100644
--- a/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Native/Facades/Usergrid.php
@@ -32,18 +32,17 @@ use Apache\Usergrid\Native\UsergridBootstrapper;
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;
+ /**
+ * The Usergrid API instance.
+ *
+ * @var \Apache\Usergrid\Api\Usergrid
+ */
+ protected $usergrid;
/**
* Constructor.
@@ -61,31 +60,6 @@ class Usergrid
}
/**
- * 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
@@ -116,4 +90,29 @@ class Usergrid
return call_user_func_array([$instance, $method], $args);
}
}
+
+ /**
+ * Creates a new Native Bootstraper instance.
+ *
+ * @param \Apache\Usergrid\Native\UsergridBootstrapper $bootstrapper
+ * @return static
+ */
+ 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;
+ }
}
\ No newline at end of file