text: /**
   * Cheery Chow Recipe API
   * Nutrition and recipe nutrition management API.
   *
   * OpenAPI spec version: 0.0.2
   * Contact: john@cheerychow.com
   *
   * NOTE: This class is auto generated by the swagger code generator program.
   * https://github.com/swagger-api/swagger-codegen.git
   * Do not edit the class manually.
   *
   * 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.
   */
  
  (function(root, factory) {
    if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define(['ApiClient', 'model/User', 'model/HttpAPIError', 'model/RecipeserverBasicauthSigninObject', 'model/PushDevice', 'model/RecipeserverBasicauthFacebookSigninObject', 'model/RecipeserverBasicauthFacebookSignupObject'], factory);
    } else if (typeof module === 'object' && module.exports) {
      // CommonJS-like environments that support module.exports, like Node.
      module.exports = factory(require('../ApiClient'), require('../model/User'), require('../model/HttpAPIError'), require('../model/RecipeserverBasicauthSigninObject'), require('../model/PushDevice'), require('../model/RecipeserverBasicauthFacebookSigninObject'), require('../model/RecipeserverBasicauthFacebookSignupObject'));
    } else {
      // Browser globals (root is window)
      if (!root.CheeryChowRecipeApi) {
        root.CheeryChowRecipeApi = {};
      }
      root.CheeryChowRecipeApi.AccountApi = factory(root.CheeryChowRecipeApi.ApiClient, root.CheeryChowRecipeApi.User, root.CheeryChowRecipeApi.HttpAPIError, root.CheeryChowRecipeApi.RecipeserverBasicauthSigninObject, root.CheeryChowRecipeApi.PushDevice, root.CheeryChowRecipeApi.RecipeserverBasicauthFacebookSigninObject, root.CheeryChowRecipeApi.RecipeserverBasicauthFacebookSignupObject);
    }
  }(this, function(ApiClient, User, HttpAPIError, RecipeserverBasicauthSigninObject, PushDevice, RecipeserverBasicauthFacebookSigninObject, RecipeserverBasicauthFacebookSignupObject) {
    'use strict';
  
    /**
     * Account service.
     * @module api/AccountApi
     * @version 0.0.2
     */
  
    /**
     * Constructs a new AccountApi. 
     * @alias module:api/AccountApi
     * @class
     * @param {module:ApiClient} apiClient Optional API client implementation to use,
     * default to {@link module:ApiClient#instance} if unspecified.
     */
    var exports = function(apiClient) {
      this.apiClient = apiClient || ApiClient.instance;
  
  
      /**
       * Callback function to receive the result of the accountInfo operation.
       * @callback module:api/AccountApi~accountInfoCallback
       * @param {String} error Error message, if any.
       * @param {module:model/User} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * The currently signed in user account info.
       * @param {module:api/AccountApi~accountInfoCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/User}
       */
      this.accountInfo = function(callback) {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/me', 'GET',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
  
      /**
       * Callback function to receive the result of the accountSignUp operation.
       * @callback module:api/AccountApi~accountSignUpCallback
       * @param {String} error Error message, if any.
       * @param data This operation does not return a value.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Sign a user up to your app.
       * @param {module:model/User} user The username, must be unique.
       * @param {module:api/AccountApi~accountSignUpCallback} callback The callback function, accepting three arguments: error, data, response
       */
      this.accountSignUp = function(user, callback) {
        var postBody = user;
  
        // verify the required parameter 'user' is set
        if (user == undefined || user == null) {
          throw "Missing the required parameter 'user' when calling accountSignUp";
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/signup', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
  
      /**
       * Callback function to receive the result of the accountSignin operation.
       * @callback module:api/AccountApi~accountSigninCallback
       * @param {String} error Error message, if any.
       * @param {module:model/User} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Sign a user in to your app.
       * @param {module:model/RecipeserverBasicauthSigninObject} username The username, must be unique and the password for the account.
       * @param {module:api/AccountApi~accountSigninCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/User}
       */
      this.accountSignin = function(username, callback) {
        var postBody = username;
  
        // verify the required parameter 'username' is set
        if (username == undefined || username == null) {
          throw "Missing the required parameter 'username' when calling accountSignin";
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/signin', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
  
      /**
       * Callback function to receive the result of the addPushNoteToAccount operation.
       * @callback module:api/AccountApi~addPushNoteToAccountCallback
       * @param {String} error Error message, if any.
       * @param {module:model/PushDevice} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Sign a user up to your app.
       * @param {module:model/PushDevice} token A valid push note token along with the platform the push token is for (ios/android/chrome/safari).
       * @param {module:api/AccountApi~addPushNoteToAccountCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/PushDevice}
       */
      this.addPushNoteToAccount = function(token, callback) {
        var postBody = token;
  
        // verify the required parameter 'token' is set
        if (token == undefined || token == null) {
          throw "Missing the required parameter 'token' when calling addPushNoteToAccount";
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = PushDevice;
  
        return this.apiClient.callApi(
          '/updatenote', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
  
      /**
       * Callback function to receive the result of the facebookSignupSignin operation.
       * @callback module:api/AccountApi~facebookSignupSigninCallback
       * @param {String} error Error message, if any.
       * @param {module:model/User} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Using a valid Facebook access token, sign the user up (or in if the user is already signed up).
       * @param {module:model/RecipeserverBasicauthFacebookSigninObject} accessToken A valid facebook access token which will be used to sign the user up.
       * @param {module:api/AccountApi~facebookSignupSigninCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/User}
       */
      this.facebookSignupSignin = function(accessToken, callback) {
        var postBody = accessToken;
  
        // verify the required parameter 'accessToken' is set
        if (accessToken == undefined || accessToken == null) {
          throw "Missing the required parameter 'accessToken' when calling facebookSignupSignin";
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/fb_signin', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
  
      /**
       * Callback function to receive the result of the saveUser operation.
       * @callback module:api/AccountApi~saveUserCallback
       * @param {String} error Error message, if any.
       * @param data This operation does not return a value.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Using a valid Facebook access token, sign the user up (or in if the user is already signed up).
       * @param {module:model/RecipeserverBasicauthFacebookSignupObject} accessToken A valid facebook access token which will be used to sign the user up.
       * @param {module:api/AccountApi~saveUserCallback} callback The callback function, accepting three arguments: error, data, response
       */
      this.saveUser = function(accessToken, callback) {
        var postBody = accessToken;
  
        // verify the required parameter 'accessToken' is set
        if (accessToken == undefined || accessToken == null) {
          throw "Missing the required parameter 'accessToken' when calling saveUser";
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['chow_auth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/fb_signup', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, callback
        );
      }
    };
  
    return exports;
  }));
  