lib/phraseapp-ruby.rb
def project_create(params)
      path = sprintf("/api/v2/projects")
      data_hash = {}
      post_body = nil
  
      if params.present?
        unless params.kind_of?(PhraseApp::RequestParams::ProjectParams)
          raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::ProjectParams")
        end
      end
      if params.account_id != nil
        data_hash["account_id"] = params.account_id
      end

      if params.main_format != nil
        data_hash["main_format"] = params.main_format
      end

      if params.name != nil
        data_hash["name"] = params.name
      end

      if params.project_image != nil
        post_body = []
        post_body << "--#{PhraseApp::MULTIPART_BOUNDARY}\r\n"
        post_body << "Content-Disposition: form-data; name=\"project_image\"; filename=\"#{File.basename(params.project_image )}\"\r\n"
        post_body << "Content-Type: text/plain\r\n"
        post_body << "\r\n"
        post_body << File.read(params.project_image)
        post_body << "\r\n"
      end

      if params.remove_project_image != nil
        data_hash["remove_project_image"] = (params.remove_project_image == true)
      end

      if params.shares_translation_memory != nil
        data_hash["shares_translation_memory"] = (params.shares_translation_memory == true)
      end

  
  
      reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
      rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 201)
      if err != nil
        return nil, err
      end
      
      return PhraseApp::ResponseObjects::ProjectDetails.new(JSON.load(rc.body)), err
    end
def project_create(params)
      path = sprintf("/api/v2/projects")
      data_hash = {}
      post_body = nil
  
      if params.present?
        unless params.kind_of?(PhraseApp::RequestParams::ProjectParams)
          raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::ProjectParams")
        end
      end
      if params.account_id != nil
        data_hash["account_id"] = params.account_id
      end

      if params.main_format != nil
        data_hash["main_format"] = params.main_format
      end

      if params.name != nil
        data_hash["name"] = params.name
      end

      if params.project_image != nil
        post_body = []
        post_body << "--#{PhraseApp::MULTIPART_BOUNDARY}\r\n"
        post_body << "Content-Disposition: form-data; name=\"project_image\"; filename=\"#{File.basename(params.project_image )}\"\r\n"
        post_body << "Content-Type: text/plain\r\n"
        post_body << "\r\n"
        post_body << File.read(params.project_image)
        post_body << "\r\n"
      end

      if params.remove_project_image != nil
        data_hash["remove_project_image"] = (params.remove_project_image == true)
      end

      if params.shares_translation_memory != nil
        data_hash["shares_translation_memory"] = (params.shares_translation_memory == true)
      end

  
  
      reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
      rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 201)
      if err != nil
        return nil, err
      end
      
      return PhraseApp::ResponseObjects::ProjectDetails.new(JSON.load(rc.body)), err
    end
Create a new project.
 API Path: /api/v2/projects
 == Parameters:
 params::
   Parameters of type PhraseApp::RequestParams::ProjectParams

 == Returns:
   PhraseApp::ResponseObjects::ProjectDetails
   err