C# Class OS2Indberetning.BuisnessLogic.APICaller

APICaller is responsible for handling API calling to the backend.
ファイルを表示 Open project: os2indberetning/OS2_Windows_Phone

Public Methods

Method Description
Couple ( string url, string username, string password ) : Task

Couples phone and user through a token id.

GetMunicipalityList ( ) : Task>

Fetches all possible Municipalitys

RefreshModel ( Authorization authorization, Municipality mun ) : Task

Fetches the UserInfoModel belonging to the token.

SubmitDrive ( DriveReport report, Authorization authorization, string munUrl ) : Task

Used to submit drivereport after finished drive.

Private Methods

Method Description
APICaller ( ) : System
DeserializeError ( string jsonString ) : Error
IsValidJson ( string strInput ) : bool
RemoveTrailer ( UserInfoModel model ) : UserInfoModel

Removes Anhænger rate from UserInfoModel.Rates

Method Details

Couple() public static method

Couples phone and user through a token id.
public static Couple ( string url, string username, string password ) : Task
url string Url to post too.
username string
password string
return Task

GetMunicipalityList() public static method

Fetches all possible Municipalitys
public static GetMunicipalityList ( ) : Task>
return Task>

RefreshModel() public static method

Fetches the UserInfoModel belonging to the token.
public static RefreshModel ( Authorization authorization, Municipality mun ) : Task
authorization Authorization the token belonging to the user.
mun OS2Indberetning.Model.Municipality the Municipality the user belongs to.
return Task

SubmitDrive() public static method

Used to submit drivereport after finished drive.
public static SubmitDrive ( DriveReport report, Authorization authorization, string munUrl ) : Task
report OS2Indberetning.Model.DriveReport the report of the drive.
authorization Authorization the token belonging to the user.
munUrl string the municipalicy url to be called
return Task