Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Models and Enums

hitmanpt edited this page Feb 8, 2017 · 3 revisions

Models

The simplicity of interpreting the results comes of the use of models to store the result being then simpler to use and available through IntelliSense

Most Models are inside their namespace for example the model of GetClientsProducts needs to be called like this GetClientsProducts.GetClientsProducts this is because some models need more then one submodel and to avoid any problems with duplicated models each model is in its own namespace

To get the model Product you need to call like this GetClientsProducts.Product

Being the GetClientsProducts the 'root' of the model and the rest its derivates this happens with most of the models and IntelliSense will help you with this.

Each Model is named after it's function so it's easier to remember

There are some exceptions for example the AddClient it does not have it's namespace as it's not a model but a way to generate all the fields necessary to generate the NameValueCollection in a easy way (by just passing the values as arguments)

Donate


Enums

There are a lot of enums to help build a custom function using and supported action (more about this)

There are the APIEnums.Actions witch contains all the supported actions

And APIEnums.[action]Params witch contains all the supported parameters by the action ([action] is replaced by an action for example APIEnums.AddClientParams

To build a NameValueCollection using these enums you need to convert them to string but not with the .ToString();

To properly convert one of these enums to a string you must use the EnumUtil.GetString(Enum);
Usage example `string enumstring = EnumUtil.GetString(APIEnums.AddClient.Firstname);

This not only ensures that you know all the possible parameters but also there's no typo when building the NameValueCollection

Donate