No description or website provided.
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
foulefactoryapilib
LICENSE
README.md
requirements.txt

README.md

Getting Started

How to Build

You must have Python greater than 2.7 installed in your system to build and run your SDK files. The generated code has dependencies over external libraries like nose, jsonpickle, etc. These dependencies are defined in the requirements.txt file that comes with the SDK. To resolve these dependencies, we use the PIP Dependency manager. Install it by following steps at https://pip.pypa.io/en/stable/installing/

The paths of Python and PIP must be properly set in the environment variables. Open command prompt and type pip --version. This should display the current version of the PIP Dependency Manager installed if the installation was successful.

  • Using command line, navigate to the directory containing the generated files (including requirements.txt) for the SDK. Run the command pip install -r requirements.txt. This should install all the required dependencies.

Building SDK - Step 1

How to Use

The following section explains how to use the FouleFactoryApi library in a new project.

1. Open Project in an IDE

Open an IDE for Python like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

Open project in PyCharm - Step 1

Click on Open in PyCharm to browse to your generated SDK directory and then click OK.

Open project in PyCharm - Step 2

The project files will be displayed in the side bar as follows:

Open project in PyCharm - Step 3

2. Add a new Test Project

Create a new directory by right clicking on the solution name as shown below:

Add a new project in PyCharm - Step 1

Name the directory as "test"

Add a new project in PyCharm - Step 2

Add a python file to this project with the name "testsdk"

Add a new project in PyCharm - Step 3

Name it "testsdk"

Add a new project in PyCharm - Step 4

In your python file you will be required to import the generated python library using the following code lines

   from foulefactoryapilib.foulefactoryapi_client import *

Add a new project in PyCharm - Step 4

After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.

3. Run the Test Project

To run the file within your test project, right click on your Python file inside your Test project and click on Run

Run Test Project - Step 1

How to Test

You can test the generated SDK and the server with automatically generated test cases. unittest is used as the testing framework and nose is used as the test runner. You can run the tests as follows:

  1. From terminal/cmd navigate to the root directory of the SDK.
  2. Invoke 'nosetests'

Initialization

Authentication and Initialization

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
basic_auth_user_name The username to use with basic authentication
basic_auth_password The password to use with basic authentication

API client can be initialized as following.

# Configuration parameters and credentials
basic_auth_user_name = "basic_auth_user_name" # The username to use with basic authentication
basic_auth_password = "basic_auth_password" # The password to use with basic authentication

client = FouleFactoryApiClient(basic_auth_user_name, basic_auth_password)

Class Reference

List of Controllers

Class: TaskAnswerTextsController

Get controller instance

An instance of the TaskAnswerTextsController class can be accessed from the API Client.

 task_answer_texts_client = client.task_answer_texts

Method: get_task_answer_texts_get

Get task answer text by id

def get_task_answer_texts_get(self,
                                  id,
                                  accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = task_answer_texts_client.get_task_answer_texts_get(id, accept_language)

Back to List of Controllers

Class: TaskAnswerChoicesController

Get controller instance

An instance of the TaskAnswerChoicesController class can be accessed from the API Client.

 task_answer_choices_client = client.task_answer_choices

Method: get_task_answer_choices_get

Get task answer choice by id

def get_task_answer_choices_get(self,
                                    id,
                                    accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = task_answer_choices_client.get_task_answer_choices_get(id, accept_language)

Back to List of Controllers

Class: ProjectsController

Get controller instance

An instance of the ProjectsController class can be accessed from the API Client.

 projects_client = client.projects

Method: create_projects_create_project

Create new project

def create_projects_create_project(self,
                                       project,
                                       accept_language = 'fr')

Parameters:

Parameter Tags Description
project Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

project = ProjectWriterServiceModel()
accept_language = 'fr'

result = projects_client.create_projects_create_project(project, accept_language)

Method: get_projects_get_user_projects

Get All projects

def get_projects_get_user_projects(self)

Example Usage:

result = projects_client.get_projects_get_user_projects()

Method: get_projects_get_project_files

Get csv files by project id

def get_projects_get_project_files(self,
                                       id,
                                       accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = projects_client.get_projects_get_project_files(id, accept_language)

Method: get_projects_get_project_task_lines

Get task lines by project id

def get_projects_get_project_task_lines(self,
                                            id,
                                            accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = projects_client.get_projects_get_project_task_lines(id, accept_language)

Method: get_projects_get_project_tasks

Get tasks by project id

def get_projects_get_project_tasks(self,
                                       id,
                                       accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = projects_client.get_projects_get_project_tasks(id, accept_language)

Method: get_projects_get

Get project by id

def get_projects_get(self,
                         id,
                         accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = projects_client.get_projects_get(id, accept_language)

Back to List of Controllers

Class: CsvFilesController

Get controller instance

An instance of the CsvFilesController class can be accessed from the API Client.

 csv_files_client = client.csv_files

Method: create_csv_files_create_csv_file

Create new csv file

def create_csv_files_create_csv_file(self,
                                         csvfiles,
                                         accept_language = 'fr')

Parameters:

Parameter Tags Description
csvfiles Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

csvfiles = CsvFileWriterServiceModel()
accept_language = 'fr'

result = csv_files_client.create_csv_files_create_csv_file(csvfiles, accept_language)

Method: get_csv_files_get

Get csv file by id

def get_csv_files_get(self,
                          id,
                          accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = csv_files_client.get_csv_files_get(id, accept_language)

Back to List of Controllers

Class: AccountController

Get controller instance

An instance of the AccountController class can be accessed from the API Client.

 account_client = client.account

Method: get_account_validate_transaction

TODO: Add a method description

def get_account_validate_transaction(self,
                                         transaction_id,
                                         accept_language = 'fr')

Parameters:

Parameter Tags Description
transactionId Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

transaction_id = 'transactionId'
accept_language = 'fr'

result = account_client.get_account_validate_transaction(transaction_id, accept_language)

Method: create_account_pay_in

Payin

def create_account_pay_in(self,
                              payin,
                              accept_language = 'fr')

Parameters:

Parameter Tags Description
payin Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

payin = PayinServiceModel()
accept_language = 'fr'

result = account_client.create_account_pay_in(payin, accept_language)

Method: get_account_get_wallet

Get wallet

def get_account_get_wallet(self)

Example Usage:

result = account_client.get_account_get_wallet()

Method: create_account_create_account

Tags: Skips Authentication

Create new account

def create_account_create_account(self,
                                      account,
                                      accept_language = 'fr')

Parameters:

Parameter Tags Description
account Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

account = AccountWriterServiceModel()
accept_language = 'fr'

result = account_client.create_account_create_account(account, accept_language)

Method: get_account_get

Get my account

def get_account_get(self)

Example Usage:

result = account_client.get_account_get()

Back to List of Controllers

Class: TemplatesController

Get controller instance

An instance of the TemplatesController class can be accessed from the API Client.

 templates_client = client.templates

Method: create_templates_create_template

Create new template

def create_templates_create_template(self,
                                         template,
                                         accept_language = 'fr')

Parameters:

Parameter Tags Description
template Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

template = TemplateNewWriterServiceModel()
accept_language = 'fr'

result = templates_client.create_templates_create_template(template, accept_language)

Method: get_templates_get_templates

Get all user templates id

def get_templates_get_templates(self)

Example Usage:

result = templates_client.get_templates_get_templates()

Method: get_templates_get_template

Get template by id

def get_templates_get_template(self,
                                   id_template,
                                   accept_language = 'fr')

Parameters:

Parameter Tags Description
idTemplate Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id_template = 187
accept_language = 'fr'

result = templates_client.get_templates_get_template(id_template, accept_language)

Back to List of Controllers

Class: TasksController

Get controller instance

An instance of the TasksController class can be accessed from the API Client.

 tasks_client = client.tasks

Method: update_tasks_validate

Validate task

def update_tasks_validate(self,
                              task,
                              accept_language = 'fr')

Parameters:

Parameter Tags Description
task Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

task = TaskValidationWriterServiceModel()
accept_language = 'fr'

result = tasks_client.update_tasks_validate(task, accept_language)

Method: get_tasks_get_answer_choices

Get task answer choices by task id

def get_tasks_get_answer_choices(self,
                                     id,
                                     accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = tasks_client.get_tasks_get_answer_choices(id, accept_language)

Method: get_tasks_get_answer_texts

Get task answer texts by task id

def get_tasks_get_answer_texts(self,
                                   id,
                                   accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = tasks_client.get_tasks_get_answer_texts(id, accept_language)

Method: get_tasks_get

Get task by id

def get_tasks_get(self,
                      id,
                      accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = tasks_client.get_tasks_get(id, accept_language)

Back to List of Controllers

Class: TaskLinesController

Get controller instance

An instance of the TaskLinesController class can be accessed from the API Client.

 task_lines_client = client.task_lines

Method: create_task_lines_create_task_line

Create new task line

def create_task_lines_create_task_line(self,
                                           task_line,
                                           accept_language = 'fr')

Parameters:

Parameter Tags Description
taskLine Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

task_line = TaskLinesWriterServiceModel()
accept_language = 'fr'

result = task_lines_client.create_task_lines_create_task_line(task_line, accept_language)

Method: get_task_lines_get_tasks_by_line

Get tasks by task line id

def get_task_lines_get_tasks_by_line(self,
                                         id,
                                         accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = task_lines_client.get_task_lines_get_tasks_by_line(id, accept_language)

Method: get_task_lines_get

Get task line by id

def get_task_lines_get(self,
                           id,
                           accept_language = 'fr')

Parameters:

Parameter Tags Description
id Required TODO: Add a parameter description
acceptLanguage Optional DefaultValue TODO: Add a parameter description

Example Usage:

id = 187
accept_language = 'fr'

result = task_lines_client.get_task_lines_get(id, accept_language)

Back to List of Controllers